Skip to content

Commit 0e10af6

Browse files
Ak-skyvburckhardt
andauthored
feat: add fscloud added pre-wired rule for AT -> COS (#296)
Co-authored-by: Vincent Burckhardt <vincent.burckhardt@ie.ibm.com>
1 parent 517f2bc commit 0e10af6

File tree

6 files changed

+35
-19
lines changed

6 files changed

+35
-19
lines changed

examples/fscloud/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module "cbr_account_level" {
6767
allow_roks_to_kms = var.allow_roks_to_kms
6868
allow_vpcs_to_container_registry = var.allow_vpcs_to_container_registry
6969
allow_vpcs_to_cos = var.allow_vpcs_to_cos
70+
allow_at_to_cos = var.allow_at_to_cos
7071

7172
# Demonstrates how zone creation will be skipped for these two service references ["user-management", "iam-groups"]
7273
skip_specific_services_for_zone_creation = ["user-management", "iam-groups"]

examples/fscloud/variables.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,36 @@ variable "resource_tags" {
3030

3131
variable "allow_cos_to_kms" {
3232
type = bool
33-
description = "Set rule for COS to KMS, deafult is true"
33+
description = "Set rule for COS to KMS, default is true"
3434
default = true
3535
}
3636

3737
variable "allow_block_storage_to_kms" {
3838
type = bool
39-
description = "Set rule for block storage to KMS, deafult is true"
39+
description = "Set rule for block storage to KMS, default is true"
4040
default = true
4141
}
4242

4343
variable "allow_roks_to_kms" {
4444
type = bool
45-
description = "Set rule for ROKS to KMS, deafult is true"
45+
description = "Set rule for ROKS to KMS, default is true"
4646
default = true
4747
}
4848

4949
variable "allow_vpcs_to_container_registry" {
5050
type = bool
51-
description = "Set rule for VPCs to container registry, deafult is true"
51+
description = "Set rule for VPCs to container registry, default is true"
5252
default = true
5353
}
5454

5555
variable "allow_vpcs_to_cos" {
5656
type = bool
57-
description = "Set rule for VPCs to COS, deafult is true"
57+
description = "Set rule for VPCs to COS, default is true"
58+
default = true
59+
}
60+
61+
variable "allow_at_to_cos" {
62+
type = bool
63+
description = "Set rule for Activity Tracker to COS, default is true"
5864
default = true
5965
}

modules/fscloud/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ The services 'compliance', 'directlink', 'iam-groups', 'containers-kubernetes',
4545

4646
| Name | Description | Type | Default | Required |
4747
|------|-------------|------|---------|:--------:|
48-
| <a name="input_allow_block_storage_to_kms"></a> [allow\_block\_storage\_to\_kms](#input\_allow\_block\_storage\_to\_kms) | Set rule for block storage to KMS, deafult is true | `bool` | `true` | no |
49-
| <a name="input_allow_cos_to_kms"></a> [allow\_cos\_to\_kms](#input\_allow\_cos\_to\_kms) | Set rule for COS to KMS, deafult is true | `bool` | `true` | no |
50-
| <a name="input_allow_roks_to_kms"></a> [allow\_roks\_to\_kms](#input\_allow\_roks\_to\_kms) | Set rule for ROKS to KMS, deafult is true | `bool` | `true` | no |
51-
| <a name="input_allow_vpcs_to_container_registry"></a> [allow\_vpcs\_to\_container\_registry](#input\_allow\_vpcs\_to\_container\_registry) | Set rule for VPCs to container registry, deafult is true | `bool` | `true` | no |
52-
| <a name="input_allow_vpcs_to_cos"></a> [allow\_vpcs\_to\_cos](#input\_allow\_vpcs\_to\_cos) | Set rule for VPCs to COS, deafult is true | `bool` | `true` | no |
48+
| <a name="input_allow_at_to_cos"></a> [allow\_at\_to\_cos](#input\_allow\_at\_to\_cos) | Set rule for Activity Tracker to COS, default is true | `bool` | `true` | no |
49+
| <a name="input_allow_block_storage_to_kms"></a> [allow\_block\_storage\_to\_kms](#input\_allow\_block\_storage\_to\_kms) | Set rule for block storage to KMS, default is true | `bool` | `true` | no |
50+
| <a name="input_allow_cos_to_kms"></a> [allow\_cos\_to\_kms](#input\_allow\_cos\_to\_kms) | Set rule for COS to KMS, default is true | `bool` | `true` | no |
51+
| <a name="input_allow_roks_to_kms"></a> [allow\_roks\_to\_kms](#input\_allow\_roks\_to\_kms) | Set rule for ROKS to KMS, default is true | `bool` | `true` | no |
52+
| <a name="input_allow_vpcs_to_container_registry"></a> [allow\_vpcs\_to\_container\_registry](#input\_allow\_vpcs\_to\_container\_registry) | Set rule for VPCs to container registry, default is true | `bool` | `true` | no |
53+
| <a name="input_allow_vpcs_to_cos"></a> [allow\_vpcs\_to\_cos](#input\_allow\_vpcs\_to\_cos) | Set rule for VPCs to COS, default is true | `bool` | `true` | no |
5354
| <a name="input_custom_rule_contexts_by_service"></a> [custom\_rule\_contexts\_by\_service](#input\_custom\_rule\_contexts\_by\_service) | Any additional context to add to the CBR rules created by this module. The context are added to the CBR rule targetting the service passed as a key. The module looks up the zone id when service\_ref\_names or add\_managed\_vpc\_zone are passed in. | <pre>map(list(object(<br> {<br> endpointType = string # "private, public or direct"<br><br> # Service-name (module lookup for existing network zone) and/or CBR zone id<br> service_ref_names = optional(list(string), [])<br> add_managed_vpc_zone = optional(bool, false)<br> zone_ids = optional(list(string), [])<br> })))</pre> | `{}` | no |
5455
| <a name="input_existing_cbr_zone_vpcs"></a> [existing\_cbr\_zone\_vpcs](#input\_existing\_cbr\_zone\_vpcs) | Provide a existing zone id for VPC | <pre>object(<br> {<br> zone_id = string<br> })</pre> | `null` | no |
5556
| <a name="input_existing_serviceref_zone"></a> [existing\_serviceref\_zone](#input\_existing\_serviceref\_zone) | Provide a valid service reference and existing zone id | <pre>map(object(<br> {<br> zone_id = string<br> }))</pre> | `{}` | no |

modules/fscloud/main.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ locals {
192192
server-protect_cbr_zone_id = local.cbr_zones["server-protect"].zone_id # block storage
193193
# tflint-ignore: terraform_naming_convention
194194
containers-kubernetes_cbr_zone_id = local.cbr_zones["containers-kubernetes"].zone_id
195+
# tflint-ignore: terraform_naming_convention
196+
logdnaat_cbr_zone_id = local.cbr_zones["logdnaat"].zone_id
195197

196198
prewired_rule_contexts_by_service = {
197199
# COS -> KMS, Block storage -> KMS, ROKS -> KMS
@@ -203,11 +205,12 @@ locals {
203205
var.allow_roks_to_kms ? [local.containers-kubernetes_cbr_zone_id] : []
204206
])
205207
}],
206-
# Fs VPCs -> COS
208+
# Fs VPCs -> COS, AT -> COS
207209
"cloud-object-storage" : [{
208210
endpointType : "direct",
209211
networkZoneIds : flatten([
210-
var.allow_vpcs_to_cos ? [local.cbr_zone_vpcs.zone_id] : []
212+
var.allow_vpcs_to_cos ? [local.cbr_zone_vpcs.zone_id] : [],
213+
var.allow_at_to_cos ? [local.logdnaat_cbr_zone_id] : []
211214
])
212215
}],
213216
# VPCs -> container registry
@@ -217,7 +220,6 @@ locals {
217220
var.allow_vpcs_to_container_registry ? [local.cbr_zone_vpcs.zone_id] : []
218221
])
219222
}],
220-
# TODO: Activity Tracker route -> COS (pending support of AT as CBR zone)
221223
}
222224

223225
prewired_rule_contexts_by_service_pre_check = { for key, value in local.prewired_rule_contexts_by_service :

modules/fscloud/variables.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,37 @@ variable "zone_vpc_crn_list" {
1010

1111
variable "allow_cos_to_kms" {
1212
type = bool
13-
description = "Set rule for COS to KMS, deafult is true"
13+
description = "Set rule for COS to KMS, default is true"
1414
default = true
1515
}
1616

1717
variable "allow_block_storage_to_kms" {
1818
type = bool
19-
description = "Set rule for block storage to KMS, deafult is true"
19+
description = "Set rule for block storage to KMS, default is true"
2020
default = true
2121
}
2222

2323
variable "allow_roks_to_kms" {
2424
type = bool
25-
description = "Set rule for ROKS to KMS, deafult is true"
25+
description = "Set rule for ROKS to KMS, default is true"
2626
default = true
2727
}
2828

2929
variable "allow_vpcs_to_container_registry" {
3030
type = bool
31-
description = "Set rule for VPCs to container registry, deafult is true"
31+
description = "Set rule for VPCs to container registry, default is true"
3232
default = true
3333
}
3434

3535
variable "allow_vpcs_to_cos" {
3636
type = bool
37-
description = "Set rule for VPCs to COS, deafult is true"
37+
description = "Set rule for VPCs to COS, default is true"
38+
default = true
39+
}
40+
41+
variable "allow_at_to_cos" {
42+
type = bool
43+
description = "Set rule for Activity Tracker to COS, default is true"
3844
default = true
3945
}
4046

0 commit comments

Comments
 (0)