Skip to content

Commit 2e8521d

Browse files
authored
feat: added pre-wired rule for IS (VPC infra) -> COS in fscloud submodule (#302)
1 parent 4026d8c commit 2e8521d

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

examples/fscloud/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module "cbr_account_level" {
7070
allow_vpcs_to_cos = var.allow_vpcs_to_cos
7171
allow_at_to_cos = var.allow_at_to_cos
7272
allow_iks_to_is = var.allow_iks_to_is
73+
allow_is_to_cos = var.allow_is_to_cos
7374

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

examples/fscloud/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,9 @@ variable "allow_iks_to_is" {
7575
description = "Set rule for IKS to IS (VPC Infrastructure Services), default is true"
7676
default = true
7777
}
78+
79+
variable "allow_is_to_cos" {
80+
type = bool
81+
description = "Set rule for IS (VPC Infrastructure Services) to COS, default is true"
82+
default = true
83+
}

modules/fscloud/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This module creates default coarse-grained CBR rules in a given account followin
66
- ROKS -> KMS
77
- Activity Tracker route -> COS
88
- VPCs where clusters are deployed -> COS
9+
- IS (VPC Infrastructure Services) -> COS
910
- VPCs -> container registry
1011
- All ICD -> KMS
1112
- IKS -> IS (VPC Infrastructure Services)
@@ -52,6 +53,7 @@ The services 'compliance', 'directlink', 'iam-groups', 'containers-kubernetes',
5253
| <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 |
5354
| <a name="input_allow_icd_to_kms"></a> [allow\_icd\_to\_kms](#input\_allow\_icd\_to\_kms) | Set rule for ICD to KMS, deafult is true | `bool` | `true` | no |
5455
| <a name="input_allow_iks_to_is"></a> [allow\_iks\_to\_is](#input\_allow\_iks\_to\_is) | Set rule for IKS to IS (VPC Infrastructure Services), default is true | `bool` | `true` | no |
56+
| <a name="input_allow_is_to_cos"></a> [allow\_is\_to\_cos](#input\_allow\_is\_to\_cos) | Set rule for IS (VPC Infrastructure Services) to COS, default is true | `bool` | `true` | no |
5557
| <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 |
5658
| <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 |
5759
| <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 |

modules/fscloud/main.tf

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ locals {
207207
databases-for-redis_cbr_zone_id = local.cbr_zones["databases-for-redis"].zone_id
208208
# tflint-ignore: terraform_naming_convention
209209
logdnaat_cbr_zone_id = local.cbr_zones["logdnaat"].zone_id
210+
# tflint-ignore: terraform_naming_convention
211+
is_cbr_zone_id = local.cbr_zones["is"].zone_id
210212

211213
prewired_rule_contexts_by_service = {
212214
# COS -> KMS, Block storage -> KMS, ROKS -> KMS, ICD -> KMS
@@ -216,17 +218,23 @@ locals {
216218
var.allow_cos_to_kms ? [local.cos_cbr_zone_id] : [],
217219
var.allow_block_storage_to_kms ? [local.server-protect_cbr_zone_id] : [],
218220
var.allow_roks_to_kms ? [local.containers-kubernetes_cbr_zone_id] : [],
219-
var.allow_icd_to_kms ? [local.databases-for-cassandra_cbr_zone_id, local.databases-for-elasticsearch_cbr_zone_id, local.databases-for-enterprisedb_cbr_zone_id,
220-
local.databases-for-etcd_cbr_zone_id, local.databases-for-mongodb_cbr_zone_id, local.databases-for-mysql_cbr_zone_id, local.databases-for-postgresql_cbr_zone_id,
221+
var.allow_icd_to_kms ? [local.databases-for-cassandra_cbr_zone_id,
222+
local.databases-for-elasticsearch_cbr_zone_id,
223+
local.databases-for-enterprisedb_cbr_zone_id,
224+
local.databases-for-etcd_cbr_zone_id,
225+
local.databases-for-mongodb_cbr_zone_id,
226+
local.databases-for-mysql_cbr_zone_id,
227+
local.databases-for-postgresql_cbr_zone_id,
221228
local.databases-for-redis_cbr_zone_id] : []
222229
])
223230
}],
224-
# Fs VPCs -> COS, AT -> COS
231+
# Fs VPCs -> COS, AT -> COS, IS (VPC Infrastructure Services) -> COS
225232
"cloud-object-storage" : [{
226233
endpointType : "direct",
227234
networkZoneIds : flatten([
228235
var.allow_vpcs_to_cos ? [local.cbr_zone_vpcs.zone_id] : [],
229-
var.allow_at_to_cos ? [local.logdnaat_cbr_zone_id] : []
236+
var.allow_at_to_cos ? [local.logdnaat_cbr_zone_id] : [],
237+
var.allow_is_to_cos ? [local.is_cbr_zone_id] : []
230238
])
231239
}],
232240
# VPCs -> container registry
@@ -236,7 +244,7 @@ locals {
236244
var.allow_vpcs_to_container_registry ? [local.cbr_zone_vpcs.zone_id] : []
237245
])
238246
}],
239-
# IKS -> IS
247+
# IKS -> IS (VPC Infrastructure Services)
240248
"is" : [{
241249
endpointType : "private",
242250
networkZoneIds : flatten([

modules/fscloud/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ variable "allow_iks_to_is" {
5656
default = true
5757
}
5858

59+
variable "allow_is_to_cos" {
60+
type = bool
61+
description = "Set rule for IS (VPC Infrastructure Services) to COS, default is true"
62+
default = true
63+
}
64+
5965
variable "zone_service_ref_list" {
6066
type = list(string)
6167
validation {

0 commit comments

Comments
 (0)