terraform-aws-modules / terraform-aws-vpn-gateway

Terraform module to create AWS VPN gateway resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/vpn-gateway/aws
Apache License 2.0
111 stars 154 forks source link

Migration from 2.8.0 to 3.0.0 fails #78

Closed avysotsk closed 1 year ago

avysotsk commented 1 year ago

inputs = { transit_gateway_id = local.transit_gateway_id customer_gateway_id = local.customer_gateway_id connect_to_transit_gateway = true vpn_connection_static_routes_only = true vpn_connection_static_routes_destinations = local.vpn_static_routes }

Note - no tunnel cidrs and tunnel preshared keys set.

The errors are in the output, all place where "try(coalesce...." is used.

│ Error: Error in function call │ │ on outputs.tf line 3, in output "vpn_connection_id": │ 3: value = try(coalesce( │ 4: aws_vpn_connection.default[0].id, │ 5: aws_vpn_connection.tunnel[0].id, │ 6: aws_vpn_connection.preshared[0].id, │ 7: aws_vpn_connection.tunnel_preshared[0].id, │ 8: "") │ 9: ) │ ├──────────────── │ │ while calling try(expressions...) │ │ aws_vpn_connection.default[0].id is "vpn-1234567890" │ │ aws_vpn_connection.preshared is empty tuple │ │ aws_vpn_connection.tunnel is empty tuple │ │ aws_vpn_connection.tunnel_preshared is empty tuple │ │ Call to function "try" failed: no expression succeeded: │ - Invalid index (at outputs.tf:5,30-33) │ The given key does not identify an element in this collection value: the collection has no elements. │ - Invalid index (at outputs.tf:6,33-36) │ The given key does not identify an element in this collection value: the collection has no elements. │ - Invalid index (at outputs.tf:7,40-43) │ The given key does not identify an element in this collection value: the collection has no elements. │ │ At least one expression must produce a successful result.

$ tf --version Terraform v1.3.4 on darwin_amd64

antonbabenko commented 1 year ago

Thank you for the report. I have just fixed it in #79

antonbabenko commented 1 year ago

This issue has been resolved in version 3.0.1 :tada:

github-actions[bot] commented 1 year ago

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.