Skip to content

Commit ceae6cc

Browse files
authored
fix(deps): update DA dependencies (#89)
1 parent 167cee1 commit ceae6cc

File tree

7 files changed

+84
-196
lines changed

7 files changed

+84
-196
lines changed

cra-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
version: "v1"
99
CRA_TARGETS:
10-
- CRA_TARGET: "examples/advanced" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
10+
- CRA_TARGET: "solutions/fully-configurable" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
1111
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json"
1212
PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile).
1313
# SCC_INSTANCE_ID: "" # The SCC instance ID to use to download profile for CRA scan. If not provided, a default global value will be used.
1414
# SCC_REGION: "" # The IBM Cloud region that the SCC instance is in. If not provided, a default global value will be used.
1515
CRA_ENVIRONMENT_VARIABLES: # An optional map of environment variables for CRA, where the key is the variable name and value is the value. Useful for providing TF_VARs.
1616
TF_VAR_prefix: "monitoring"
17-
TF_VAR_region: "us-south"
17+
TF_VAR_provider_visibility: "public"

examples/advanced/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Example that configures:
44

5-
- IBM Cloud Monitoring instance
6-
- IBM Cloud Metrics Routing
7-
- A context-based restriction (CBR) rule to only allow cloud monitoring to be accessible from schematics
5+
- A new resource group if one is not passed in.
6+
- A context-based restriction (CBR) zone for the IBM Cloud Schematics service.
7+
- An IBM Cloud Monitoring instance.
8+
- A context-based restriction (CBR) rule to only allow the Cloud Monitoring to be accessible from the Schematics zone.
9+
- A Metrics Routing target for the new IBM Cloud Monitoring instance and a route to send metrics to it.

examples/advanced/main.tf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ module "resource_group" {
1010
existing_resource_group_name = var.resource_group
1111
}
1212

13+
##############################################################################
14+
# CBR zone
15+
##############################################################################
16+
17+
module "cbr_schematics_zone" {
18+
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
19+
version = "1.33.2"
20+
name = "${var.prefix}-schematics-network-zone"
21+
zone_description = "CBR Network zone containing Schematics"
22+
account_id = module.cloud_monitoring.account_id
23+
addresses = [{
24+
type = "serviceRef"
25+
ref = {
26+
account_id = module.cloud_monitoring.account_id
27+
service_name = "schematics"
28+
}
29+
}]
30+
}
31+
1332
##############################################################################
1433
# Cloud Monitoring
1534
##############################################################################
@@ -28,7 +47,7 @@ module "cloud_monitoring" {
2847
plan = "graduated-tier"
2948
instance_name = local.cloud_monitoring_instance_name
3049
cbr_rules = [{
31-
description = "${var.prefix}-cloud-monitoring access from vpc and schematics"
50+
description = "${var.prefix}-cloud-monitoring access from schematics zone"
3251
account_id = module.cloud_monitoring.account_id
3352
enforcement_mode = "report"
3453
rule_contexts = [{
@@ -46,25 +65,6 @@ module "cloud_monitoring" {
4665
}]
4766
}
4867

49-
##############################################################################
50-
# CBR
51-
##############################################################################
52-
53-
module "cbr_schematics_zone" {
54-
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
55-
version = "1.33.2"
56-
name = "${var.prefix}-schematics-network-zone"
57-
zone_description = "CBR Network zone containing Schematics"
58-
account_id = module.cloud_monitoring.account_id
59-
addresses = [{
60-
type = "serviceRef"
61-
ref = {
62-
account_id = module.cloud_monitoring.account_id
63-
service_name = "schematics"
64-
}
65-
}]
66-
}
67-
6868
##############################################################################
6969
# IBM Cloud Metrics Routing
7070
# - Cloud Monitoring target

examples/basic/main.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ module "resource_group" {
1414
# Cloud Monitoring
1515
##############################################################################
1616

17-
locals {
18-
cloud_monitoring_instance_name = "${var.prefix}-cloud-monitoring"
19-
}
20-
2117
module "cloud_monitoring" {
2218
source = "../../"
2319
resource_group_id = module.resource_group.resource_group_id
2420
region = var.region
2521
resource_tags = var.resource_tags
26-
instance_name = local.cloud_monitoring_instance_name
22+
instance_name = "${var.prefix}-cloud-monitoring"
2723
plan = "graduated-tier"
2824
}

ibm_catalog.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
"name": "deploy-arch-ibm-account-infra-base",
267267
"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.",
268268
"id": "63641cec-6093-4b4f-b7b0-98d2f4185cd6-global",
269-
"version": "v3.0.7",
269+
"version": "v3.0.23",
270270
"flavors": [
271271
"resource-group-only",
272272
"resource-groups-with-account-settings"

tests/other_test.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,58 +14,54 @@ import (
1414
const advancedExampleDir = "examples/advanced"
1515
const basicExampleDir = "examples/basic"
1616

17-
func setupOptions(t *testing.T, prefix string, dir string) *testhelper.TestOptions {
17+
func setupExamplesOptions(t *testing.T, prefix string, dir string) *testhelper.TestOptions {
1818
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
1919
Testing: t,
2020
TerraformDir: dir,
2121
Prefix: prefix,
2222
ResourceGroup: resourceGroup,
2323
Region: validRegions[rand.Intn(len(validRegions))],
24-
IgnoreUpdates: testhelper.Exemptions{ // Ignore for consistency check
25-
List: IgnoreUpdates,
26-
},
2724
})
25+
2826
return options
2927
}
3028

3129
// Consistency test for the basic example
3230
func TestRunBasicExample(t *testing.T) {
3331
t.Parallel()
3432

35-
options := setupOptions(t, "icm-basic", basicExampleDir)
33+
options := setupExamplesOptions(t, "icm-basic", basicExampleDir)
3634

3735
output, err := options.RunTestConsistency()
3836
assert.Nil(t, err, "This should not have errored")
3937
assert.NotNil(t, output, "Expected some output")
4038
}
4139

40+
// Consistency test for the advanced example
41+
// NOTE: It is run in Schematics because the example configures a CBR rule to only allow traffic from schematics zone
4242
func TestRunAdvancedExampleInSchematics(t *testing.T) {
4343
t.Parallel()
4444

45-
var region = validRegions[rand.Intn(len(validRegions))]
46-
4745
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
4846
Testing: t,
4947
Prefix: "icm-adv",
48+
Region: validRegions[rand.Intn(len(validRegions))],
5049
TarIncludePatterns: []string{
5150
"*.tf",
5251
"modules/metrics_routing" + "/*.tf",
5352
advancedExampleDir + "/*.tf",
5453
},
5554
ResourceGroup: resourceGroup,
5655
TemplateFolder: advancedExampleDir,
57-
Tags: []string{"test-schematic"},
56+
Tags: tags,
5857
DeleteWorkspaceOnFail: false,
5958
WaitJobCompleteMinutes: 60,
60-
IgnoreUpdates: testhelper.Exemptions{ // Ignore for consistency check
61-
List: IgnoreUpdates,
62-
},
6359
})
6460

6561
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
6662
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
6763
{Name: "prefix", Value: options.Prefix, DataType: "string"},
68-
{Name: "region", Value: region, DataType: "string"},
64+
{Name: "region", Value: options.Region, DataType: "string"},
6965
}
7066

7167
err := options.RunSchematicTest()

0 commit comments

Comments
 (0)