Skip to content

Commit b155c0c

Browse files
authored
fix(deps): update DA dependencies (#106)
1 parent 0b085d1 commit b155c0c

File tree

7 files changed

+53
-79
lines changed

7 files changed

+53
-79
lines changed

examples/advanced/README.md

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

33
<!-- There is a pre-commit hook that will take the title of each example add include it in the repos main README.md -->
44
<!-- Add text below should describe exactly what resources are provisioned / configured by the example -->
5+
6+
An end-to-end advanced example that will provision the following:
7+
- A new resource group if one is not passed in.
8+
- A new Cloud Logs instance.
9+
- A new Key Protect instance with a root key.
10+
- A new COS instance and KMS encrypted bucket.
11+
- An Activity Tracker target for the new COS bucket, Cloud Logs instance and Event Streams instance.
12+
- And Activity Tracker route for the above created targets.

examples/basic/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ The text below should describe exactly what resources are provisioned / configur
88

99
An end-to-end basic example that will provision the following:
1010
- A new resource group if one is not passed in.
11-
- A new standard plan Cloud Object Storage instance using the root level module.
11+
- A new COS instance and bucket.
12+
- An Activity Tracker target for the new COS bucket.
13+
- An Activity Tracker route for the COS bucket target.

examples/basic/main.tf

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,27 @@ module "resource_group" {
1111
}
1212

1313
##############################################################################
14-
# Event Streams
14+
# COS instance and bucket
1515
##############################################################################
1616

17-
locals {
18-
topic_name = "${var.prefix}-topic"
19-
}
20-
21-
module "event_streams" {
22-
source = "terraform-ibm-modules/event-streams/ibm"
23-
version = "4.1.7"
24-
es_name = "${var.prefix}-eventsteams"
25-
tags = var.resource_tags
26-
region = var.region
17+
module "cos" {
18+
source = "terraform-ibm-modules/cos/ibm"
19+
version = "10.2.21"
2720
resource_group_id = module.resource_group.resource_group_id
28-
plan = "standard"
29-
topics = [{
30-
name = local.topic_name
31-
partitions = 1
32-
config = {
33-
"cleanup.policy" = "delete"
34-
"retention.ms" = "86400000" # 1 Day
35-
"retention.bytes" = "10485760" # 10 MB
36-
"segment.bytes" = "536870912" # 512 MB
37-
}
38-
}, ]
21+
region = var.region
22+
cos_instance_name = "${var.prefix}-cos"
23+
cos_tags = var.resource_tags
24+
bucket_name = "${var.prefix}-bucket"
3925
}
4026

4127
##############################################################################
4228
# - Activity Tracker Event Routing config:
43-
# - Event Streams AT target
44-
# - AT route event stream target
29+
# - COS bucket AT target
30+
# - AT route to COS bucket target
4531
##############################################################################
4632

4733
locals {
48-
es_target_name = "${var.prefix}-es-at-target"
34+
bucket_target_name = "${var.prefix}-cos-at-target"
4935
}
5036

5137
module "activity_tracker" {
@@ -54,25 +40,23 @@ module "activity_tracker" {
5440
# source = "terraform-ibm-modules/activity-tracker/ibm"
5541
# version = "X.Y.Z" # Replace "X.X.X" with a release version to lock into a specific release
5642

57-
# Activity Tracker target
58-
eventstreams_targets = [
43+
# COS bucket target
44+
cos_targets = [
5945
{
60-
instance_id = module.event_streams.id
61-
brokers = [module.event_streams.kafka_brokers_sasl[0]]
62-
topic = local.topic_name
63-
target_region = var.region
64-
target_name = local.es_target_name
65-
service_to_service_enabled = true
66-
skip_atracker_es_iam_auth_policy = false
46+
bucket_name = module.cos.bucket_name
47+
endpoint = module.cos.s3_endpoint_direct
48+
instance_id = module.cos.cos_instance_id
49+
target_region = var.region
50+
target_name = "${var.prefix}-cos-target"
6751
}
6852
]
6953

70-
# Activity Tracker route
54+
# Activity Tracker route to COS bucket
7155
activity_tracker_routes = [
7256
{
7357
locations = ["*", "global"]
74-
target_ids = [module.activity_tracker.activity_tracker_targets[local.es_target_name].id]
75-
route_name = "${var.prefix}-at-route"
58+
target_ids = [module.activity_tracker.activity_tracker_targets[local.bucket_target_name].id]
59+
route_name = "${var.prefix}-cos-route"
7660
}
7761
]
7862
}

examples/basic/outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ output "resource_group_id" {
1212
value = module.resource_group.resource_group_id
1313
}
1414

15-
output "event_streams_crn" {
16-
description = "The CRN of the event stream resource instance."
17-
value = module.event_streams.crn
18-
}
19-
2015
output "event_routing_targets" {
2116
value = module.activity_tracker.activity_tracker_targets
2217
description = "The created AT event routing target."

ibm_catalog.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
"name": "deploy-arch-ibm-cos",
316316
"description": "Enable this to create an IBM Cloud Object Storage(COS) instance. The buckets to store events will be created by the Activity Tracker Event Routing deployable architecture.",
317317
"id": "68921490-2778-4930-ac6d-bae7be6cd958-global",
318-
"version": "v10.2.1",
318+
"version": "v10.2.21",
319319
"flavors": [
320320
"instance"
321321
],
@@ -347,7 +347,7 @@
347347
"name": "deploy-arch-ibm-kms",
348348
"description": "Enable when you want to create your own managed keys to encrypt the buckets. Select only if existing KMS instance or Key is not provided. ",
349349
"id": "2cad4789-fa90-4886-9c9e-857081c273ee-global",
350-
"version": "v5.1.19",
350+
"version": "v5.1.27",
351351
"flavors": [
352352
"fully-configurable"
353353
],
@@ -383,7 +383,7 @@
383383
"fully-configurable"
384384
],
385385
"id": "63d8ae58-fbf3-41ce-b844-0fb5b85882ab-global",
386-
"version": "v1.6.11",
386+
"version": "v1.6.28",
387387
"optional": true,
388388
"on_by_default": true,
389389
"input_mapping": [
@@ -411,7 +411,7 @@
411411
"name": "deploy-arch-ibm-cloud-monitoring",
412412
"description": "Configure IBM Cloud Monitoring to collect the platform metrics.",
413413
"id": "73debdbf-894f-4c14-81c7-5ece3a70b67d-global",
414-
"version": "v1.6.4",
414+
"version": "v1.7.2",
415415
"flavors": [
416416
"fully-configurable"
417417
],

tests/pr_test.go

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ import (
2222
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
2323
)
2424

25-
// Use existing resource group
25+
/*
26+
Global variables
27+
*/
2628
const resourceGroup = "geretain-test-resources"
2729
const yamlLocation = "../common-dev-assets/common-go-assets/common-permanent-resources.yaml"
2830
const fullyConfigurableTerraformDir = "solutions/fully-configurable"
2931
const AccountSettingsDADir = "solutions/event-routing-account-settings"
32+
const terraformVersion = "terraform_v1.10" // This should match the version in the ibm_catalog.json
3033

3134
// Removed "in-che" from validRegions since it isn’t supported under the Standard plan of Event Streams.
3235
var validRegions = []string{
@@ -44,7 +47,6 @@ var validRegions = []string{
4447
var IgnoreUpdates = []string{
4548
"module.account_routing_settings.ibm_atracker_settings.atracker_settings[0]",
4649
}
47-
4850
var permanentResources map[string]interface{}
4951

5052
func TestMain(m *testing.M) {
@@ -59,7 +61,7 @@ func TestMain(m *testing.M) {
5961
os.Exit(m.Run())
6062
}
6163

62-
func setupexistingOptions(t *testing.T, cloudLogsPrefix string) (preReqTfOptions *terraform.Options, err error) {
64+
func setupExistingOptions(t *testing.T, cloudLogsPrefix string) (preReqTfOptions *terraform.Options, err error) {
6365

6466
realTerraformDir := "./resources"
6567
tempTerraformDir, tempCopyErr := files.CopyTerraformFolderToTemp(realTerraformDir, cloudLogsPrefix)
@@ -109,11 +111,12 @@ func TestFullyConfigurableInSchematics(t *testing.T) {
109111
Tags: []string{"test-schematic"},
110112
DeleteWorkspaceOnFail: false,
111113
WaitJobCompleteMinutes: 60,
114+
TerraformVersion: terraformVersion,
112115
})
113116

114117
cloudLogsPrefix := fmt.Sprintf("cloud-logs-%s", strings.ToLower(random.UniqueId()))
115118

116-
existingTerraformOptions, err := setupexistingOptions(t, cloudLogsPrefix)
119+
existingTerraformOptions, err := setupExistingOptions(t, cloudLogsPrefix)
117120

118121
if err != nil {
119122
assert.True(t, err == nil, "cloud logs instance creation failed")
@@ -162,16 +165,18 @@ func TestFullyConfigurableUpgradeInSchematics(t *testing.T) {
162165
"*.tf",
163166
fullyConfigurableTerraformDir + "/*.tf",
164167
},
165-
ResourceGroup: resourceGroup,
166-
TemplateFolder: fullyConfigurableTerraformDir,
167-
Tags: []string{"test-schematic"},
168-
DeleteWorkspaceOnFail: false,
169-
WaitJobCompleteMinutes: 60,
168+
ResourceGroup: resourceGroup,
169+
TemplateFolder: fullyConfigurableTerraformDir,
170+
Tags: []string{"test-schematic"},
171+
DeleteWorkspaceOnFail: false,
172+
WaitJobCompleteMinutes: 60,
173+
CheckApplyResultForUpgrade: true,
174+
TerraformVersion: terraformVersion,
170175
})
171176

172177
cloudLogsPrefix := fmt.Sprintf("cloud-logs-%s", strings.ToLower(random.UniqueId()))
173178

174-
existingTerraformOptions, err := setupexistingOptions(t, cloudLogsPrefix)
179+
existingTerraformOptions, err := setupExistingOptions(t, cloudLogsPrefix)
175180

176181
if err != nil {
177182
assert.True(t, err == nil, "cloud logs instance creation failed")
@@ -237,6 +242,7 @@ func TestRunAccountSettings(t *testing.T) {
237242
Tags: []string{"er-da-test"},
238243
DeleteWorkspaceOnFail: false,
239244
WaitJobCompleteMinutes: 60,
245+
TerraformVersion: terraformVersion,
240246
IgnoreUpdates: testhelper.Exemptions{ // Ignore for consistency check
241247
List: IgnoreUpdates,
242248
},
@@ -274,24 +280,3 @@ func TestActivityTrackerDefaultConfiguration(t *testing.T) {
274280
err := options.RunAddonTest()
275281
require.NoError(t, err)
276282
}
277-
278-
func TestActivityTrackerDependencyPermutations(t *testing.T) {
279-
t.Skip("Skipping dependency permutations until the test is fixed")
280-
t.Parallel()
281-
options := testaddons.TestAddonsOptionsDefault(&testaddons.TestAddonOptions{
282-
Testing: t,
283-
Prefix: "act-per",
284-
AddonConfig: cloudinfo.AddonConfig{
285-
OfferingName: "deploy-arch-ibm-activity-tracker",
286-
OfferingFlavor: "fully-configurable",
287-
Inputs: map[string]interface{}{
288-
"prefix": "act-per",
289-
"region": validRegions[rand.Intn(len(validRegions))],
290-
"existing_resource_group_name": resourceGroup,
291-
},
292-
},
293-
})
294-
295-
err := options.RunAddonPermutationTest()
296-
assert.NoError(t, err, "Dependency permutation test should not fail")
297-
}

0 commit comments

Comments
 (0)