Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes hashicorp/terraform-provider-google#21950
This PR re-deprecates
enable_flow_logs
and removes its functionality by reverting the expander logic related to it.Testing the config mentioned in this comment: hashicorp/terraform-provider-google#21950 (comment)
gpaste/5824658669305856 shows
enableFlowLogs
andlogConfig.enabled
to be correctly set to true.Unfortunately, GoogleCloudPlatform/magic-modules#13093 also set
log_config
toOptional
+Computed
, which removed its ability to be removed. To fix this, I removeddefault_from_api
but also modified the diffsuppress forlog_config
to check whether or not thelog_config
exists in the user's config. If it does not exist but the deprecatedenable_flow_logs
does, we should suppress the diff so users aren't hit with a breaking change to disable their flow logs.To test this, I applied the following config in 6.27:
Here is the difference when upgrading to versions with the fix w/ and w/o diffsuppress:
Without diffsuppress + enable_flow_logs=true + no log_config:
With diffsuppress
Given the circumstances of the O+C in
log_config
only being present in 6.26-6.27, and the diff suppress, I believe we move forward with removing O+C. There's a possibility that someone created a subnetwork in 6.26 or 6.27, enabled flow logs WITHOUT enable_flow_logs or log_config (maybe outside of Terraform), and upgrading to 6.28 will show a diff to remove flow logs since log_config is not in their configuration and no longer O+C. I believe this should be a very small set and we'd be saving more user pain overall.Derived from GoogleCloudPlatform/magic-modules#13485