Skip to content

Commit 9726de3

Browse files
Khuzaima-ShakeelKhuzaima-Shakeel
authored andcommitted
renamed the tags variable
1 parent 8cc7740 commit 9726de3

File tree

10 files changed

+21
-26
lines changed

10 files changed

+21
-26
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"ibmcloud_api_key": $VALIDATION_APIKEY,
33
"region": "us-south",
4-
"tags": $TAGS,
4+
"resource_tags": $TAGS,
55
"prefix": $PREFIX
66
}

examples/backup-restore/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module "restored_icd_mongodb" {
2222
region = var.region
2323
mongodb_version = var.mongodb_version
2424
access_tags = var.access_tags
25-
tags = var.tags
25+
tags = var.resource_tags
2626
member_host_flavor = "multitenant"
2727
backup_crn = data.ibm_database_backups.backup_database.backups[0].backup_id
2828
}

examples/backup-restore/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ variable "mongodb_version" {
3434
default = null
3535
}
3636

37-
variable "tags" {
37+
variable "resource_tags" {
3838
type = list(string)
3939
description = "Optional list of tags to be added to created resources"
4040
default = []

examples/basic/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module "database" {
2121
region = var.region
2222
mongodb_version = var.mongodb_version
2323
access_tags = var.access_tags
24-
tags = var.tags
24+
tags = var.resource_tags
2525
service_endpoints = var.service_endpoints
2626
member_host_flavor = var.member_host_flavor
2727
service_credential_names = {

examples/basic/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ variable "mongodb_version" {
3434
default = null
3535
}
3636

37-
variable "tags" {
37+
variable "resource_tags" {
3838
type = list(string)
3939
description = "Optional list of tags to be added to created resources"
4040
default = []

examples/complete/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module "resource_group" {
3131
resource "ibm_is_vpc" "example_vpc" {
3232
name = "${var.prefix}-vpc"
3333
resource_group = module.resource_group.resource_group_id
34-
tags = var.tags
34+
tags = var.resource_tags
3535
}
3636

3737
resource "ibm_is_subnet" "testacc_subnet" {
@@ -59,7 +59,7 @@ module "key_protect_all_inclusive" {
5959
# Note: Database instance and Key Protect must be created on the same region.
6060
region = var.region
6161
key_protect_instance_name = "${var.prefix}-kp"
62-
resource_tags = var.tags
62+
resource_tags = var.resource_tags
6363
keys = [
6464
{
6565
key_ring_name = "icd"
@@ -113,7 +113,7 @@ module "icd_mongodb" {
113113
region = var.region
114114
plan = var.plan
115115
access_tags = var.access_tags
116-
tags = var.tags
116+
tags = var.resource_tags
117117
auto_scaling = var.auto_scaling
118118
# Example of how to use different KMS keys for data and backups
119119
use_ibm_owned_encryption_key = false
@@ -139,7 +139,7 @@ module "secrets_manager" {
139139
secrets_manager_name = "${var.prefix}-secrets-manager"
140140
sm_service_plan = "trial"
141141
allowed_network = "public-and-private"
142-
sm_tags = var.tags
142+
sm_tags = var.resource_tags
143143
}
144144

145145
# Add a Secrets Group to the secret manager instance

examples/complete/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ variable "resource_group" {
2323
default = null
2424
}
2525

26-
variable "tags" {
26+
variable "resource_tags" {
2727
type = list(string)
2828
description = "Optional list of tags to be added to created resources"
2929
default = []

examples/fscloud/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data "ibm_iam_account_settings" "iam_account_settings" {
2323
resource "ibm_is_vpc" "example_vpc" {
2424
name = "${var.prefix}-vpc"
2525
resource_group = module.resource_group.resource_group_id
26-
tags = var.tags
26+
tags = var.resource_tags
2727
}
2828

2929
resource "ibm_is_subnet" "testacc_subnet" {
@@ -58,7 +58,7 @@ module "mongodb" {
5858
resource_group_id = module.resource_group.resource_group_id
5959
name = "${var.prefix}-mongodb"
6060
region = var.region
61-
tags = var.tags
61+
tags = var.resource_tags
6262
access_tags = var.access_tags
6363
kms_key_crn = var.kms_key_crn
6464
backup_encryption_key_crn = var.backup_encryption_key_crn

examples/fscloud/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ variable "resource_group" {
2222
default = null
2323
}
2424

25-
variable "tags" {
25+
variable "resource_tags" {
2626
type = list(string)
2727
description = "Optional list of tags to be added to created resources"
2828
default = []

tests/other_test.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,21 @@ package test
33

44
import (
55
"fmt"
6-
"strings"
76

87
"testing"
98

10-
"github.com/gruntwork-io/terratest/modules/random"
119
"github.com/stretchr/testify/assert"
1210
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
1311
)
1412

1513
func testPlanICDVersions(t *testing.T, version string) {
1614
t.Parallel()
1715

18-
prefix := fmt.Sprintf("mongo-%s", strings.ToLower(random.UniqueId()))
19-
options := testhelper.TestOptionsDefault(&testhelper.TestOptions{
16+
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
2017
Testing: t,
2118
TerraformDir: "examples/basic",
2219
TerraformVars: map[string]interface{}{
2320
"mongodb_version": version,
24-
"prefix": prefix,
25-
"region": fmt.Sprint(permanentResources["mongodbRegion"]),
2621
},
2722
CloudInfoService: sharedInfoSvc,
2823
})
@@ -43,15 +38,15 @@ func TestPlanICDVersions(t *testing.T) {
4338

4439
func TestRunRestoredDBExample(t *testing.T) {
4540
t.Parallel()
46-
prefix := fmt.Sprintf("mongodb-res-%s", strings.ToLower(random.UniqueId()))
47-
options := testhelper.TestOptionsDefault(&testhelper.TestOptions{
48-
Testing: t,
49-
TerraformDir: "examples/backup-restore",
41+
42+
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
43+
Testing: t,
44+
TerraformDir: "examples/backup-restore",
45+
Prefix: "mongo-restored",
46+
Region: fmt.Sprint(permanentResources["mongodbRegion"]),
47+
ResourceGroup: resourceGroup,
5048
TerraformVars: map[string]interface{}{
5149
"existing_database_crn": permanentResources["mongodbCrn"],
52-
"prefix": prefix,
53-
"region": fmt.Sprint(permanentResources["mongodbRegion"]),
54-
"resource_group": resourceGroup,
5550
},
5651
CloudInfoService: sharedInfoSvc,
5752
})

0 commit comments

Comments
 (0)