Skip to content

Commit 66374b9

Browse files
Ak-skyvburckhardt
andauthored
feat: add regionality support in fscloud submodule (#271)
Co-authored-by: Vincent Burckhardt <[email protected]>
1 parent e2dd42f commit 66374b9

File tree

5 files changed

+14
-48
lines changed

5 files changed

+14
-48
lines changed

cbr-service-profile/README.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

examples/fscloud/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ Context: this examples covers a "pseudo" real-world scenario where:
1414
3. Operators use machines with a set list of public IPs to interact with Schematics.
1515
4. Applications are running the VPC and need access to PostgreSQL via the private endpoint - eg: a VPE.
1616
5. Skips creation of zones for these two service references ["user-management", "iam-groups"].
17+
18+
## Note
19+
- The services 'compliance', 'directlink', 'iam-groups', 'containers-kubernetes', 'user-management' do not support restriction per location for zone creation.

modules/fscloud/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ The module also pre-create CBR zone for each service in the account as a best pr
1414

1515
Important: In order to avoid unexpected breakage in the account against which this module is executed, the CBR rule enforcement mode is set to 'report' (or 'disabled' for services not supporting 'report' mode) by default. It is recommended to test out this module first with these default, and then use the `target_service_details` variable to set the enforcement mode to "enabled" gradually by service. The [usage example](../../examples/fscloud/) demonstrates how to set the enforcement mode to 'enabled' for the key protect ("kms") service.
1616

17+
## Note
18+
The services 'compliance', 'directlink', 'iam-groups', 'containers-kubernetes', 'user-management' does not support restriction per location.
19+
1720

1821
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
1922
### Requirements
@@ -50,6 +53,7 @@ Important: In order to avoid unexpected breakage in the account against which th
5053
| <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 |
5154
| <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 |
5255
| <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 |
56+
| <a name="input_location"></a> [location](#input\_location) | The region in which the network zone is scoped | `string` | `null` | no |
5357
| <a name="input_prefix"></a> [prefix](#input\_prefix) | Prefix to append to all vpc\_zone\_list, service\_ref\_zone\_list and cbr\_rule\_description created by this submodule | `string` | n/a | yes |
5458
| <a name="input_skip_specific_services_for_zone_creation"></a> [skip\_specific\_services\_for\_zone\_creation](#input\_skip\_specific\_services\_for\_zone\_creation) | Provide a list of service references for which zone creation is not required | `list(string)` | `[]` | no |
5559
| <a name="input_target_service_details"></a> [target\_service\_details](#input\_target\_service\_details) | Details of the target service for which a rule is created. The key is the service name. | <pre>map(object({<br> target_rg = optional(string)<br> instance_id = optional(string)<br> enforcement_mode = string<br> tags = optional(list(string))<br> }))</pre> | `{}` | no |

modules/fscloud/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ data "ibm_iam_account_settings" "iam_account_settings" {
55
}
66

77
locals {
8-
98
target_service_details_default = {
109
"iam-groups" : {
1110
"enforcement_mode" : "report"
@@ -117,6 +116,7 @@ locals {
117116
ref = {
118117
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
119118
service_name = serviceref
119+
location = (serviceref == "compliance" || serviceref == "directlink" || serviceref == "iam-groups" || serviceref == "user-management" || serviceref == "containers-kubernetes") ? null : var.location
120120
}
121121
}
122122
]

modules/fscloud/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,9 @@ variable "skip_specific_services_for_zone_creation" {
177177
description = "Provide a list of service references for which zone creation is not required"
178178
default = []
179179
}
180+
181+
variable "location" {
182+
type = string
183+
description = "The region in which the network zone is scoped"
184+
default = null
185+
}

0 commit comments

Comments
 (0)