Skip to content

Commit 89e5cfe

Browse files
authored
fix: updated usage section in readme for all the modules (#321)
1 parent 8468fcd commit 89e5cfe

File tree

5 files changed

+152
-5
lines changed

5 files changed

+152
-5
lines changed

README.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,52 @@ module "ibm_cbr" "zone" {
3636
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
3737
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
3838
name = "zone_for_pg_access"
39-
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
39+
account_id = "defc0df06b644a9cabc6e44f55b3880s" # pragma: allowlist secret
4040
zone_description = "Zone created from terraform"
4141
addresses = [{type = "vpc",value = "vpc_crn"}]
4242
}
4343
4444
module "ibm_cbr" "rule" {
4545
# replace main with version
46-
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
46+
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-rule-module"
4747
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
4848
name = "rule_for_pg_access"
4949
rule_description = "rule from terraform"
5050
enforcement_mode = "enabled"
51-
rule_contexts = var.rule_contexts
52-
resources = var.pg_resource
53-
operations = []
51+
rule_contexts = [{
52+
attributes = [{
53+
name = "networkZoneId"
54+
value = "93a51a1debe2674193217209601dde6f" # pragma: allowlist secret
55+
}]
56+
}]
57+
resources = [{
58+
attributes = [
59+
{
60+
name = "accountId"
61+
value = "defc0df06b644a9cabc6e44f55b3880s" # pragma: allowlist secret
62+
operator = "stringEquals"
63+
},
64+
{
65+
name = "resourceGroupId",
66+
value = "8ce996b5e6ed4592ac0e39f4105351d6" # pragma: allowlist secret
67+
operator = "stringEquals"
68+
},
69+
{
70+
name = "serviceInstance"
71+
value = "10732830-c128-48f0-aec6-c9eaa8d10c68" # pragma: allowlist secret
72+
operator = "stringEquals"
73+
},
74+
{
75+
name = "serviceName"
76+
value = "cloud-object-storage"
77+
operator = "stringEquals"
78+
}
79+
]
80+
}]
81+
operations = [{ api_types = [{
82+
api_type_id = "crn:v1:bluemix:public:context-based-restrictions::::api-type:"
83+
}]
84+
}]
5485
}
5586
```
5687

modules/cbr-rule-module/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,53 @@
22

33
Creates a rule for Context Based Restrictions
44

5+
### Usage
6+
7+
```hcl
8+
module "ibm_cbr" "rule" {
9+
# replace main with version
10+
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-rule-module"
11+
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
12+
name = "rule_for_pg_access"
13+
rule_description = "rule from terraform"
14+
enforcement_mode = "enabled"
15+
rule_contexts = [{
16+
attributes = [{
17+
name = "networkZoneId"
18+
value = "afe33d0061b6cea2c2e6f543111f5c8a" # pragma: allowlist secret
19+
}]
20+
}]
21+
resources = [{
22+
attributes = [
23+
{
24+
name = "accountId"
25+
value = "defc0df06b644a9cabc6e44f55b3880s"
26+
operator = "stringEquals"
27+
},
28+
{
29+
name = "resourceGroupId",
30+
value = "8ce996b5e6ed4592ac0e39f4105351d6" # pragma: allowlist secret
31+
operator = "stringEquals"
32+
},
33+
{
34+
name = "serviceInstance"
35+
value = "10732830-c128-48f0-aec6-c9eaa8d10c68"
36+
operator = "stringEquals"
37+
},
38+
{
39+
name = "serviceName"
40+
value = "cloud-object-storage"
41+
operator = "stringEquals"
42+
}
43+
]
44+
}]
45+
operations = [{ api_types = [{
46+
api_type_id = "crn:v1:bluemix:public:context-based-restrictions::::api-type:"
47+
}]
48+
}]
49+
}
50+
```
51+
552
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
653
### Requirements
754

modules/cbr-service-profile/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
Accepts a list of VPC crns / service references to create CBR zones and a list of target services, to create the rule matching these profiles. It supports to target the service using name, account id, tags, resource group.
44

5+
### Usage
6+
7+
```hcl
8+
module "cbr_rule_multi_service_profile" {
9+
source = "terraform-ibm-modules/cbr/ibm//modules/multi-service-profile"
10+
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
11+
prefix = "multi-service-profile"
12+
zone_service_ref_list = ["cloud-object-storage", "containers-kubernetes", "server-protect"]
13+
zone_vpc_crn_list = ["crn:v1:bluemix:public:is:us-south:a/abac0df06b644a9cabc6e44f55b3880e::vpc:r006-069c6449-03a9-49f1-9070-4d23fc79285e"]
14+
target_service_details = [
15+
{
16+
target_service_name = "secrets-manager",
17+
target_rg = "a8cff104f1764e98aac9ab879198230a" # pragma: allowlist secret
18+
enforcement_mode = "report"
19+
}
20+
]
21+
endpoints = "private"
22+
location = "us-south"
23+
}
24+
```
25+
526
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
627
### Requirements
728

modules/cbr-zone-module/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
Creates a zone for Context Based Restrictions
44

5+
### Usage
6+
7+
```hcl
8+
module "ibm_cbr" "zone" {
9+
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
10+
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
11+
name = "zone_for_pg_access"
12+
account_id = "defc0df06b644a9cabc6e44f55b3880s"
13+
zone_description = "Zone created from terraform"
14+
addresses = [{type = "vpc",value = "vpc_crn"}]
15+
}
16+
```
17+
518
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
619
### Requirements
720

modules/fscloud/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,41 @@ Important: In order to avoid unexpected breakage in the account against which th
2020
## Note
2121
The services 'compliance', 'directlink', 'iam-groups', 'containers-kubernetes', 'user-management' does not support restriction per location.
2222

23+
### Usage
24+
25+
```hcl
26+
module "cbr_fscloud" {
27+
source = "terraform-ibm-modules/cbr/ibm//modules/fscloud"
28+
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
29+
prefix = "fs-cbr"
30+
zone_vpc_crn_list = ["crn:v1:bluemix:public:is:us-south:a/abac0df06b644a9cabc6e44f55b3880e::vpc:r006-069c6449-03a9-49f1-9070-4d23fc79285e"]
31+
32+
# True or False to set prewired rule
33+
allow_cos_to_kms = true
34+
allow_block_storage_to_kms = true
35+
allow_roks_to_kms = true
36+
allow_icd_to_kms = true
37+
allow_vpcs_to_container_registry = true
38+
allow_vpcs_to_cos = true
39+
allow_at_to_cos = true
40+
allow_iks_to_is = true
41+
42+
# Will skip the zone creation for service ref. present in the list
43+
skip_specific_services_for_zone_creation = ["user-management", "iam-groups"]
44+
45+
target_service_details = {
46+
"kms" = {
47+
"enforcement_mode" = "enabled"
48+
}}
49+
50+
custom_rule_contexts_by_service = {
51+
"schematics" = [{
52+
endpointType = "public"
53+
zone_ids = "93a51a1debe2674193217209601dde6f" # pragma: allowlist secret
54+
}]
55+
}
56+
}
57+
```
2358

2459
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2560
### Requirements

0 commit comments

Comments
 (0)