Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_customer_gateway device name attribute #14346

Closed
mikereinhold opened this issue Jul 25, 2020 · 3 comments · Fixed by #14786
Closed

aws_customer_gateway device name attribute #14346

mikereinhold opened this issue Jul 25, 2020 · 3 comments · Fixed by #14786
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@mikereinhold
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

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:
image

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:
image

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)

  • aws_customer_gateway

Potential Terraform Configuration

resource "aws_customer_gateway" "first" {
  bgp_asn    = 65000
  ip_address = "172.83.124.10"
  type       = "ipsec.1"

  device = "first"
}

resource "aws_customer_gateway" "second" {
  bgp_asn    = 65000
  ip_address = "172.83.124.10"
  type       = "ipsec.1"

  device = "second"
}

References

@mikereinhold mikereinhold added the enhancement Requests to existing resources that expand the functionality or scope. label Jul 25, 2020
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jul 25, 2020
@mikereinhold mikereinhold changed the title aws_customer_gateway device-name attribute aws_customer_gateway device name attribute Jul 25, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 25, 2020
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jul 29, 2020
@bflad bflad self-assigned this Feb 11, 2021
@bflad
Copy link
Contributor

bflad commented Feb 11, 2021

Support for device_name in the aws_customer_gateway resource and data source has been merged and will release with version 3.28.0 of the Terraform AWS Provider, later today. Thank you to @shuheiktgw for the implementation. 👍

@bflad bflad added this to the v3.28.0 milestone Feb 11, 2021
@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 14, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants