Skip to content

Commit 3194ff7

Browse files
feat: add access tags support (#537)
1 parent 10a7b0b commit 3194ff7

File tree

17 files changed

+133
-29
lines changed

17 files changed

+133
-29
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ You need the following permissions to run this module.
6767
- **Resource Group** \<your resource group>
6868
- `Viewer` resource group access
6969

70+
To attach access management tags to resources in this module, you need the following permissions.
71+
72+
- IAM Services
73+
- **Tagging** service
74+
- `Administrator` platform access
75+
7076
<!-- BEGIN EXAMPLES HOOK -->
7177
## Examples
7278

@@ -114,6 +120,7 @@ You need the following permissions to run this module.
114120

115121
| Name | Description | Type | Default | Required |
116122
|------|-------------|------|---------|:--------:|
123+
| <a name="input_access_tags"></a> [access\_tags](#input\_access\_tags) | A list of access tags to apply to the VPC resources created by the module. For more information, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial. | `list(string)` | `[]` | no |
117124
| <a name="input_address_prefixes"></a> [address\_prefixes](#input\_address\_prefixes) | OPTIONAL - IP range that will be defined for the VPC for a certain location. Use only with manual address prefixes | <pre>object({<br> zone-1 = optional(list(string))<br> zone-2 = optional(list(string))<br> zone-3 = optional(list(string))<br> })</pre> | <pre>{<br> "zone-1": null,<br> "zone-2": null,<br> "zone-3": null<br>}</pre> | no |
118125
| <a name="input_classic_access"></a> [classic\_access](#input\_classic\_access) | OPTIONAL - Classic Access to the VPC | `bool` | `false` | no |
119126
| <a name="input_clean_default_acl"></a> [clean\_default\_acl](#input\_clean\_default\_acl) | Remove all rules from the default VPC ACL (less permissive) | `bool` | `false` | no |

examples/default/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ module "slz_vpc" {
4848
name = var.name
4949
prefix = var.prefix
5050
tags = var.resource_tags
51+
access_tags = var.access_tags
5152
enable_vpc_flow_logs = var.enable_vpc_flow_logs
5253
create_authorization_policy_vpc_to_cos = var.create_authorization_policy_vpc_to_cos
5354
existing_cos_instance_guid = ibm_resource_instance.cos_instance[0].guid

examples/default/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ variable "resource_tags" {
3434
default = null
3535
}
3636

37+
variable "access_tags" {
38+
type = list(string)
39+
description = "Optional list of access tags to add to the VPC resources that are created"
40+
default = []
41+
}
42+
3743
variable "enable_vpc_flow_logs" {
3844
type = bool
3945
description = "Enable VPC Flow Logs, it will create Flow logs collector if set to true"

examples/landing_zone/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module "workload_vpc" {
3636
region = var.region
3737
prefix = var.prefix
3838
tags = var.resource_tags
39+
access_tags = var.access_tags
3940
enable_vpc_flow_logs = var.enable_vpc_flow_logs
4041
create_authorization_policy_vpc_to_cos = var.create_authorization_policy_vpc_to_cos
4142
existing_cos_instance_guid = module.cos_bucket[0].cos_instance_guid

examples/landing_zone/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ variable "resource_tags" {
2828
default = null
2929
}
3030

31+
variable "access_tags" {
32+
type = list(string)
33+
description = "Optional list of access tags to add to the VPC resources that are created"
34+
default = []
35+
}
3136

3237
##############################################################################
3338
# VPC flow logs variables

landing-zone-submodule/management-vpc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ No resources.
2727

2828
| Name | Description | Type | Default | Required |
2929
|------|-------------|------|---------|:--------:|
30+
| <a name="input_access_tags"></a> [access\_tags](#input\_access\_tags) | Optional list of access tags to add to the VPC resources that are created | `list(string)` | `[]` | no |
3031
| <a name="input_address_prefixes"></a> [address\_prefixes](#input\_address\_prefixes) | Use `address_prefixes` only if `use_manual_address_prefixes` is true otherwise prefixes will not be created. Use only if you need to manage prefixes manually. | <pre>object({<br> zone-1 = optional(list(string))<br> zone-2 = optional(list(string))<br> zone-3 = optional(list(string))<br> })</pre> | `null` | no |
3132
| <a name="input_classic_access"></a> [classic\_access](#input\_classic\_access) | Optionally allow VPC to access classic infrastructure network | `bool` | `null` | no |
3233
| <a name="input_clean_default_acl"></a> [clean\_default\_acl](#input\_clean\_default\_acl) | Remove all rules from the default VPC ACL (less permissive) | `bool` | `false` | no |

landing-zone-submodule/management-vpc/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module "management_vpc" {
66
source = "../../"
77
name = "management"
88
tags = var.tags
9+
access_tags = var.access_tags
910
resource_group_id = var.resource_group_id
1011
region = var.region
1112
prefix = var.prefix

landing-zone-submodule/management-vpc/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ variable "tags" {
2121
default = []
2222
}
2323

24+
variable "access_tags" {
25+
type = list(string)
26+
description = "Optional list of access tags to add to the VPC resources that are created"
27+
default = []
28+
}
2429

2530
#############################################################################
2631
# VPC variables

landing-zone-submodule/workload-vpc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ No resources.
2828

2929
| Name | Description | Type | Default | Required |
3030
|------|-------------|------|---------|:--------:|
31+
| <a name="input_access_tags"></a> [access\_tags](#input\_access\_tags) | Optional list of access tags to add to the VPC resources that are created | `list(string)` | `[]` | no |
3132
| <a name="input_address_prefixes"></a> [address\_prefixes](#input\_address\_prefixes) | Use `address_prefixes` only if `use_manual_address_prefixes` is true otherwise prefixes will not be created. Use only if you need to manage prefixes manually. | <pre>object({<br> zone-1 = optional(list(string))<br> zone-2 = optional(list(string))<br> zone-3 = optional(list(string))<br> })</pre> | `null` | no |
3233
| <a name="input_classic_access"></a> [classic\_access](#input\_classic\_access) | Optionally allow VPC to access classic infrastructure network | `bool` | `null` | no |
3334
| <a name="input_clean_default_acl"></a> [clean\_default\_acl](#input\_clean\_default\_acl) | Remove all rules from the default VPC ACL (less permissive) | `bool` | `false` | no |

landing-zone-submodule/workload-vpc/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module "workload_vpc" {
66
source = "../../"
77
name = "workload"
88
tags = var.tags
9+
access_tags = var.access_tags
910
resource_group_id = var.resource_group_id
1011
region = var.region
1112
prefix = var.prefix

0 commit comments

Comments
 (0)