Skip to content

Commit c1de37a

Browse files
feat: remove Account Config DA from customize DA flow, add default value for prefix using random string generator and update logic that handles default resource group lookup (#573)
1 parent 7632295 commit c1de37a

File tree

5 files changed

+33
-60
lines changed

5 files changed

+33
-60
lines changed

ibm_catalog.json

Lines changed: 26 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@
7272
},
7373
{
7474
"key": "prefix",
75-
"required": true,
75+
"default_value": "dev",
76+
"random_string": {
77+
"length": 4
78+
},
7679
"value_constraints": [
7780
{
7881
"type": "regex",
79-
"description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters.",
82+
"description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters",
8083
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
8184
}
8285
]
@@ -152,9 +155,7 @@
152155
"config_constraints": {
153156
"identifier": "rg_name"
154157
}
155-
},
156-
"default_value": "Default",
157-
"description": "The name of an existing resource group to provision the resources."
158+
}
158159
},
159160
{
160161
"key": "existing_monitoring_crn",
@@ -361,11 +362,14 @@
361362
},
362363
{
363364
"key": "prefix",
364-
"required": true,
365+
"default_value": "dev",
366+
"random_string": {
367+
"length": 4
368+
},
365369
"value_constraints": [
366370
{
367371
"type": "regex",
368-
"description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters.",
372+
"description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters",
369373
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
370374
}
371375
]
@@ -448,9 +452,7 @@
448452
"config_constraints": {
449453
"identifier": "rg_name"
450454
}
451-
},
452-
"default_value": "Default",
453-
"description": "The name of an existing resource group to provision the resources."
455+
}
454456
},
455457
{
456458
"key": "existing_monitoring_crn",
@@ -679,20 +681,6 @@
679681
"service_name": "Resource group only",
680682
"notes": "Required to create an instance of Event Notifications."
681683
},
682-
{
683-
"role_crns": [
684-
"crn:v1:bluemix:public:iam::::role:Administrator"
685-
],
686-
"service_name": "All Account Management services",
687-
"notes": "[Optional] Required to deploy Cloud automation for account configuration, which creates foundational IBM Cloud account resources, like IAM settings, trusted profiles, access groups, and resource groups."
688-
},
689-
{
690-
"role_crns": [
691-
"crn:v1:bluemix:public:iam::::role:Administrator"
692-
],
693-
"service_name": "All Identity and Access enabled services",
694-
"notes": "[Optional] Required to deploy Cloud automation for account configuration, which creates foundational IBM Cloud account resources, like IAM settings, trusted profiles, access groups, and resource groups."
695-
},
696684
{
697685
"role_crns": [
698686
"crn:v1:bluemix:public:iam::::serviceRole:Manager",
@@ -762,31 +750,6 @@
762750
]
763751
},
764752
"dependencies": [
765-
{
766-
"name": "deploy-arch-ibm-account-infra-base",
767-
"description": "Organize your IBM Cloud account with preconfigured resource groups. If not selected, the default resource group is used. Optionally, expand to apply recommended security controls via \"with Account Settings\" variation.",
768-
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
769-
"flavors": [
770-
"resource-group-only",
771-
"resource-groups-with-account-settings"
772-
],
773-
"default_flavor": "resource-group-only",
774-
"id": "63641cec-6093-4b4f-b7b0-98d2f4185cd6-global",
775-
"input_mapping": [
776-
{
777-
"dependency_input": "prefix",
778-
"version_input": "prefix",
779-
"reference_version": true
780-
},
781-
{
782-
"dependency_output": "observability_resource_group_name",
783-
"version_input": "existing_resource_group_name"
784-
}
785-
],
786-
"optional": true,
787-
"on_by_default": false,
788-
"version": "v3.0.23"
789-
},
790753
{
791754
"name": "deploy-arch-ibm-cloud-monitoring",
792755
"description": "Set up a Cloud Monitoring instance to collect platform metrics.",
@@ -800,6 +763,11 @@
800763
"dependency_output": "cloud_monitoring_crn",
801764
"version_input": "existing_monitoring_crn"
802765
},
766+
{
767+
"dependency_input": "existing_resource_group_name",
768+
"version_input": "existing_resource_group_name",
769+
"reference_version": true
770+
},
803771
{
804772
"dependency_input": "prefix",
805773
"version_input": "prefix",
@@ -818,7 +786,7 @@
818786
],
819787
"optional": true,
820788
"on_by_default": true,
821-
"version": "v1.7.2"
789+
"version": "v1.9.0"
822790
},
823791
{
824792
"name": "deploy-arch-ibm-kms",
@@ -833,6 +801,11 @@
833801
"dependency_output": "kms_instance_crn",
834802
"version_input": "existing_kms_instance_crn"
835803
},
804+
{
805+
"dependency_input": "existing_resource_group_name",
806+
"version_input": "existing_resource_group_name",
807+
"reference_version": true
808+
},
836809
{
837810
"dependency_output": "kms_private_endpoint",
838811
"version_input": "kms_endpoint_url"
@@ -854,7 +827,7 @@
854827
],
855828
"optional": true,
856829
"on_by_default": true,
857-
"version": "v5.1.27"
830+
"version": "v5.4.0"
858831
},
859832
{
860833
"name": "deploy-arch-ibm-cos",
@@ -875,7 +848,7 @@
875848
"reference_version": true
876849
},
877850
{
878-
"dependency_input": "resource_group_name",
851+
"dependency_input": "existing_resource_group_name",
879852
"version_input": "existing_resource_group_name",
880853
"reference_version": true
881854
},
@@ -886,7 +859,7 @@
886859
],
887860
"optional": true,
888861
"on_by_default": true,
889-
"version": "v10.2.21"
862+
"version": "v10.5.0"
890863
}
891864
],
892865
"dependency_version_2": true,

solutions/fully-configurable/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module "resource_group" {
66
source = "terraform-ibm-modules/resource-group/ibm"
7-
version = "1.3.0"
7+
version = "1.4.0"
88
existing_resource_group_name = var.existing_resource_group_name
99
}
1010

solutions/fully-configurable/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
variable "existing_resource_group_name" {
66
type = string
7-
description = "The name of an existing resource group to provision the resources. If not provided the default resource group will be used."
8-
default = null
7+
description = "The name of an existing resource group to provision the resources."
8+
default = "Default"
99
}
1010

1111
variable "ibmcloud_api_key" {

solutions/security-enforced/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
variable "existing_resource_group_name" {
66
type = string
7-
description = "The name of an existing resource group to provision the resources. If not provided the default resource group will be used."
8-
default = null
7+
description = "The name of an existing resource group to provision the resources."
8+
default = "Default"
99
}
1010

1111
variable "ibmcloud_api_key" {

tests/pr_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ func TestAddonDefaultConfiguration(t *testing.T) {
207207
"deploy-arch-ibm-event-notifications",
208208
"fully-configurable",
209209
map[string]interface{}{
210-
"prefix": options.Prefix,
211-
"region": validRegions[rand.Intn(len(validRegions))],
210+
"region": validRegions[rand.Intn(len(validRegions))],
211+
"existing_resource_group": resourceGroup,
212212
},
213213
)
214214

0 commit comments

Comments
 (0)