Terraform module which creates AWS Customer Gateway resources on AWS.
This module has been extracted from the VPC module, because sometimes it makes sense to reuse Customer Gateways across multiple VPC resources. Check out other related modules - VPC, VPN Gateway and Transit Gateway for more details.
These types of resources are supported:
module "cgw" {
source = "terraform-aws-modules/customer-gateway/aws"
version = "~> 1.0"
name = "test-cgw"
customer_gateways = {
IP1 = {
bgp_asn = 65112
ip_address = "49.33.1.162"
},
IP2 = {
bgp_asn = 65112
ip_address = "85.38.42.93"
}
}
tags = {
Test = "maybe"
}
}
- Complete example creates 2 Customer Gateways, a VPC and creates 2 VPN connections between them.
Sometimes you need to have a way to create Customer Gateway conditionally but Terraform does not allow to use count
inside module
block, so the solution is to specify argument create
.
# This CGW will not be created
module "cgw" {
source = "terraform-aws-modules/customer-gateway/aws"
version = "~> 1.0"
create = false
# ... omitted
}
Name | Version |
---|---|
terraform | >= 0.12.6 |
aws | >= 2.23 |
Name | Version |
---|---|
aws | >= 2.23 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
create | Whether to create Customer Gateway resources | bool |
true |
no |
customer_gateways | Maps of Customer Gateway's attributes (BGP ASN and Gateway's Internet-routable external IP address) | map(map(any)) |
{} |
no |
name | Name to be used on all the resources as identifier | string |
"" |
no |
tags | A mapping of tags to assign to all resources | map(string) |
{} |
no |
Name | Description |
---|---|
cgw_ids | List of IDs of Customer Gateway |
this_customer_gateway | Map of Customer Gateway attributes |
Module managed by Anton Babenko.
Apache 2 Licensed. See LICENSE for full details.