aws_customer_gateway device name attribute #14346
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
service/ec2
Issues and PRs that pertain to the ec2 service.
Milestone
Community Note
Description
When creating more than one customer gateway with the same public IP and BGP ASN, the second resource creation does not actually create a new resource but instead imports the first resource created and that customer gateway ID can be found for both aws_customer_gateways in the Terraform state.
This behavior mimics the action in the console: creating a second customer gateway with the same public IP and BGP ASN will not create a new resource, but instead will return the id of the pre-existing customer gateway.
The way to get around this in the console is to provide a Device identifier, which will provide uniqueness within AWS:
At this point in time, the aws_customer_gateway resource does not allow setting the device-name field as exposed by the AWS API for create-customer-gateway:
Adding the device name attribute to the aws_customer_gateway resource would allow the Terraform user to avoid this accidental import of a pre-existing resource and explicitly declare that the two customer gateways are supposed to be unique by specifying a device name.
Having multiple customer gateways with the same BGP ASN and Public IP is a common scenario when you have redundant routers behind a NAT and need to distinguish between them separately in the AWS console.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: