Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add access tags and utilize in examples/tests #537

Merged
merged 4 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ You need the following permissions to run this module.
- **Resource Group** \<your resource group>
- `Viewer` resource group access

To attach access management tags to resources in this module, you need the following permissions.

- IAM Services
- **Tagging** service
- `Administrator` platform access

<!-- BEGIN EXAMPLES HOOK -->
## Examples

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

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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 |
| <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 |
| <a name="input_classic_access"></a> [classic\_access](#input\_classic\_access) | OPTIONAL - Classic Access to the VPC | `bool` | `false` | no |
| <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 |
Expand Down
1 change: 1 addition & 0 deletions examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module "slz_vpc" {
name = var.name
prefix = var.prefix
tags = var.resource_tags
access_tags = var.access_tags
enable_vpc_flow_logs = var.enable_vpc_flow_logs
create_authorization_policy_vpc_to_cos = var.create_authorization_policy_vpc_to_cos
existing_cos_instance_guid = ibm_resource_instance.cos_instance[0].guid
Expand Down
6 changes: 6 additions & 0 deletions examples/default/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ variable "resource_tags" {
default = null
}

variable "access_tags" {
type = list(string)
description = "Optional list of access tags to add to the VPC resources that are created"
default = []
}

variable "enable_vpc_flow_logs" {
type = bool
description = "Enable VPC Flow Logs, it will create Flow logs collector if set to true"
Expand Down
1 change: 1 addition & 0 deletions examples/landing_zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module "workload_vpc" {
region = var.region
prefix = var.prefix
tags = var.resource_tags
access_tags = var.access_tags
enable_vpc_flow_logs = var.enable_vpc_flow_logs
create_authorization_policy_vpc_to_cos = var.create_authorization_policy_vpc_to_cos
existing_cos_instance_guid = module.cos_bucket[0].cos_instance_guid
Expand Down
5 changes: 5 additions & 0 deletions examples/landing_zone/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ variable "resource_tags" {
default = null
}

variable "access_tags" {
type = list(string)
description = "Optional list of access tags to add to the VPC resources that are created"
default = []
}

##############################################################################
# VPC flow logs variables
Expand Down
1 change: 1 addition & 0 deletions landing-zone-submodule/management-vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ No resources.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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 |
| <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 |
| <a name="input_classic_access"></a> [classic\_access](#input\_classic\_access) | Optionally allow VPC to access classic infrastructure network | `bool` | `null` | no |
| <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 |
Expand Down
1 change: 1 addition & 0 deletions landing-zone-submodule/management-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module "management_vpc" {
source = "../../"
name = "management"
tags = var.tags
access_tags = var.access_tags
resource_group_id = var.resource_group_id
region = var.region
prefix = var.prefix
Expand Down
5 changes: 5 additions & 0 deletions landing-zone-submodule/management-vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ variable "tags" {
default = []
}

variable "access_tags" {
type = list(string)
description = "Optional list of access tags to add to the VPC resources that are created"
default = []
}

#############################################################################
# VPC variables
Expand Down
1 change: 1 addition & 0 deletions landing-zone-submodule/workload-vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ No resources.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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 |
| <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 |
| <a name="input_classic_access"></a> [classic\_access](#input\_classic\_access) | Optionally allow VPC to access classic infrastructure network | `bool` | `null` | no |
| <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 |
Expand Down
1 change: 1 addition & 0 deletions landing-zone-submodule/workload-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module "workload_vpc" {
source = "../../"
name = "workload"
tags = var.tags
access_tags = var.access_tags
resource_group_id = var.resource_group_id
region = var.region
prefix = var.prefix
Expand Down
6 changes: 6 additions & 0 deletions landing-zone-submodule/workload-vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ variable "tags" {
default = []
}

variable "access_tags" {
type = list(string)
description = "Optional list of access tags to add to the VPC resources that are created"
default = []
}

#############################################################################
# VPC variables
#############################################################################
Expand Down
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resource "ibm_is_vpc" "vpc" {
default_security_group_name = var.default_security_group_name
default_routing_table_name = var.default_routing_table_name
tags = var.tags
access_tags = var.access_tags
}

##############################################################################
Expand Down Expand Up @@ -89,6 +90,7 @@ resource "ibm_is_public_gateway" "gateway" {
resource_group = var.resource_group_id
zone = each.value
tags = var.tags
access_tags = var.access_tags
}

##############################################################################
Expand Down Expand Up @@ -123,6 +125,7 @@ resource "ibm_is_flow_log" "flow_logs" {
storage_bucket = var.existing_storage_bucket_name
resource_group = var.resource_group_id
tags = var.tags
access_tags = var.access_tags
}

##############################################################################
Expand Down
Loading