Skip to content

Commit 0f6de93

Browse files
authored
fix: Adjust multi-service-profile example to demonstrate a real-world scenario (#258)
1 parent 14ceabc commit 0f6de93

File tree

4 files changed

+3
-22
lines changed

4 files changed

+3
-22
lines changed

examples/multi-service-profile/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CBR Multi Service Profile
22

3-
An end-to-end example that uses the module's default variable values. This example uses the IBM Cloud Provider to automate the following infrastructure::
3+
An end-to-end example that uses the submodule cbr-service-profile. This example uses the IBM Cloud Provider to automate the following infrastructure::
44

55
- Create a VPC and create a CBR zone to allowlist the VPC.
66
- Create a service reference based CBR zone.

examples/multi-service-profile/main.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,9 @@ locals {
5050
enforcement_mode = "report"
5151
# Merge zone ids to pass as contexts to the rule
5252
target_services_details = [
53-
{
54-
target_service_name = "cloud-object-storage",
55-
# Note these are access tags and all iam access tags must be present on the COS instance for the rule to match
56-
tags = var.existing_access_tags,
57-
enforcement_mode = local.enforcement_mode,
58-
},
5953
{
6054
target_service_name = "kms",
6155
target_rg = module.resource_group.resource_group_id
62-
enforcement_mode = local.enforcement_mode,
63-
64-
},
65-
{
66-
target_service_name = "messagehub",
67-
target_rg = module.resource_group.resource_group_id
6856
enforcement_mode = local.enforcement_mode
6957
}
7058
]

examples/multi-service-profile/variables.tf

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,8 @@ variable "resource_tags" {
2828
default = []
2929
}
3030

31-
variable "existing_access_tags" {
32-
type = list(string)
33-
description = "Optional list of existing access tags to be added https://cloud.ibm.com/docs/account?topic=account-tag&interface=ui#create"
34-
# Provide the access tags with key:value format in a list
35-
default = ["env:dev"]
36-
}
37-
3831
variable "zone_service_ref_list" {
3932
type = list(string)
40-
default = ["directlink", "is"]
33+
default = ["cloud-object-storage", "containers-kubernetes", "server-protect"]
4134
description = "(List) Service reference for the zone creation"
4235
}

tests/pr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func TestMultiServiceProfileExample(t *testing.T) {
225225
t.Run("verify service reference exist", func(t *testing.T) {
226226
var serviceRefExists bool
227227
var actual_references []string
228-
expected_references := []string{"directlink", "is"}
228+
expected_references := []string{"cloud-object-storage", "containers-kubernetes", "server-protect"}
229229

230230
zoneIds := zones[0].([]interface{})
231231
for index := range zoneIds {

0 commit comments

Comments
 (0)