Skip to content

Commit f293adc

Browse files
authored
feat: added support to the DA to create the required access key if one is not passed (#154)
1 parent 9af2292 commit f293adc

File tree

8 files changed

+851
-20
lines changed

8 files changed

+851
-20
lines changed

ibm_catalog.json

Lines changed: 707 additions & 2 deletions
Large diffs are not rendered by default.

solutions/fully-configurable/main.tf

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,38 @@ data "ibm_container_cluster_config" "cluster_config" {
99
endpoint_type = var.cluster_config_endpoint_type != "default" ? var.cluster_config_endpoint_type : null
1010
}
1111

12+
locals {
13+
prefix = var.prefix != null ? trimspace(var.prefix) != "" ? "${var.prefix}-" : "" : ""
14+
create_access_key = ((var.access_key != null && var.access_key != "") || (var.existing_access_key_secret_name != null && var.existing_access_key_secret_name != "")) ? 0 : 1
15+
}
16+
17+
module "instance_crn_parser" {
18+
source = "terraform-ibm-modules/common-utilities/ibm//modules/crn-parser"
19+
version = "1.2.0"
20+
crn = var.instance_crn
21+
}
22+
23+
24+
resource "ibm_resource_key" "key" {
25+
count = local.create_access_key
26+
name = "${local.prefix}key"
27+
resource_instance_id = module.instance_crn_parser.service_instance
28+
role = "Manager"
29+
}
30+
1231
module "monitoring_agent" {
1332
source = "../.."
1433
cluster_id = var.cluster_id
1534
cluster_resource_group_id = var.cluster_resource_group_id
1635
cluster_config_endpoint_type = var.cluster_config_endpoint_type
1736
wait_till = var.wait_till
1837
wait_till_timeout = var.wait_till_timeout
19-
instance_region = var.instance_region
38+
instance_region = module.instance_crn_parser.region
2039
use_private_endpoint = var.use_private_endpoint
2140
is_vpc_cluster = var.is_vpc_cluster
2241
name = var.name
2342
namespace = var.namespace
24-
access_key = var.access_key
43+
access_key = local.create_access_key == 1 ? ibm_resource_key.key[0].credentials["Sysdig Access Key"] : var.access_key
2544
existing_access_key_secret_name = var.existing_access_key_secret_name
2645
agent_tags = var.agent_tags
2746
add_cluster_name = var.add_cluster_name

solutions/fully-configurable/provider.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
provider "ibm" {
22
ibmcloud_api_key = var.ibmcloud_api_key
3+
visibility = var.provider_visibility
34
}
45

56
provider "kubernetes" {

solutions/fully-configurable/variables.tf

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ variable "ibmcloud_api_key" {
88
sensitive = true
99
}
1010

11+
variable "prefix" {
12+
type = string
13+
nullable = true
14+
description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To skip using a prefix, set this value to null or an empty string. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
15+
16+
validation {
17+
# - null and empty string is allowed
18+
# - Must not contain consecutive hyphens (--): length(regexall("--", var.prefix)) == 0
19+
# - Starts with a lowercase letter: [a-z]
20+
# - Contains only lowercase letters (a–z), digits (0–9), and hyphens (-)
21+
# - Must not end with a hyphen (-): [a-z0-9]
22+
condition = (var.prefix == null || var.prefix == "" ? true :
23+
alltrue([
24+
can(regex("^[a-z][-a-z0-9]*[a-z0-9]$", var.prefix)),
25+
length(regexall("--", var.prefix)) == 0
26+
])
27+
)
28+
error_message = "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 ('--')."
29+
}
30+
31+
validation {
32+
# must not exceed 16 characters in length
33+
condition = var.prefix == null || var.prefix == "" ? true : length(var.prefix) <= 16
34+
error_message = "Prefix must not exceed 16 characters."
35+
}
36+
}
37+
1138
variable "cluster_id" {
1239
type = string
1340
description = "The ID of the cluster you wish to deploy the agent in."
@@ -66,10 +93,15 @@ variable "wait_till_timeout" {
6693
# Common agent variables
6794
##############################################################################
6895

69-
variable "instance_region" {
96+
variable "instance_crn" {
7097
type = string
71-
description = "The region of the IBM Cloud Monitoring instance that you want to send metrics to. This is used to construct the ingestion and api endpoints. If you are only using the agent for security and compliance monitoring, set this to the region of your IBM Cloud Security and Compliance Center Workload Protection instance. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-docs.md#key-considerations)."
98+
description = "The CRN of the IBM Cloud Monitoring instance that you want to send metrics to. This is used to construct the ingestion and api endpoints. If you are only using the agent for security and compliance monitoring, set this to the crn of your IBM Cloud Security and Compliance Center Workload Protection instance. If you are using this agent for both `monitoring` and `security and compliance` you can provide CRN of any one of them provided they are connected. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-docs.md#key-considerations)."
7299
nullable = false
100+
101+
validation {
102+
condition = var.instance_crn != ""
103+
error_message = "Instance CRN can not be empty."
104+
}
73105
}
74106

75107
variable "use_private_endpoint" {
@@ -81,21 +113,14 @@ variable "use_private_endpoint" {
81113

82114
variable "access_key" {
83115
type = string
84-
description = "Access key used by the agent to communicate with the instance. Either `access_key` or `existing_access_key_secret_name` is required. This value will be stored in a new secret on the cluster if passed. If you want to use this agent for only metrics or metrics with security and compliance, use a manager key scoped to the IBM Cloud Monitoring instance. If you only want to use the agent for security and compliance use a manager key scoped to the Security and Compliance Center Workload Protection instance."
116+
description = "Access key used by the agent to communicate with the instance. This value will be stored in a new secret on the cluster if passed. If you want to use this agent for only metrics or metrics with security and compliance, use a manager key scoped to the IBM Cloud Monitoring instance. If you only want to use the agent for security and compliance use a manager key scoped to the Security and Compliance Center Workload Protection instance. If neither `access_key` nor `existing_access_key_secret_name` is provided a new Manager Key will be created scoped to the instance provided in `instance_crn`."
85117
sensitive = true
86118
default = null
87-
validation {
88-
condition = (
89-
(var.access_key != null && var.access_key != "") ||
90-
(var.existing_access_key_secret_name != null && var.existing_access_key_secret_name != "")
91-
)
92-
error_message = "Either 'access_key' or 'existing_access_key_secret_name' must be provided and non-empty."
93-
}
94119
}
95120

96121
variable "existing_access_key_secret_name" {
97122
type = string
98-
description = "An alternative to using `access_key`. Specify the name of an existing Kubernetes secret containing the access key in the same namespace that is defined in the `namespace` input. Either `access_key` or `existing_access_key_secret_name` is required."
123+
description = "An alternative to using `access_key`. Specify the name of an existing Kubernetes secret containing the access key in the same namespace that is defined in the `namespace` input. If neither `access_key` nor `existing_access_key_secret_name` is provided a new Manager Key will be created scoped to the instance provided in `instance_crn`."
99124
default = null
100125
}
101126

@@ -362,3 +387,14 @@ variable "cluster_shield_limits_memory" {
362387
description = "Specify memory resource limits for the cluster shield pods."
363388
default = "1536Mi"
364389
}
390+
391+
variable "provider_visibility" {
392+
description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)."
393+
type = string
394+
default = "private"
395+
396+
validation {
397+
condition = contains(["public", "private", "public-and-private"], var.provider_visibility)
398+
error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'."
399+
}
400+
}

tests/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be // indirect
1616
github.com/IBM-Cloud/power-go-client v1.12.0 // indirect
1717
github.com/IBM/cloud-databases-go-sdk v0.8.0 // indirect
18+
github.com/IBM/go-sdk-core v1.1.0 // indirect
1819
github.com/IBM/go-sdk-core/v5 v5.21.0 // indirect
1920
github.com/IBM/platform-services-go-sdk v0.86.1 // indirect
2021
github.com/IBM/project-go-sdk v0.3.6 // indirect
@@ -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
@@ -98,6 +100,7 @@ require (
98100
golang.org/x/sys v0.35.0 // indirect
99101
golang.org/x/text v0.28.0 // indirect
100102
golang.org/x/tools v0.35.0 // indirect
103+
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
101104
gopkg.in/warnings.v0 v0.1.2 // indirect
102105
gopkg.in/yaml.v2 v2.4.0 // indirect
103106
gopkg.in/yaml.v3 v3.0.1 // indirect

tests/go.sum

Lines changed: 9 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=
@@ -512,6 +519,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
512519
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
513520
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
514521
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
522+
gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
523+
gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M=
515524
gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
516525
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
517526
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=

tests/pr_test.go

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import (
88
"strings"
99
"testing"
1010

11+
"github.com/IBM/go-sdk-core/core"
1112
"github.com/gruntwork-io/terratest/modules/files"
1213
"github.com/gruntwork-io/terratest/modules/logger"
1314
"github.com/gruntwork-io/terratest/modules/random"
1415
"github.com/gruntwork-io/terratest/modules/terraform"
1516
"github.com/stretchr/testify/assert"
1617
"github.com/stretchr/testify/require"
1718
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
19+
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testaddons"
1820
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
1921
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
2022
)
@@ -94,7 +96,7 @@ func TestFullyConfigurableSolution(t *testing.T) {
9496

9597
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
9698
Testing: t,
97-
Prefix: "monitoring-agent",
99+
Prefix: "mon-agent",
98100
TarIncludePatterns: []string{
99101
"*.tf",
100102
"kubeconfig/*.*",
@@ -114,9 +116,10 @@ func TestFullyConfigurableSolution(t *testing.T) {
114116
})
115117
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
116118
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
117-
{Name: "instance_region", Value: region, DataType: "string"},
119+
{Name: "prefix", Value: options.Prefix, DataType: "string"},
118120
{Name: "cluster_id", Value: terraform.Output(t, existingTerraformOptions, "cluster_id"), DataType: "string"},
119121
{Name: "cluster_resource_group_id", Value: terraform.Output(t, existingTerraformOptions, "cluster_resource_group_id"), DataType: "string"},
122+
{Name: "instance_crn", Value: terraform.Output(t, existingTerraformOptions, "instance_crn"), DataType: "string", Secure: true},
120123
{Name: "access_key", Value: terraform.Output(t, existingTerraformOptions, "access_key"), DataType: "string", Secure: true},
121124
{Name: "priority_class_name", Value: "sysdig-daemonset-priority", DataType: "string"},
122125
}
@@ -178,7 +181,7 @@ func TestFullyConfigurableUpgradeSolution(t *testing.T) {
178181

179182
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
180183
Testing: t,
181-
Prefix: "monitoring-agent",
184+
Prefix: "mon-agent",
182185
TarIncludePatterns: []string{
183186
"*.tf",
184187
"kubeconfig/*.*",
@@ -199,9 +202,10 @@ func TestFullyConfigurableUpgradeSolution(t *testing.T) {
199202

200203
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
201204
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
202-
{Name: "instance_region", Value: region, DataType: "string"},
205+
{Name: "prefix", Value: options.Prefix, DataType: "string"},
203206
{Name: "cluster_id", Value: terraform.Output(t, existingTerraformOptions, "cluster_id"), DataType: "string"},
204207
{Name: "cluster_resource_group_id", Value: terraform.Output(t, existingTerraformOptions, "cluster_resource_group_id"), DataType: "string"},
208+
{Name: "instance_crn", Value: terraform.Output(t, existingTerraformOptions, "instance_crn"), DataType: "string", Secure: true},
205209
{Name: "access_key", Value: terraform.Output(t, existingTerraformOptions, "access_key"), DataType: "string", Secure: true},
206210
}
207211

@@ -251,7 +255,7 @@ func TestRunAgentClassicKubernetes(t *testing.T) {
251255
Testing: t,
252256
TerraformDir: terraformDirMonitoringAgentIKS,
253257
Prefix: "obs-agent-iks",
254-
Region: "au-syd",
258+
Region: validRegions[rand.IntN(len(validRegions))],
255259
ResourceGroup: resourceGroup,
256260
IgnoreUpdates: testhelper.Exemptions{ // Ignore for consistency check
257261
List: IgnoreUpdates,
@@ -271,3 +275,51 @@ func TestRunAgentClassicKubernetes(t *testing.T) {
271275
assert.Nil(t, err, "This should not have errored")
272276
assert.NotNil(t, output, "Expected some output")
273277
}
278+
279+
func TestAgentDefaultConfiguration(t *testing.T) {
280+
281+
/*
282+
Skipping this test because auto-approve is not working as expected in projects
283+
Config gets stuck in approved state and doesn't move to deployment
284+
https://github.ibm.com/epx/projects/issues/4814
285+
*/
286+
t.Skip("Skipping because of projects issue")
287+
t.Parallel()
288+
289+
options := testaddons.TestAddonsOptionsDefault(&testaddons.TestAddonOptions{
290+
Testing: t,
291+
Prefix: "ma-def",
292+
QuietMode: false,
293+
})
294+
295+
options.AddonConfig = cloudinfo.NewAddonConfigTerraform(
296+
options.Prefix,
297+
"deploy-arch-ibm-monitoring-agent",
298+
"fully-configurable",
299+
map[string]interface{}{
300+
"prefix": options.Prefix,
301+
"secrets_manager_service_plan": "trial",
302+
"region": "eu-de",
303+
},
304+
)
305+
306+
/*
307+
Event notifications is manually disabled in this test because event notifications DA creates kms keys and during undeploy the order of key protect and event notifications
308+
is not considered by projects as EN is not a direct dependency of VSI DA. So undeploy fails, because
309+
key protect instance can't be deleted because of active keys created by EN. Hence for now, we don't want to deploy
310+
EN.
311+
312+
Issue has been created for projects team. https://github.ibm.com/epx/projects/issues/4750
313+
Once that is fixed, we can remove the logic to disable EN
314+
*/
315+
options.AddonConfig.Dependencies = []cloudinfo.AddonConfig{
316+
{
317+
OfferingName: "deploy-arch-ibm-event-notifications",
318+
OfferingFlavor: "fully-configurable",
319+
Enabled: core.BoolPtr(false), // explicitly disabled
320+
},
321+
}
322+
323+
err := options.RunAddonTest()
324+
require.NoError(t, err)
325+
}

tests/resources/outputs.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ output "access_key" {
2727
description = "The access key of the provisioned IBM Cloud Monitoring instance."
2828
sensitive = true
2929
}
30+
31+
output "instance_crn" {
32+
value = module.cloud_monitoring.crn
33+
description = "The access key of the provisioned IBM Cloud Monitoring instance."
34+
sensitive = true
35+
}

0 commit comments

Comments
 (0)