-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Changing the customer gateway of an aws_vpn_connection forces replacement #11284
Comments
customer_gateway_id
of an aws_vpn_connection
forces replacement
This is causing trouble for a client when there's a need to update the gateway IP. Currently to work around this issue, we are:
This is somewhat cumbersome and prone to errors, we'd really like to see this fixed. |
@krwrang obviously this doesn't solve the problem at-hand, but it's worth thinking about why your use-case necessitates frequently changing your CGW. If you are changing back-and-forth between a few known IPs, you could theoretically use a Transit Gateway and multiple VPNs as a workaround, though this might have routing implications. Maaaaaaybe if this PR idles for a long time, eventually I'll find the time to try to fix this myself, but for the time being I think the chances that this issue will sit idle for the foreseeable future are fairly high, so thinking through options for a better workaround without that level of manual intervention might be beneficial to you. |
@wwboynton I appreciate your concern. Our issue is not about changing one VPN over and over again. Customers have been instructed that they will be provided with tunnel IPs from our end before they have provided their gateway IP, meaning that sometimes for new customers the VPN connection needs to be created with a false on-prem GW IP. That is then changed when the customer gives their correct details. Changing this flow has proven difficult as it is what they are used to outside of AWS. This and the occasional human error means that while no CGW is updated/replaced more than once, there will be quite a few of them and therefore this is something we need to tackle. |
We have the same situation as per @krwrang above. Yes changing the customer gateway is an infrequent requirement, but the provider should support it nonetheless given the AWS API allows that, for valid reasons. |
I'm running into this issue as well. We were hoping to transition the vpn connection from a deprecated vpc to its replacement while keeping the external IPs of the vpn in place by just updating the AWS Site-to-Site VPN User Guide: Modifying a Site-to-Site VPN connection's target gateway
|
I found out that if I manually make the change to the vpn connection and update the terraform code to reflect that, |
Just ran into this issue today which was super frustrating. It's definitely possible to change the target gateway that the VPN points to in the AWS console without rebuilding the VPN but using Terraform, the entire thing is rebuilt. Unfortunately, this new VPN will have a different public IP address and causes the connection between our on-prem appliance to sever. |
This functionality has been released in v3.72.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. Thank you! |
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. |
Community Note
tl;dr
Changing the CGW associated with a VPN Connection is wrongly forcing destruction and recreation of the VPN connection, which is not consistent with the behaviour of the AWS CLI/Console.
Terraform Version
Affected Resource(s)
aws_vpn_connection
Terraform Configuration Files
Output
Expected Behavior
Changing the CGW associated with a VPN should modify the resource in-place which is consistent with the behaviour of the AWS CLI and console.
Actual Behavior
Terraform attempted to destroy and recreate the resource -- this is particularly troublesome with an
aws_vpn_connection
resource, as one cannot control the public IPs associated with the tunnels provided with it. Upon recreation, one will lose the public IPs that have been used with their VPN, forcing manual reconfiguration of the appliance backing the associated customer gateway.Steps to Reproduce
aws_vpn_connection
and associate it with some customer gateway.terraform apply
customer_gateway_id
parameter of theaws_vpn_connection
created in step 1terraform plan
The text was updated successfully, but these errors were encountered: