Skip to content

Commit 6d6e2df

Browse files
committed
2 parents cb39b3b + f2da2ad commit 6d6e2df

File tree

9 files changed

+192
-220
lines changed

9 files changed

+192
-220
lines changed

examples/advanced/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ An end-to-end example that will provision the following:
88
- A new resource group if one is not passed in.
99
- A new Key Management Service instance with Key Protect encryption.
1010
- A root key inside the key ring for the above KMS instance.
11-
- A new Event Notification instance.
11+
- A new Event Notifications instance.
1212
- A new App Configuration instance.
1313
- A new collection within the App Configuration instance.
1414
- Configuration aggregator ([learn more](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-configuration-aggregator))
1515
- Integration between App Configuration and Key Management Service instance.
1616
- Integration between App Configuration and Event Notification instance.
17-
- A simple VPC
18-
- A CBR zone for the VPC
19-
- A CBR rule to only allow the App Configuration instance to be accessed from within the VPC zone over private endpoint
17+
- A CBR zone for the Schematics service
18+
- A CBR rule to only allow the App Configuration instance to be accessed from Schematics over private endpoint

examples/advanced/main.tf

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,21 @@ data "ibm_iam_account_settings" "iam_account_settings" {
1818
}
1919

2020
##############################################################################
21-
# VPC
22-
##############################################################################
23-
resource "ibm_is_vpc" "example_vpc" {
24-
name = "${var.prefix}-vpc"
25-
resource_group = module.resource_group.resource_group_id
26-
tags = var.resource_tags
27-
}
28-
29-
##############################################################################
30-
# Create CBR Zone
21+
# Create CBR Zone for Schematics service
3122
##############################################################################
3223

3324
module "cbr_zone" {
3425
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
35-
version = "1.33.0"
36-
name = "${var.prefix}-VPC-network-zone"
37-
zone_description = "CBR Network zone representing VPC"
26+
version = "1.33.2"
27+
name = "${var.prefix}-schematics-zone"
28+
zone_description = "CBR Network zone containing Schematics"
3829
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
3930
addresses = [{
40-
type = "vpc", # to bind a specific vpc to the zone
41-
value = ibm_is_vpc.example_vpc.crn,
31+
type = "serviceRef",
32+
ref = {
33+
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
34+
service_name = "schematics"
35+
}
4236
}]
4337
}
4438

@@ -77,7 +71,7 @@ module "key_protect_all_inclusive" {
7771
# Create EN Instance
7872
##############################################################################
7973

80-
module "event_notification" {
74+
module "event_notifications" {
8175
source = "terraform-ibm-modules/event-notifications/ibm"
8276
version = "2.7.0"
8377
resource_group_id = module.resource_group.resource_group_id
@@ -111,7 +105,7 @@ module "app_config" {
111105
]
112106
cbr_rules = [
113107
{
114-
description = "${var.prefix}-APP-CONF access only from vpc"
108+
description = "${var.prefix}-APP-CONF access only from Schematics"
115109
enforcement_mode = "enabled"
116110
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
117111
tags = [
@@ -138,6 +132,6 @@ module "app_config" {
138132
root_key_id = module.key_protect_all_inclusive.keys["${local.key_ring_name}.${local.key_name}"].key_id
139133
kms_endpoint_url = module.key_protect_all_inclusive.kms_public_endpoint
140134
enable_event_notifications = true
141-
existing_event_notifications_instance_crn = module.event_notification.crn
142-
event_notifications_endpoint_url = module.event_notification.event_notifications_public_endpoint
135+
existing_event_notifications_instance_crn = module.event_notifications.crn
136+
event_notifications_endpoint_url = module.event_notifications.event_notifications_public_endpoint
143137
}

ibm_catalog.json

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"terraform",
1111
"solution",
1212
"target_terraform",
13-
"converged_infra"
13+
"platform_engineering"
1414
],
1515
"keywords": [
1616
"terraform",
@@ -66,14 +66,7 @@
6666
},
6767
{
6868
"key": "prefix",
69-
"required": true,
70-
"value_constraints": [
71-
{
72-
"type": "regex",
73-
"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",
74-
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
75-
}
76-
]
69+
"required": true
7770
},
7871
{
7972
"key": "region",
@@ -195,7 +188,9 @@
195188
"config_constraints": {
196189
"identifier": "rg_name"
197190
}
198-
}
191+
},
192+
"default_value": "Default",
193+
"description": "The name of an existing resource group to provision the resources."
199194
},
200195
{
201196
"key": "app_config_name"
@@ -275,24 +270,10 @@
275270
"key": "ibmcloud_kms_api_key"
276271
},
277272
{
278-
"key": "existing_kms_instance_crn",
279-
"value_constraints": [
280-
{
281-
"type": "regex",
282-
"description": "The value provided for 'existing_kms_instance_crn' is not valid.",
283-
"value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
284-
}
285-
]
273+
"key": "existing_kms_instance_crn"
286274
},
287275
{
288-
"key": "existing_kms_key_crn",
289-
"value_constraints": [
290-
{
291-
"type": "regex",
292-
"description": "The value provided for 'existing_kms_key_crn' is not valid.",
293-
"value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}:key:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
294-
}
295-
]
276+
"key": "existing_kms_key_crn"
296277
},
297278
{
298279
"key": "kms_endpoint_type",
@@ -324,14 +305,7 @@
324305
"key": "skip_app_config_event_notifications_auth_policy"
325306
},
326307
{
327-
"key": "existing_event_notifications_instance_crn",
328-
"value_constraints": [
329-
{
330-
"type": "regex",
331-
"description": "The value provided for 'existing_event_notifications_instance_crn' is not valid.",
332-
"value": "^__NULL__$|^crn:(.*:){3}event-notifications:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
333-
}
334-
]
308+
"key": "existing_event_notifications_instance_crn"
335309
},
336310
{
337311
"key": "event_notifications_endpoint_url"
@@ -476,7 +450,7 @@
476450
"dependencies": [
477451
{
478452
"name": "deploy-arch-ibm-account-infra-base",
479-
"description": "Cloud automation for Account Configuration organizes your IBM Cloud account with a ready-made set of resource groups by default. When you enable the \"with Account Settings\" option, it also applies baseline security and governance settings.",
453+
"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.",
480454
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
481455
"flavors": [
482456
"resource-group-only",
@@ -502,7 +476,7 @@
502476
],
503477
"optional": true,
504478
"on_by_default": false,
505-
"version": "v3.0.7"
479+
"version": "v3.0.23"
506480
},
507481
{
508482
"name": "deploy-arch-ibm-cloud-logs",
@@ -512,7 +486,7 @@
512486
"fully-configurable"
513487
],
514488
"id": "63d8ae58-fbf3-41ce-b844-0fb5b85882ab-global",
515-
"version": "v1.6.11",
489+
"version": "v1.6.28",
516490
"optional": true,
517491
"on_by_default": true,
518492
"input_mapping": [
@@ -537,7 +511,7 @@
537511
"name": "deploy-arch-ibm-cloud-monitoring",
538512
"description": "Configure IBM Cloud Monitoring to collect the platform metrics.",
539513
"id": "73debdbf-894f-4c14-81c7-5ece3a70b67d-global",
540-
"version": "v1.6.4",
514+
"version": "v1.7.2",
541515
"flavors": [
542516
"fully-configurable"
543517
],
@@ -566,7 +540,7 @@
566540
"name": "deploy-arch-ibm-activity-tracker",
567541
"description": "Configure Activity Tracker Event Routing to route the auditing events.",
568542
"id": "918453c3-4f97-4583-8c4a-83ef12fc7916-global",
569-
"version": "v1.2.25",
543+
"version": "v1.2.34",
570544
"flavors": [
571545
"fully-configurable"
572546
],
@@ -588,9 +562,9 @@
588562
},
589563
{
590564
"name": "deploy-arch-ibm-kms",
591-
"description": "Configure KMS to encrypt the data from app configuration instance stored in database.",
565+
"description": "Enables managed encryption with your own keys via IBM Cloud Key Protect. If disabled, services will default to IBM-managed encryption.",
592566
"id": "2cad4789-fa90-4886-9c9e-857081c273ee-global",
593-
"version": "v5.1.19",
567+
"version": "v5.1.27",
594568
"flavors": [
595569
"fully-configurable"
596570
],
@@ -631,7 +605,7 @@
631605
"name": "deploy-arch-ibm-event-notifications",
632606
"description": "Configure Event Notifications to notify any configuration change events.",
633607
"id": "c7ac3ee6-4f48-4236-b974-b0cd8c624a46-global",
634-
"version": "v2.7.0",
608+
"version": "v2.7.2",
635609
"flavors": [
636610
"fully-configurable"
637611
],

solutions/fully-configurable/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ resource "ibm_en_topic" "en_topic" {
191191
count = var.enable_event_notifications ? 1 : 0
192192
depends_on = [module.app_config]
193193
instance_guid = local.existing_en_guid
194-
name = "Topic for SCC instance ${module.app_config.app_config_guid}"
194+
name = "Topic for App Configuration instance ${module.app_config.app_config_guid}"
195195
description = "Topic for App Configuration events routing"
196196
sources {
197197
id = module.app_config.app_config_crn
@@ -212,7 +212,7 @@ resource "ibm_en_subscription_email" "email_subscription" {
212212
attributes {
213213
add_notification_payload = true
214214
reply_to_mail = var.event_notifications_reply_to_email
215-
reply_to_name = "Secret Manager Event Notifications Bot"
215+
reply_to_name = "App Configuration Event Notifications Bot"
216216
from_name = var.event_notifications_from_email
217217
invited = var.event_notifications_email_list
218218
}

tests/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.24.0
55
toolchain go1.25.0
66

77
require (
8+
github.com/IBM/go-sdk-core v1.1.0
89
github.com/gruntwork-io/terratest v0.50.0
910
github.com/stretchr/testify v1.11.1
1011
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.60.5
@@ -29,6 +30,7 @@ require (
2930
github.com/cloudflare/circl v1.6.1 // indirect
3031
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
3132
github.com/davecgh/go-spew v1.1.1 // indirect
33+
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
3234
github.com/emirpasic/gods v1.18.1 // indirect
3335
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
3436
github.com/ghodss/yaml v1.0.0 // indirect
@@ -97,6 +99,7 @@ require (
9799
golang.org/x/sys v0.35.0 // indirect
98100
golang.org/x/text v0.28.0 // indirect
99101
golang.org/x/tools v0.35.0 // indirect
102+
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
100103
gopkg.in/warnings.v0 v0.1.2 // indirect
101104
gopkg.in/yaml.v2 v2.4.0 // indirect
102105
gopkg.in/yaml.v3 v3.0.1 // indirect

tests/go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ github.com/IBM-Cloud/power-go-client v1.12.0 h1:tF9Mq5GLYHebpzQT6IYB89lIxEST1E9t
66
github.com/IBM-Cloud/power-go-client v1.12.0/go.mod h1:SpTK1ttW8bfMNUVQS8qOEuWn2KOkzaCLyzfze8MG1JE=
77
github.com/IBM/cloud-databases-go-sdk v0.8.0 h1:uMFqhnc/roVTzfCaUsJ23eaHKjChhGpM1F7Mpxik0bo=
88
github.com/IBM/cloud-databases-go-sdk v0.8.0/go.mod h1:JYucI1PdwqbAd8XGdDAchxzxRP7bxOh1zUnseovHKsc=
9+
github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY=
10+
github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY=
911
github.com/IBM/go-sdk-core/v5 v5.9.2/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE=
1012
github.com/IBM/go-sdk-core/v5 v5.21.0 h1:DUnYhvC4SoC8T84rx5omnhY3+xcQg/Whyoa3mDPIMkk=
1113
github.com/IBM/go-sdk-core/v5 v5.21.0/go.mod h1:Q3BYO6iDA2zweQPDGbNTtqft5tDcEpm6RTuqMlPcvbw=
@@ -48,6 +50,8 @@ github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGL
4850
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4951
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
5052
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
53+
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
54+
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
5155
github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o=
5256
github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE=
5357
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
@@ -106,9 +110,11 @@ github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3Bum
106110
github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ=
107111
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
108112
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
113+
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
109114
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
110115
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
111116
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
117+
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
112118
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
113119
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
114120
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
@@ -193,6 +199,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
193199
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
194200
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
195201
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
202+
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
196203
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
197204
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
198205
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
@@ -509,7 +516,10 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8
509516
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
510517
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
511518
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
519+
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
512520
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
521+
gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
522+
gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M=
513523
gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
514524
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
515525
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=

tests/other_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22
package test
33

44
import (
5+
"math/rand"
56
"testing"
67

78
"github.com/stretchr/testify/assert"
9+
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
810
)
911

1012
func TestRunBasicExample(t *testing.T) {
1113
t.Parallel()
1214

13-
options := setupOptions(t, "app-conf-basic", "examples/basic")
15+
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
16+
Testing: t,
17+
TerraformDir: "examples/basic",
18+
Prefix: "app-conf-basic",
19+
Region: validRegions[rand.Intn(len(validRegions))],
20+
})
1421

1522
output, err := options.RunTestConsistency()
1623
assert.Nil(t, err, "This should not have errored")

0 commit comments

Comments
 (0)