Skip to content

Commit

Permalink
Move 'Provider-level Labels Rework' below Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
zli82016 committed Aug 15, 2023
1 parent 6f4b581 commit 2a546a7
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,21 @@ terraform {
}
```

## Provider-level Labels Rework
## Provider

### Provider-level Labels Rework

The labels and annotations are key-value pairs attached on Google cloud resources. Cloud labels are used for organizing resources, filtering resources, breaking down billing, and so on. Annotations are used to attach metadata to Kubernetes resources.
Labels and annotations are key-value pairs attached on Google cloud resources. Cloud labels are used for organizing resources, filtering resources, breaking down billing, and so on. Annotations are used to attach metadata to Kubernetes resources.

Not all of Google cloud resources support labels and annotations. Please check the Terraform Google provider resource documentation to figure out if the resource supports the `labels` and `annotations` fields.

### Provider default labels
#### Provider default labels

Default labels configured on the provider through the new `default_labels` field are now supported. The default labels configured on the provider will be applied to all of the resources with the top level `labels` field or the nested `labels` field inside the top level `metadata` field.

Provider-level default annotations are not supported.

### Resource labels
#### Resource labels

The new labels model will be applied to all of the resources with the top level `labels` field or the nested `labels` field inside the top level `metadata` field. Some labels fields are for child resources, so the new model will not be applied to labels fields for child resources.

Expand All @@ -110,18 +112,12 @@ There are now three label-related fields with the new model:

After upgrading to `5.0.0`, and then running `terraform refresh` or `terraform apply`, these three fields should show in the state file of the resources with a self-applying `labels` field.

### Resource annotations
#### Resource annotations

The new annotations model is similar to the new labels model and will be applied to all of the resources with the top level `annotations` field or the nested `annotations` field inside the top level `metadata` field.

There are now two annotation-related fields with the new model, the `annotations` and the output-only `effective_annotations` fields.

## Provider

### Provider-level change example header

Description of the change and how users should adjust their configuration (if needed).

## Datasources

## Datasource: `google_product_datasource`
Expand Down

0 comments on commit 2a546a7

Please sign in to comment.