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

Improve handling when enabling/disabling server TLS policy in global target HTTPS proxies #2703

Conversation

modular-magician
Copy link
Collaborator

This PR implements similar behavior as in GoogleCloudPlatform/magic-modules#11184 but for global target HTTPS proxies.

Prior to this PR, you could enable a server TLS policy on a global HTTPS proxy, but disabling it would not work as removing server_tls_policy removes it from the PATCH payload entirely, so Google simply leaves the server TLS policy as is. What we actually need to do is send serverTlsPolicy = null if it's not set, which is what this PR does.

We're also adding a note about having to add the create_before_destroy = true lifecycle on google_network_security_server_tls_policy as removing the resource would make Terraform destroy the resource first before creating/updating other resources, and that would result in a "resource already in use" error. This lifecycle rule means Terraform will create/update resources (in this case it would update google_compute_target_https_proxy first and remove the association with the google_network_security_server_tls_policy resource) before destroying the resource.

I've updated the tests so that it creates the resources without a server TLS policy, then it adds the server_tls_policy and related resources, and then it removes them again. This is to ensure that we can successfully enable & disable mTLS.

Release Note Template for Downstream PRs (will be copied)

compute: allowed disabling 'server_tls_policy' during update in 'google_compute_target_https_proxy' resources

Derived from GoogleCloudPlatform/magic-modules#11496

…target HTTPS proxies (#11496)

[upstream:55fec567f92fc3725a522d230a141dc13cea9ec9]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician requested a review from a team as a code owner August 22, 2024 23:26
@modular-magician modular-magician requested review from ScottSuarez and removed request for a team August 22, 2024 23:26
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@modular-magician modular-magician merged commit a5f6847 into GoogleCloudPlatform:main Aug 22, 2024
4 of 6 checks passed
@modular-magician modular-magician deleted the downstream-pr-55fec567f92fc3725a522d230a141dc13cea9ec9 branch November 18, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant