Add an optional provider level label "goog-terraform-provisioned" #17170
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.
The intention of this change is to make it easy to identify GCP resources that are managed by Terraform when using other clients like Cloud Console. Overall, this builds on and behaves much the same as provider default labels from #8670, but instead of free form labels it adds a single specific structured label,
goog-terraform-provisioned = "true"
when enabled. That is:Is roughly equivalent to:
The change is documented in
provider_reference.html.markdown
. In short, this is a no-op change for users that do not opt in to the feature. For users that do opt in (by settingskip_terraform_attribution_label = false
in the provider configuration), there are two modes of operation configured with the optionalterraform_attribution_label_addition_strategy
field:goog-terraform-provisioned
label will only be added to newly created resources. This is the default value.terraform apply
runs.Tests are included for a handful of resources, including MMv1, DCL, and handwritten resources.
I'm creating this as a draft PR to gather early feedback (and because as I'm writing this description I thought of some tests changes to make 🤔)
Release Note Template for Downstream PRs (will be copied)
Derived from GoogleCloudPlatform/magic-modules#9808