From 80c5875ae01619cbc850c438295c315cc0ac2b81 Mon Sep 17 00:00:00 2001 From: "aashiq.jacob@ibm.com" Date: Fri, 31 May 2024 12:20:13 +0530 Subject: [PATCH 1/5] feat: sample DA for stage first version --- .../catalogValidationValues.json.template | 2 +- solutions/mock-da/main.tf | 31 +++++---------- solutions/mock-da/outputs.tf | 38 ++++--------------- solutions/mock-da/variables.tf | 24 ++---------- 4 files changed, 22 insertions(+), 73 deletions(-) diff --git a/solutions/mock-da/catalogValidationValues.json.template b/solutions/mock-da/catalogValidationValues.json.template index f89a1d5..875f0f3 100644 --- a/solutions/mock-da/catalogValidationValues.json.template +++ b/solutions/mock-da/catalogValidationValues.json.template @@ -1 +1 @@ -{"ibmcloud_api_key": $VALIDATION_APIKEY, "resource_group": $RG_NAME, "resource_tags": $TAGS, "prefix": $PREFIX} +{"ibmcloud_api_key": $VALIDATION_APIKEY} diff --git a/solutions/mock-da/main.tf b/solutions/mock-da/main.tf index 4eb443f..1bd6528 100644 --- a/solutions/mock-da/main.tf +++ b/solutions/mock-da/main.tf @@ -3,28 +3,17 @@ # (if var.resource_group is null, create a new RG using var.prefix) ############################################################################## -resource "ibm_resource_group" "resource_group" { - count = var.resource_group != null ? 0 : 1 - name = "${var.prefix}-rg" - quota_id = null -} - -data "ibm_resource_group" "existing_resource_group" { - count = var.resource_group != null ? 1 : 0 - name = var.resource_group -} locals { - resource_group_id = var.resource_group != null ? data.ibm_resource_group.existing_resource_group[0].id : ibm_resource_group.resource_group[0].id + rg_map = { + for rg in var.resource_group_names : + "${rg}-resource-group" => { + name = rg + } + } } - -############################################################################# -# Call root level module to create SSH key -############################################################################# - -module "mock_module" { - source = "../.." - name = var.prefix - resource_group_id = local.resource_group_id - tags = var.resource_tags +resource "ibm_resource_group" "resource_group" { + for_each = local.rg_map + name = each.value.name + quota_id = null } diff --git a/solutions/mock-da/outputs.tf b/solutions/mock-da/outputs.tf index 95d5439..226c9ff 100644 --- a/solutions/mock-da/outputs.tf +++ b/solutions/mock-da/outputs.tf @@ -2,37 +2,15 @@ # Outputs ############################################################################## -output "ssh_key_id" { - description = "The ID of the ssh key" - value = module.mock_module.ssh_key_id -} - -output "fingerprint" { - description = "SSH key Fingerprint info" - value = module.mock_module.fingerprint -} - -output "test" { - description = "test" - value = var.testing -} - -output "vpc_id" { - description = "ID of VPC created" - value = module.mock_module.vpc_id -} - -output "vpc_crn" { - description = "CRN of VPC created" - value = module.mock_module.vpc_crn -} - output "resource_group" { - description = "Resource Group Name" - value = var.resource_group != null ? var.resource_group : "${var.prefix}-rg" + description = "Resource Group Names" + value = [ + for rg_names in ibm_resource_group.resource_group : + rg_names.id + ] } -output "resource_group_id" { - description = "Resource Group ID" - value = var.resource_group != null ? data.ibm_resource_group.existing_resource_group[0].id : ibm_resource_group.resource_group[0].id +output "resource_group_map" { + description = "Resource Group Names" + value = local.rg_map } diff --git a/solutions/mock-da/variables.tf b/solutions/mock-da/variables.tf index 31fac44..c6343b3 100644 --- a/solutions/mock-da/variables.tf +++ b/solutions/mock-da/variables.tf @@ -10,26 +10,8 @@ variable "region" { default = "us-south" } -variable "prefix" { - type = string - description = "Prefix to append to all resources created by this example" - default = "mock" -} - -variable "resource_group" { - type = string - description = "An existing resource group name to use for this example, if unset a new resource group will be created" - default = null -} - -variable "resource_tags" { - type = list(string) - description = "Optional list of tags to be added to created resources" - default = [] -} - -variable "testing" { +variable "resource_group_names" { type = list(string) - description = "Test variable to test setting list of strings to null" - default = null + description = "List of resource group names to be created." + default = ["mock1", "mock2"] } From 6b08ebb6d93bc578ceeb479227259b572d33ef5a Mon Sep 17 00:00:00 2001 From: "aashiq.jacob@ibm.com" Date: Tue, 4 Jun 2024 10:11:40 +0530 Subject: [PATCH 2/5] update structure --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- README.md | 15 ++------ common-dev-assets | 2 +- .../catalogValidationValues.json.template | 7 +++- .../catalogValidationValues.json.template | 7 +++- main.tf | 34 ++++++------------- outputs.tf | 24 ++++--------- .../catalogValidationValues.json.template | 7 +++- solutions/mock-da-extension/version.tf | 2 +- .../catalogValidationValues.json.template | 7 +++- solutions/mock-da-quickstart/version.tf | 2 +- .../catalogValidationValues.json.template | 4 ++- solutions/mock-da/main.tf | 23 ++++--------- solutions/mock-da/outputs.tf | 10 +----- solutions/mock-da/version.tf | 2 +- tests/go.mod | 4 +-- tests/go.sum | 8 ++--- variables.tf | 25 ++------------ version.tf | 4 --- 20 files changed, 68 insertions(+), 123 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b6bb95..0ef97ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,5 +8,5 @@ on: jobs: call-terraform-ci-pipeline: - uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/common-terraform-module-ci-v2.yml@v1.22.1 + uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/common-terraform-module-ci-v2.yml@v1.22.3 secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3bde59..8cd5e62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,5 +8,5 @@ on: jobs: call-terraform-release-pipeline: - uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/common-release.yml@v1.22.1 + uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/common-release.yml@v1.22.3 secrets: inherit diff --git a/README.md b/README.md index 9dc38fd..5bcd6f1 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,6 @@ No permissions are needed to run this module. |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0, <1.7.0 | | [ibm](#requirement\_ibm) | >= 1.58.1, < 2.0.0 | -| [tls](#requirement\_tls) | >= 4.0.4, < 5.0.0 | ### Modules @@ -63,27 +62,19 @@ No modules. | Name | Type | |------|------| -| [ibm_is_ssh_key.ssh_key](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/is_ssh_key) | resource | -| [ibm_is_vpc.vpc](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/is_vpc) | resource | -| [tls_private_key.tls_key](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) | resource | +| [ibm_resource_group.resource_group](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/resource_group) | resource | ### Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [classic\_access](#input\_classic\_access) | Enable VPC Classic Access. Note: only one VPC per region can have classic access | `bool` | `false` | no | -| [name](#input\_name) | Name of the SSH Key. | `string` | n/a | yes | -| [resource\_group\_id](#input\_resource\_group\_id) | ID of resource group. If not specified, Default resource group used. | `string` | `null` | no | -| [tags](#input\_tags) | List of Tags for the SSH Key. | `list(string)` | `[]` | no | +| [resource\_group\_names](#input\_resource\_group\_names) | List of resource group names to be created. | `list(string)` | `[]` | no | ### Outputs | Name | Description | |------|-------------| -| [fingerprint](#output\_fingerprint) | SSH key Fingerprint info | -| [ssh\_key\_id](#output\_ssh\_key\_id) | The ID of the ssh key | -| [vpc\_crn](#output\_vpc\_crn) | CRN of VPC created | -| [vpc\_id](#output\_vpc\_id) | ID of VPC created | +| [resource\_group](#output\_resource\_group) | Resource Group Names | diff --git a/common-dev-assets b/common-dev-assets index 2015ae9..d50e7e6 160000 --- a/common-dev-assets +++ b/common-dev-assets @@ -1 +1 @@ -Subproject commit 2015ae9933bef5947865c5251e49009bfd06e66c +Subproject commit d50e7e6439f8f0af7bb5df1378fe5bcbfc4f8135 diff --git a/examples/basic/catalogValidationValues.json.template b/examples/basic/catalogValidationValues.json.template index f89a1d5..0a521fd 100644 --- a/examples/basic/catalogValidationValues.json.template +++ b/examples/basic/catalogValidationValues.json.template @@ -1 +1,6 @@ -{"ibmcloud_api_key": $VALIDATION_APIKEY, "resource_group": $RG_NAME, "resource_tags": $TAGS, "prefix": $PREFIX} +{ + "ibmcloud_api_key": $VALIDATION_APIKEY, + "resource_group": $RG_NAME, + "resource_tags": $TAGS, + "prefix": $PREFIX +} diff --git a/examples/complete/catalogValidationValues.json.template b/examples/complete/catalogValidationValues.json.template index f89a1d5..0a521fd 100644 --- a/examples/complete/catalogValidationValues.json.template +++ b/examples/complete/catalogValidationValues.json.template @@ -1 +1,6 @@ -{"ibmcloud_api_key": $VALIDATION_APIKEY, "resource_group": $RG_NAME, "resource_tags": $TAGS, "prefix": $PREFIX} +{ + "ibmcloud_api_key": $VALIDATION_APIKEY, + "resource_group": $RG_NAME, + "resource_tags": $TAGS, + "prefix": $PREFIX +} diff --git a/main.tf b/main.tf index ae91e5e..a401213 100644 --- a/main.tf +++ b/main.tf @@ -1,25 +1,13 @@ -# Create RSA key of size 4096 bits -resource "tls_private_key" "tls_key" { - algorithm = "RSA" - rsa_bits = 4096 +locals { + rg_map = { + for rg in var.resource_group_names : + "${rg}-rg" => { + name = rg + } + } } - -# Import SSH key to IBM Cloud -resource "ibm_is_ssh_key" "ssh_key" { - name = var.name - resource_group = var.resource_group_id - public_key = resource.tls_private_key.tls_key.public_key_openssh - tags = var.tags -} - -# Create a VPC -resource "ibm_is_vpc" "vpc" { - name = "${var.name}-vpc" - resource_group = var.resource_group_id - classic_access = var.classic_access - default_network_acl_name = "${var.name}-edge-acl" - default_security_group_name = "${var.name}-default-sg" - default_routing_table_name = "${var.name}-default-table" - address_prefix_management = "manual" - tags = var.tags +resource "ibm_resource_group" "resource_group" { + for_each = local.rg_map + name = each.value.name + quota_id = null } diff --git a/outputs.tf b/outputs.tf index 2bfeb3f..ab36e9a 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,19 +1,7 @@ -output "ssh_key_id" { - description = "The ID of the ssh key" - value = ibm_is_ssh_key.ssh_key.id -} - -output "fingerprint" { - description = "SSH key Fingerprint info" - value = ibm_is_ssh_key.ssh_key.fingerprint -} - -output "vpc_id" { - description = "ID of VPC created" - value = ibm_is_vpc.vpc.id -} - -output "vpc_crn" { - description = "CRN of VPC created" - value = ibm_is_vpc.vpc.crn +output "resource_group" { + description = "Resource Group Names" + value = [ + for rg_names in ibm_resource_group.resource_group : + rg_names.id + ] } diff --git a/solutions/mock-da-extension/catalogValidationValues.json.template b/solutions/mock-da-extension/catalogValidationValues.json.template index f89a1d5..0a521fd 100644 --- a/solutions/mock-da-extension/catalogValidationValues.json.template +++ b/solutions/mock-da-extension/catalogValidationValues.json.template @@ -1 +1,6 @@ -{"ibmcloud_api_key": $VALIDATION_APIKEY, "resource_group": $RG_NAME, "resource_tags": $TAGS, "prefix": $PREFIX} +{ + "ibmcloud_api_key": $VALIDATION_APIKEY, + "resource_group": $RG_NAME, + "resource_tags": $TAGS, + "prefix": $PREFIX +} diff --git a/solutions/mock-da-extension/version.tf b/solutions/mock-da-extension/version.tf index 77f5438..39d40c5 100644 --- a/solutions/mock-da-extension/version.tf +++ b/solutions/mock-da-extension/version.tf @@ -3,7 +3,7 @@ terraform { required_providers { ibm = { source = "IBM-Cloud/ibm" - version = ">= 1.65.1" + version = ">= 1.66.0" } } } diff --git a/solutions/mock-da-quickstart/catalogValidationValues.json.template b/solutions/mock-da-quickstart/catalogValidationValues.json.template index f89a1d5..0a521fd 100644 --- a/solutions/mock-da-quickstart/catalogValidationValues.json.template +++ b/solutions/mock-da-quickstart/catalogValidationValues.json.template @@ -1 +1,6 @@ -{"ibmcloud_api_key": $VALIDATION_APIKEY, "resource_group": $RG_NAME, "resource_tags": $TAGS, "prefix": $PREFIX} +{ + "ibmcloud_api_key": $VALIDATION_APIKEY, + "resource_group": $RG_NAME, + "resource_tags": $TAGS, + "prefix": $PREFIX +} diff --git a/solutions/mock-da-quickstart/version.tf b/solutions/mock-da-quickstart/version.tf index 77f5438..39d40c5 100644 --- a/solutions/mock-da-quickstart/version.tf +++ b/solutions/mock-da-quickstart/version.tf @@ -3,7 +3,7 @@ terraform { required_providers { ibm = { source = "IBM-Cloud/ibm" - version = ">= 1.65.1" + version = ">= 1.66.0" } } } diff --git a/solutions/mock-da/catalogValidationValues.json.template b/solutions/mock-da/catalogValidationValues.json.template index 875f0f3..f48a7e3 100644 --- a/solutions/mock-da/catalogValidationValues.json.template +++ b/solutions/mock-da/catalogValidationValues.json.template @@ -1 +1,3 @@ -{"ibmcloud_api_key": $VALIDATION_APIKEY} +{ + "ibmcloud_api_key": $VALIDATION_APIKEY +} diff --git a/solutions/mock-da/main.tf b/solutions/mock-da/main.tf index 1bd6528..4236936 100644 --- a/solutions/mock-da/main.tf +++ b/solutions/mock-da/main.tf @@ -1,19 +1,8 @@ -############################################################################## -# Resource Group -# (if var.resource_group is null, create a new RG using var.prefix) -############################################################################## +############################################################################# +# Call root level module +############################################################################# - -locals { - rg_map = { - for rg in var.resource_group_names : - "${rg}-resource-group" => { - name = rg - } - } -} -resource "ibm_resource_group" "resource_group" { - for_each = local.rg_map - name = each.value.name - quota_id = null +module "mock_module" { + source = "../.." + resource_group_names = var.resource_group_names } diff --git a/solutions/mock-da/outputs.tf b/solutions/mock-da/outputs.tf index 226c9ff..a01156c 100644 --- a/solutions/mock-da/outputs.tf +++ b/solutions/mock-da/outputs.tf @@ -4,13 +4,5 @@ output "resource_group" { description = "Resource Group Names" - value = [ - for rg_names in ibm_resource_group.resource_group : - rg_names.id - ] -} - -output "resource_group_map" { - description = "Resource Group Names" - value = local.rg_map + value = module.mock_module.resource_group } diff --git a/solutions/mock-da/version.tf b/solutions/mock-da/version.tf index 77f5438..39d40c5 100644 --- a/solutions/mock-da/version.tf +++ b/solutions/mock-da/version.tf @@ -3,7 +3,7 @@ terraform { required_providers { ibm = { source = "IBM-Cloud/ibm" - version = ">= 1.65.1" + version = ">= 1.66.0" } } } diff --git a/tests/go.mod b/tests/go.mod index 55514ce..ad47a33 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.3 require ( github.com/stretchr/testify v1.9.0 - github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.31.8 + github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.34.1 ) require ( @@ -16,7 +16,7 @@ require ( cloud.google.com/go/iam v1.1.1 // indirect cloud.google.com/go/storage v1.30.1 // indirect dario.cat/mergo v1.0.0 // indirect - github.com/IBM-Cloud/bluemix-go v0.0.0-20240402122236-5c5b994a3f1a // indirect + github.com/IBM-Cloud/bluemix-go v0.0.0-20240423071914-9e96525baef4 // indirect github.com/IBM-Cloud/power-go-client v1.6.0 // indirect github.com/IBM/cloud-databases-go-sdk v0.7.0 // indirect github.com/IBM/go-sdk-core/v5 v5.17.2 // indirect diff --git a/tests/go.sum b/tests/go.sum index 9c41e7a..35990f2 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -189,8 +189,8 @@ dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/IBM-Cloud/bluemix-go v0.0.0-20240402122236-5c5b994a3f1a h1:s/KeK5F3xm3xGeqXzCtqMl3nvqQ2my4N5ppxAD+cShY= -github.com/IBM-Cloud/bluemix-go v0.0.0-20240402122236-5c5b994a3f1a/go.mod h1:/7hMjdZA6fEpd/dQAOEABxKEwN0t72P3PlpEDu0Y7bE= +github.com/IBM-Cloud/bluemix-go v0.0.0-20240423071914-9e96525baef4 h1:43l8CU5cW4pOea10+jWtqRJj/4F4Ghfn6Oc82jB9RhM= +github.com/IBM-Cloud/bluemix-go v0.0.0-20240423071914-9e96525baef4/go.mod h1:/7hMjdZA6fEpd/dQAOEABxKEwN0t72P3PlpEDu0Y7bE= github.com/IBM-Cloud/power-go-client v1.6.0 h1:X+QX+WSF66+aouyaf4r+IeBLXUurAJj9+Bd+vH7G5I0= github.com/IBM-Cloud/power-go-client v1.6.0/go.mod h1:0ad5Lcq1utoYVJx0uqooMjCpUaYaK0ItP9QJYtY6k0Y= github.com/IBM/cloud-databases-go-sdk v0.7.0 h1:prvLebKD1kcIk81D6yRhOr/TWp1VQJGLhGAasQr7RtA= @@ -606,8 +606,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.31.8 h1:tphVylXH3w/IQ/3BQcMdnOApxpbBiVrXuhP1YQ5DyAY= -github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.31.8/go.mod h1:6kBsZGhfJEV5L0lOJI+e1jzj8D2E+eltAYZFmYw3Q9s= +github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.34.1 h1:hw5Pivm1fbjpbloEjRcM68178DdAGguwJCF6ZD8UhWs= +github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.34.1/go.mod h1:2fA+HDax1ZxE6o9qR1331MT67nRC/WVYgxpVLyB/ovw= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmccombs/hcl2json v0.5.0 h1:cT2sXStOzKL06c8ZTf9vh+0N8GKGzV7+9RUaY5/iUP8= github.com/tmccombs/hcl2json v0.5.0/go.mod h1:B0ZpBthAKbQur6yZRKrtaqDmYLCvgnwHOBApE0faCpU= diff --git a/variables.tf b/variables.tf index 8822412..c6e40f4 100644 --- a/variables.tf +++ b/variables.tf @@ -1,26 +1,5 @@ -variable "name" { - description = "Name of the SSH Key." - type = string -} - -variable "resource_group_id" { - description = "ID of resource group. If not specified, Default resource group used." - type = string - default = null -} - -variable "tags" { - description = "List of Tags for the SSH Key." +variable "resource_group_names" { type = list(string) + description = "List of resource group names to be created." default = [] } - -############################################################################# -# VPC Variables -############################################################################## - -variable "classic_access" { - description = "Enable VPC Classic Access. Note: only one VPC per region can have classic access" - type = bool - default = false -} diff --git a/version.tf b/version.tf index 5ab5b2c..4ca7f47 100644 --- a/version.tf +++ b/version.tf @@ -5,9 +5,5 @@ terraform { source = "ibm-cloud/ibm" version = ">= 1.58.1, < 2.0.0" } - tls = { - source = "hashicorp/tls" - version = ">= 4.0.4, < 5.0.0" - } } } From 3ede39473a4abb779e114c89977a3b155b7fdd0d Mon Sep 17 00:00:00 2001 From: "aashiq.jacob@ibm.com" Date: Thu, 6 Jun 2024 09:40:12 +0530 Subject: [PATCH 3/5] remove custom config --- ibm_catalog.json | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/ibm_catalog.json b/ibm_catalog.json index f5e39e1..fe4e56e 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -203,20 +203,6 @@ } ] }, - "configuration": [ - { - "custom_config": { - "config_constraints": { - "generationType": "2" - }, - "grouping": "deployment", - "original_grouping": "deployment", - "type": "vpc_region" - }, - "key": "region", - "required": true - } - ], "iam_permissions": [ { "role_crns": [ From e9c1d2bfe2e317c9fb962f566fa50c2ee82a9819 Mon Sep 17 00:00:00 2001 From: "aashiq.jacob@ibm.com" Date: Wed, 20 Nov 2024 11:58:37 +0530 Subject: [PATCH 4/5] add tags --- main.tf | 1 + solutions/mock-da/main.tf | 1 + solutions/mock-da/variables.tf | 6 ++++++ variables.tf | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/main.tf b/main.tf index a401213..3c22631 100644 --- a/main.tf +++ b/main.tf @@ -5,6 +5,7 @@ locals { name = rg } } + tags = var.tags != null ? join(",", var.tags) : "none" } resource "ibm_resource_group" "resource_group" { for_each = local.rg_map diff --git a/solutions/mock-da/main.tf b/solutions/mock-da/main.tf index 4236936..bfa61b5 100644 --- a/solutions/mock-da/main.tf +++ b/solutions/mock-da/main.tf @@ -5,4 +5,5 @@ module "mock_module" { source = "../.." resource_group_names = var.resource_group_names + tags = var.resource_tags } diff --git a/solutions/mock-da/variables.tf b/solutions/mock-da/variables.tf index c6343b3..12b53f6 100644 --- a/solutions/mock-da/variables.tf +++ b/solutions/mock-da/variables.tf @@ -15,3 +15,9 @@ variable "resource_group_names" { description = "List of resource group names to be created." default = ["mock1", "mock2"] } + +variable "resource_tags" { + type = list(string) + description = "Optional list of tags to be added to created resources" + default = [] +} \ No newline at end of file diff --git a/variables.tf b/variables.tf index c6e40f4..ed34087 100644 --- a/variables.tf +++ b/variables.tf @@ -3,3 +3,9 @@ variable "resource_group_names" { description = "List of resource group names to be created." default = [] } + +variable "tags" { + description = "List of Tags for the SSH Key." + type = list(string) + default = [] +} From 74a805457569e5a574a0fecfc5e0514b45a4ef95 Mon Sep 17 00:00:00 2001 From: "aashiq.jacob@ibm.com" Date: Wed, 20 Nov 2024 13:28:40 +0530 Subject: [PATCH 5/5] update variable name --- common-dev-assets | 2 +- solutions/mock-da/main.tf | 2 +- solutions/mock-da/variables.tf | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common-dev-assets b/common-dev-assets index d50e7e6..247369d 160000 --- a/common-dev-assets +++ b/common-dev-assets @@ -1 +1 @@ -Subproject commit d50e7e6439f8f0af7bb5df1378fe5bcbfc4f8135 +Subproject commit 247369df3a2cb75981553d7895ed2b4d651d5aed diff --git a/solutions/mock-da/main.tf b/solutions/mock-da/main.tf index bfa61b5..5e6aa80 100644 --- a/solutions/mock-da/main.tf +++ b/solutions/mock-da/main.tf @@ -5,5 +5,5 @@ module "mock_module" { source = "../.." resource_group_names = var.resource_group_names - tags = var.resource_tags + tags = var.tags } diff --git a/solutions/mock-da/variables.tf b/solutions/mock-da/variables.tf index 12b53f6..2477b0d 100644 --- a/solutions/mock-da/variables.tf +++ b/solutions/mock-da/variables.tf @@ -16,8 +16,8 @@ variable "resource_group_names" { default = ["mock1", "mock2"] } -variable "resource_tags" { +variable "tags" { type = list(string) description = "Optional list of tags to be added to created resources" default = [] -} \ No newline at end of file +}