forked from IBM-Cloud/terraform-provider-ibm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace container registry provider with generated variant (IBM-Cloud…
…#2372) * Replace Container Registry provider with generated version Signed-off-by: James Hart <[email protected]> * Update secrets baseline Signed-off-by: James Hart <[email protected]> * Revert "Update secrets baseline" This reverts commit 04cc2d1. * Make the correct update to .secrets.baseline Signed-off-by: James Hart <[email protected]> * Updates from generator 3.31.0 to address review comments Signed-off-by: James Hart <[email protected]> * update secrets baseline Signed-off-by: James Hart <[email protected]> * Correct the default value for retain_untagged Signed-off-by: James Hart <[email protected]> * Error if images_per_repo not set Signed-off-by: James Hart <[email protected]> * Refix hand-edit for images_per_repo not set Signed-off-by: James Hart <[email protected]> * Make images_per_repo mandatory in cr retention policy Signed-off-by: James Hart <[email protected]> * Fix error handling in cr namespace datasource Signed-off-by: James Hart <[email protected]>
- Loading branch information
Showing
19 changed files
with
855 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
provider "ibm" { | ||
region = "eu-gb" | ||
ibmcloud_api_key = var.ibmcloud_api_key | ||
} | ||
data "ibm_resource_group" "rg" { | ||
name = var.resource_group_name | ||
|
||
// Provision cr_namespace resource instance | ||
resource "ibm_cr_namespace" "cr_namespace_instance" { | ||
name = var.cr_namespace_name | ||
resource_group_id = data.ibm_resource_group.default_group.id | ||
tags = var.cr_namespace_tags | ||
} | ||
resource "ibm_cr_namespace" "namespace" { | ||
name = var.name | ||
resource_group_id = data.ibm_resource_group.rg.id | ||
|
||
// Provision cr_retention_policy resource instance | ||
resource "ibm_cr_retention_policy" "cr_retention_policy_instance" { | ||
namespace = var.cr_retention_policy_namespace | ||
images_per_repo = var.cr_retention_policy_images_per_repo | ||
retain_untagged = var.cr_retention_policy_retain_untagged | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
output "namespace_crn" { | ||
value = ibm_cr_namespace.namespace.crn | ||
} | ||
// This allows cr_namespace data to be referenced by other resources and the terraform CLI | ||
// Modify this if only certain data should be exposed | ||
output "ibm_cr_namespace" { | ||
value = ibm_cr_namespace.cr_namespace_instance | ||
description = "cr_namespace resource instance" | ||
} | ||
// This allows cr_retention_policy data to be referenced by other resources and the terraform CLI | ||
// Modify this if only certain data should be exposed | ||
output "ibm_cr_retention_policy" { | ||
value = ibm_cr_retention_policy.cr_retention_policy_instance | ||
description = "cr_retention_policy resource instance" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,38 @@ | ||
variable "name" { | ||
type= string | ||
description = "Name of the Namespace that has to be created" | ||
} | ||
variable "resource_group_name" { | ||
type= string | ||
description = "Name of the resource group in which Namespace that has to be created" | ||
} | ||
variable "ibmcloud_api_key" { | ||
description = "IBM Cloud API key" | ||
type = string | ||
} | ||
|
||
// Resource arguments for cr_namespace | ||
variable "cr_namespace_name" { | ||
description = "The name of the namespace." | ||
type = string | ||
default = "name" | ||
} | ||
variable "cr_namespace_resource_group_id" { | ||
description = "The ID of the resource group that the namespace will be created within." | ||
type = string | ||
default = "placeholder" | ||
} | ||
variable "cr_namespace_tags" { | ||
description = "Local tags associated with cr_namespace" | ||
type = set(string) | ||
default = [] | ||
} | ||
|
||
// Resource arguments for cr_retention_policy | ||
variable "cr_retention_policy_namespace" { | ||
description = "The namespace to which the retention policy is attached." | ||
type = string | ||
default = "birds" | ||
} | ||
variable "cr_retention_policy_images_per_repo" { | ||
description = "Determines how many images will be retained for each repository when the retention policy is executed. The value -1 denotes 'Unlimited' (all images are retained)." | ||
type = number | ||
default = 10 | ||
} | ||
variable "cr_retention_policy_retain_untagged" { | ||
description = "Determines if untagged images are retained when executing the retention policy. This is false by default meaning untagged images will be deleted when the policy is executed." | ||
type = bool | ||
default = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
terraform { | ||
required_version = ">= 0.12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.