Home

Awesome

AWS Customer Gateway Terraform module

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.

Usage

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"
  }
}

Examples

Conditional creation

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
}
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Requirements

NameVersion
<a name="requirement_terraform"></a> terraform>= 1.0
<a name="requirement_aws"></a> aws>= 4.0

Providers

NameVersion
<a name="provider_aws"></a> aws>= 4.0

Modules

No modules.

Resources

NameType
aws_customer_gateway.thisresource

Inputs

NameDescriptionTypeDefaultRequired
<a name="input_create"></a> createWhether to create Customer Gateway resourcesbooltrueno
<a name="input_customer_gateways"></a> customer_gatewaysMaps of Customer Gateway's attributes (BGP ASN and Gateway's Internet-routable external IP address)map(map(any)){}no
<a name="input_name"></a> nameName to be used on all the resources as identifierstring""no
<a name="input_tags"></a> tagsA mapping of tags to assign to all resourcesmap(string){}no

Outputs

NameDescription
<a name="output_customer_gateway"></a> customer_gatewayMap of Customer Gateway attributes
<a name="output_ids"></a> idsList of IDs of Customer Gateway
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Authors

Module is maintained by Anton Babenko with help from these awesome contributors.

License

Apache 2 Licensed. See LICENSE for full details.