-
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
aws_vpn_connection applies tunnel2 options to tunnel1 #19079
Comments
Actually given this section of configuration: resource "aws_vpn_connection" "test" {
vpn_gateway_id = aws_vpn_gateway.test.id
customer_gateway_id = aws_customer_gateway.test.id
type = "ipsec.1"
tunnel2_phase1_encryption_algorithms = [
"AES128",
"AES128-GCM-16",
"AES256",
"AES256-GCM-16",
]
tunnel2_phase1_lifetime_seconds = 28800
tunnel2_phase2_encryption_algorithms = [
"AES128",
"AES128-GCM-16",
"AES256",
"AES256-GCM-16",
]
tunnel2_phase2_lifetime_seconds = 3600
} The fix mentioned would not catch this case. Tunnels are automatically assigned outside addresses and even with the proposed changes there, it would still fall back to sorting by outside address to order the tunnels. We would need to potentially look at all configuration options in this case to properly match tunnel 1 versus 2. 🙁 To workaround the problem when the above fix is in place, configuring |
Hey @bflad , thanks for the quick reply. To my amateur eye, the issue is actually this line:
Calling v.List() I think is converting vgwTelemetry from a Set to a List, which is indeterminate for ordering, but then we reference the desired tunnel by an index. So the API request is getting populated with the wrong target outside IP address. Would it make sense to change vgw_telemetry to Type: schema.TypeList instead of TypeSet? |
I'm still having this issue with Terraform v0.15.1 on darwin_arm64 and + provider registry.terraform.io/hashicorp/aws v3.38.0. On the AWS site-to-site vpn,
There you go;
Preshared-keys are also having the same issue. |
@dthvt I think your are right that it's the use of the |
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
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Trace output for initial apply and a subsequent "update apply":
https://gist.github.com/dthvt/9c936a1589b1e88b38aac30391b981e3
Panic Output
Expected Behavior
Terraform should apply the tunnel2_* values to Tunnel 2 on the VPN.
Actual Behavior
Terraform applies the tunnel2_* values to Tunnel 1, which triggers resource cycling. Additionally, when tunnel1_* parameters are left at defaults (i.e. unspecified), this triggers an API error from AWS, because I don't think there's a way to set a tunnel back to default once a setting has been set. (I consider that outside the scope of this issue, since that's API behavior.)
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: