Terraform module to:
- create and manage a VPC (using a CIDR provided by an existing IPAM pool)
- (optionally) attach the VPC to an existing transit gateway
- (optionally) create VPC endpoint resources using the VPC endpoints submodule
This module will be merged with the terraform-aws-mcaf-vpc module in the future.
Note
If your VPC and Transit Gateway are in the same AWS account and region, no EC2 Transit Gateway VPC Attachment Accepter can be created as this is automatically accepted. In this scenario set the transit_gateway_enable_accepter
variable (default: true
) to false
. For more details, see AWS Documentation.
Name | Version |
---|---|
terraform | >= 1.6 |
aws | >= 5.82 |
Name | Version |
---|---|
aws | >= 5.82 |
aws.transit_gateway_account | >= 5.82 |
Name | Source | Version |
---|---|---|
log_bucket | schubergphilis/mcaf-s3/aws | ~> 1.2.0 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
availability_zones | A list of availability zones names or ids in the region. | list(string) |
n/a | yes |
aws_vpc_ipam_pool | ID of the IPAM pool to get CIDRs from. | string |
n/a | yes |
name | Name to be used on all the resources as identifier. | string |
n/a | yes |
networks | A list of objects describing requested subnetwork prefixes. | list(object({ |
n/a | yes |
cloudwatch_flow_logs_configuration | Cloudwatch flow logs configuration | object({ |
null |
no |
enable_dns_hostnames | Enable DNS hostnames in the VPC. | bool |
true |
no |
manage_default_vpc | Should be true to adopt and manage the default VPC. | bool |
true |
no |
route53_profiles_association | Variable to enable Route53 Profiles association. Lookup 'profile_names' of Route53 Profiles in the account to associate with the VPC, and assign arbitrary association names. | object({ |
{} |
no |
s3_flow_logs_configuration | Variables to enable S3 flow logs for the VPC. Use 'bucket_name' to log to an S3 bucket created by this module. Alternatively, use 'log_destination' to specify a self-managed S3 bucket. The 'log_destination' variable accepts full S3 ARNs, optionally including object keys. | object({ |
null |
no |
tags | A map of tags to add to all resources. | map(string) |
{} |
no |
transit_gateway_appliance_mode_support | Enable to attach the VPC in appliance mode on the Transit Gateway. | bool |
false |
no |
transit_gateway_enable_accepter | Set to false to disable the EC2 Transit Gateway VPC Attachment Accepter; this must be false if the VPC and Transit Gateway are in the same AWS account and region. | bool |
true |
no |
transit_gateway_id | Transit Gateway ID. | string |
"" |
no |
transit_gateway_route_table_association | Transit Gateway route table ID to attach the VPC on. | string |
"" |
no |
transit_gateway_route_table_propagation | Map of [logical name]→[Transit Gateway route table ID] to propagate the VPC CIDR to. | map(string) |
{} |
no |
vpc_cidr_netmask | The netmask length of the IPv4 CIDR you want to allocate to this VPC. | number |
20 |
no |
Name | Description |
---|---|
nat_gateway_ids | List of NAT Gateway IDs |
route_table_ids | Map of all networks in the VPC and their subnets |
subnet_ids | Map of all networks in the VPC and their subnets |
subnets | Map of all subnets in the VPCs |
transit_gateway_attachment_id | Transit Gateway attachment ID |
vpc_arn | The ARN of the VPC |
vpc_cidr_block | The CIDR block of the VPC |
vpc_id | The ID of the VPC |
Copyright: Schuberg Philis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.