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

azurerm_virtual_network_gateway_connection: fix accTest for WithoutSharedKey #20405

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

wuxu92
Copy link
Contributor

@wuxu92 wuxu92 commented Feb 10, 2023

The Server will response with a shared_key field with content even not provided in PUT request. so mark it as computed.

Current errror:

------- Stdout: -------
=== RUN   TestAccVirtualNetworkGatewayConnection_sitetositeWithoutSharedKey
=== PAUSE TestAccVirtualNetworkGatewayConnection_sitetositeWithoutSharedKey
=== CONT  TestAccVirtualNetworkGatewayConnection_sitetositeWithoutSharedKey
testcase.go:110: Step 1/2 error: After applying this test step, the plan was not empty.
stdout:
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# azurerm_virtual_network_gateway_connection.test will be updated in-place
~ resource "azurerm_virtual_network_gateway_connection" "test" {
id                                 = "/subscriptions/*******/resourceGroups/acctestRG-230209073430076333/providers/Microsoft.Network/connections/acctest-230209073430076333"
name                               = "acctest-230209073430076333"
- shared_key                         = (sensitive value)
# (13 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccVirtualNetworkGatewayConnection_sitetositeWithoutSharedKey (4076.87s)
FAIL

TC PASS

image

@wuxu92 wuxu92 marked this pull request as ready for review February 13, 2023 07:03
@tombuildsstuff
Copy link
Contributor

@wuxu92 from memory this is intentionally marked as not-computed as this is a security related setting we want users to be aware of - so that users can either use the default (and ignore the default value via ignore_changes) or explicitly specify a shared key here.

What's the use-case for making this Computed?

@wuxu92
Copy link
Contributor Author

wuxu92 commented Feb 13, 2023

thanks for your explanation! I'm fixing the failed AccTest and meet this. I think there isn't such use case except the AccTest itself.

@wuxu92 wuxu92 changed the title azurerm_virtual_network_gateway_connection: update share_key as computed azurerm_virtual_network_gateway_connection: fix accTest for WithoutSharedKey Feb 14, 2023
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@tombuildsstuff tombuildsstuff added this to the v3.44.0 milestone Feb 14, 2023
@tombuildsstuff tombuildsstuff merged commit a21c9fb into hashicorp:main Feb 14, 2023
@github-actions
Copy link

This functionality has been released in v3.44.0 of the Terraform 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!

@github-actions
Copy link

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants