diff --git a/README.md b/README.md index a9c3955..ac5845a 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ module "vpc_endpoints" { "ec2" = { name = "ec2" security_group_ids = ["sg-12341234123412345"] - subnet_ids = [module.dynamic_subnets.private_subnet_ids[0]] + subnet_ids = module.dynamic_subnets.private_subnet_ids policy = null private_dns_enabled = false } diff --git a/README.yaml b/README.yaml index 2809039..ce40ace 100644 --- a/README.yaml +++ b/README.yaml @@ -135,7 +135,7 @@ examples: |- "ec2" = { name = "ec2" security_group_ids = ["sg-12341234123412345"] - subnet_ids = [module.dynamic_subnets.private_subnet_ids[0]] + subnet_ids = module.dynamic_subnets.private_subnet_ids policy = null private_dns_enabled = false } diff --git a/examples/vpc-endpoints/main.tf b/examples/vpc-endpoints/main.tf index d60f991..48329bf 100644 --- a/examples/vpc-endpoints/main.tf +++ b/examples/vpc-endpoints/main.tf @@ -76,6 +76,24 @@ module "subnets" { context = module.this.context } +module "ec2_vpc_endpoint_sg_label" { + source = "cloudposse/label/null" + version = "0.24.1" + + attributes = ["ec2-vpc-endpoint-sg"] + + context = module.this.context +} + +module "kinesis_vpc_endpoint_sg_label" { + source = "cloudposse/label/null" + version = "0.24.1" + + attributes = ["kinesis-vpc-endpoint-sg"] + + context = module.this.context +} + resource "aws_security_group" "ec2_vpc_endpoint_sg" { vpc_id = module.vpc.vpc_id ingress { @@ -86,9 +104,7 @@ resource "aws_security_group" "ec2_vpc_endpoint_sg" { description = "Security Group for EC2 Interface VPC Endpoint" } - tags = merge( - module.this.tags, - { Name = "${module.this.id}-ec2-vpc-endpoint-sg" }) + tags = module.ec2_vpc_endpoint_sg_label.tags } resource "aws_security_group" "kinesis_vpc_endpoint_sg" { @@ -101,9 +117,7 @@ resource "aws_security_group" "kinesis_vpc_endpoint_sg" { description = "Security Group for Kinesis Interface VPC Endpoint" } - tags = merge( - module.this.tags, - { Name = "${module.this.id}-kinesis-vpc-endpoint-sg" }) + tags = module.kinesis_vpc_endpoint_sg_label.tags } resource "aws_vpc_endpoint_route_table_association" "s3_gateway_vpc_endpoint_route_table_association" { diff --git a/modules/vpc-endpoints/README.md b/modules/vpc-endpoints/README.md index ef83a3b..a2ec260 100644 --- a/modules/vpc-endpoints/README.md +++ b/modules/vpc-endpoints/README.md @@ -17,7 +17,11 @@ Submodule for provisioning Gateway and/or Interface VPC Endpoints to the VPC cre ## Modules -No modules. +| Name | Source | Version | +|------|--------|---------| +| [gateway\_endpoint\_label](#module\_gateway\_endpoint\_label) | cloudposse/label/null | 0.24.1 | +| [interface\_endpoint\_label](#module\_interface\_endpoint\_label) | cloudposse/label/null | 0.24.1 | +| [this](#module\_this) | cloudposse/label/null | 0.24.1 | ## Resources @@ -25,7 +29,6 @@ No modules. |------|------| | [aws_vpc_endpoint.gateway_endpoint](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource | | [aws_vpc_endpoint.interface_endpoint](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource | -| [aws_vpc.vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source | | [aws_vpc_endpoint_service.gateway_endpoint_service](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc_endpoint_service) | data source | | [aws_vpc_endpoint_service.interface_endpoint_service](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc_endpoint_service) | data source | @@ -33,8 +36,23 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [gateway\_vpc\_endpoints](#input\_gateway\_vpc\_endpoints) | A map of Gateway VPC Endpoints to provision into the VPC. This is a map of objects with the following valid attributes: 'name' can either be one of 's3' or 'dynamodb'; 'policy' is optional and can be specified as null. |
map(object({| `{}` | no | -| [interface\_vpc\_endpoints](#input\_interface\_vpc\_endpoints) | A map of Interface VPC Endpoints to provision into the VPC. This is a map of objects with the following valid attributes: 'name', 'security\_group\_ids' are required; 'policy' and 'subnet\_ids' are optional and can be specified as null and as an empty list, respectively. |
name = string
policy = string
}))
map(object({| `{}` | no | +| [additional\_tag\_map](#input\_additional\_tag\_map) | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. | `map(string)` | `{}` | no | +| [attributes](#input\_attributes) | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | +| [context](#input\_context) | Single object for setting entire context at once.
name = string
subnet_ids = list(string)
policy = string
security_group_ids = list(string)
}))
{| no | +| [delimiter](#input\_delimiter) | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {}
}
map(object({| `{}` | no | +| [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).
name = string
policy = string
}))
map(object({| `{}` | no | +| [label\_key\_case](#input\_label\_key\_case) | The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.
name = string
subnet_ids = list(string)
policy = string
security_group_ids = list(string)
private_dns_enabled = bool
}))