-
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
Add default values to aws_vpn_connection #17031
Add default values to aws_vpn_connection #17031
Conversation
This fixes a bug where removing fields from the resource should revert them to their default value, but instead sets them to their empty value (in this case 0). When this happens the provider attempts to use these 0 values to update the VPN connection which results in an error, forcing the user to specify these fields and their default values. Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @shoekstra 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding. Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author. For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000. For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide. |
The data source errors out if there are no connections to return, but should instead return an empty array and let the user decide.
Signed-off-by: Andrea Quintino <andreaquin1990@gmail.com>
Signed-off-by: Andrea Quintino <andreaquin1990@gmail.com>
Signed-off-by: Andrea Quintino <andreaquin1990@gmail.com>
Signed-off-by: Andrea Quintino <andreaquin1990@gmail.com>
Signed-off-by: dirk39 <andreaquin1990@gmail.com>
This reverts commit 068311abc61af4ed43c841ffbce2b70690aec271.
This reverts commit 8d7b56c2e0058c52a14008d5ffdd8fdee46318c4.
…er than DiffSuppressFuncs." This reverts commit af9526c.
…lt tunnel options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccEC2VPNConnection_' PKG_NAME=internal/service/ec2 ACCTEST_PARALLELISM=5
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 5 -run=TestAccEC2VPNConnection_ -timeout 180m
=== RUN TestAccEC2VPNConnection_basic
=== PAUSE TestAccEC2VPNConnection_basic
=== RUN TestAccEC2VPNConnection_transitGatewayID
=== PAUSE TestAccEC2VPNConnection_transitGatewayID
=== RUN TestAccEC2VPNConnection_tunnel1InsideCIDR
=== PAUSE TestAccEC2VPNConnection_tunnel1InsideCIDR
=== RUN TestAccEC2VPNConnection_tunnel1InsideIPv6CIDR
=== PAUSE TestAccEC2VPNConnection_tunnel1InsideIPv6CIDR
=== RUN TestAccEC2VPNConnection_tunnel1PreSharedKey
=== PAUSE TestAccEC2VPNConnection_tunnel1PreSharedKey
=== RUN TestAccEC2VPNConnection_tunnelOptions
=== PAUSE TestAccEC2VPNConnection_tunnelOptions
=== RUN TestAccEC2VPNConnection_tunnelOptionsLesser
=== PAUSE TestAccEC2VPNConnection_tunnelOptionsLesser
=== RUN TestAccEC2VPNConnection_withStaticRoutes
=== PAUSE TestAccEC2VPNConnection_withStaticRoutes
=== RUN TestAccEC2VPNConnection_withEnableAcceleration
=== PAUSE TestAccEC2VPNConnection_withEnableAcceleration
=== RUN TestAccEC2VPNConnection_withIPv6
=== PAUSE TestAccEC2VPNConnection_withIPv6
=== RUN TestAccEC2VPNConnection_tags
=== PAUSE TestAccEC2VPNConnection_tags
=== RUN TestAccEC2VPNConnection_specifyIPv4
=== PAUSE TestAccEC2VPNConnection_specifyIPv4
=== RUN TestAccEC2VPNConnection_specifyIPv6
=== PAUSE TestAccEC2VPNConnection_specifyIPv6
=== RUN TestAccEC2VPNConnection_disappears
=== PAUSE TestAccEC2VPNConnection_disappears
=== RUN TestAccEC2VPNConnection_updateCustomerGatewayID
=== PAUSE TestAccEC2VPNConnection_updateCustomerGatewayID
=== RUN TestAccEC2VPNConnection_updateVPNGatewayID
=== PAUSE TestAccEC2VPNConnection_updateVPNGatewayID
=== RUN TestAccEC2VPNConnection_updateTransitGatewayID
=== PAUSE TestAccEC2VPNConnection_updateTransitGatewayID
=== RUN TestAccEC2VPNConnection_vpnGatewayIDToTransitGatewayID
=== PAUSE TestAccEC2VPNConnection_vpnGatewayIDToTransitGatewayID
=== RUN TestAccEC2VPNConnection_transitGatewayIDToVPNGatewayID
=== PAUSE TestAccEC2VPNConnection_transitGatewayIDToVPNGatewayID
=== CONT TestAccEC2VPNConnection_basic
=== CONT TestAccEC2VPNConnection_tags
=== CONT TestAccEC2VPNConnection_updateVPNGatewayID
=== CONT TestAccEC2VPNConnection_transitGatewayIDToVPNGatewayID
=== CONT TestAccEC2VPNConnection_vpnGatewayIDToTransitGatewayID
--- PASS: TestAccEC2VPNConnection_basic (284.33s)
=== CONT TestAccEC2VPNConnection_updateTransitGatewayID
--- PASS: TestAccEC2VPNConnection_tags (494.43s)
=== CONT TestAccEC2VPNConnection_tunnelOptions
--- PASS: TestAccEC2VPNConnection_updateVPNGatewayID (805.29s)
=== CONT TestAccEC2VPNConnection_withIPv6
--- PASS: TestAccEC2VPNConnection_tunnelOptions (346.44s)
=== CONT TestAccEC2VPNConnection_withEnableAcceleration
--- PASS: TestAccEC2VPNConnection_vpnGatewayIDToTransitGatewayID (1035.74s)
=== CONT TestAccEC2VPNConnection_withStaticRoutes
--- PASS: TestAccEC2VPNConnection_transitGatewayIDToVPNGatewayID (1057.21s)
=== CONT TestAccEC2VPNConnection_tunnelOptionsLesser
--- PASS: TestAccEC2VPNConnection_updateTransitGatewayID (1114.26s)
=== CONT TestAccEC2VPNConnection_disappears
--- PASS: TestAccEC2VPNConnection_withIPv6 (664.43s)
=== CONT TestAccEC2VPNConnection_updateCustomerGatewayID
--- PASS: TestAccEC2VPNConnection_withEnableAcceleration (670.37s)
=== CONT TestAccEC2VPNConnection_tunnel1InsideIPv6CIDR
--- PASS: TestAccEC2VPNConnection_withStaticRoutes (518.36s)
=== CONT TestAccEC2VPNConnection_tunnel1PreSharedKey
--- PASS: TestAccEC2VPNConnection_disappears (365.02s)
=== CONT TestAccEC2VPNConnection_tunnel1InsideCIDR
--- PASS: TestAccEC2VPNConnection_tunnel1PreSharedKey (315.87s)
=== CONT TestAccEC2VPNConnection_transitGatewayID
--- PASS: TestAccEC2VPNConnection_tunnel1InsideCIDR (399.84s)
=== CONT TestAccEC2VPNConnection_specifyIPv6
--- PASS: TestAccEC2VPNConnection_tunnel1InsideIPv6CIDR (662.20s)
=== CONT TestAccEC2VPNConnection_specifyIPv4
--- PASS: TestAccEC2VPNConnection_updateCustomerGatewayID (769.15s)
--- PASS: TestAccEC2VPNConnection_transitGatewayID (612.41s)
--- PASS: TestAccEC2VPNConnection_specifyIPv6 (609.97s)
--- PASS: TestAccEC2VPNConnection_specifyIPv4 (932.94s)
--- PASS: TestAccEC2VPNConnection_tunnelOptionsLesser (2050.05s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 3111.088s
* Add default values to aws_vpn_connection This fixes a bug where removing fields from the resource should revert them to their default value, but instead sets them to their empty value (in this case 0). When this happens the provider attempts to use these 0 values to update the VPN connection which results in an error, forcing the user to specify these fields and their default values. Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
* Add default values to aws_vpn_connection This fixes a bug where removing fields from the resource should revert them to their default value, but instead sets them to their empty value (in this case 0). When this happens the provider attempts to use these 0 values to update the VPN connection which results in an error, forcing the user to specify these fields and their default values. Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
* Add default values to aws_vpn_connection This fixes a bug where removing fields from the resource should revert them to their default value, but instead sets them to their empty value (in this case 0). When this happens the provider attempts to use these 0 values to update the VPN connection which results in an error, forcing the user to specify these fields and their default values. Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
* Add default values to aws_vpn_connection This fixes a bug where removing fields from the resource should revert them to their default value, but instead sets them to their empty value (in this case 0). When this happens the provider attempts to use these 0 values to update the VPN connection which results in an error, forcing the user to specify these fields and their default values. Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
This functionality has been released in v4.0.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 pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Hi,
This PR fixes a bug where removing fields from the resource should revert them to their documented default value, but instead sets them to their null value (in this case 0). When this happens the provider attempts to use these 0 values to update the VPN connection which results in an error, forcing the user to specify these fields and their default values, as demonstrated below:
Plan:
Apply:
Community Note
Release note for CHANGELOG:
Closes: #21317.
Relates #20433.
Relates #22776.