[フレーム]
BT

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

We protect your privacy.

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In
or

Don't have an InfoQ account?

Register
  • Stay updated on topics and peers that matter to youReceive instant alerts on the latest insights and trends.
  • Quickly access free resources for continuous learningMinibooks, videos with transcripts, and training materials.
  • Save articles and read at anytimeBookmark articles to read whenever youre ready.

Topics

Choose your language

InfoQ Homepage News Terraform Google Provider 6.0: Automatic Labeling, Extended Naming Flexibility, and More

Terraform Google Provider 6.0: Automatic Labeling, Extended Naming Flexibility, and More

This item in japanese

Sep 25, 2024 2 min read

Write for InfoQ

Feed your curiosity. Help 550k+ global
senior developers
each month stay ahead.
Get in touch

HashiCorp released version 6.0 of the Terraform Google provider, delivering key updates to improve cloud infrastructure management and developer workflows. The release introduces automatic labeling for Terraform-created resources, expanded naming flexibility, and removal of deprecated features. It also simplifies handling Google IDs and IAM binding for external resources.

Google and HashiCorp are collaborating to develop new integrations that focus on improving cloud infrastructure deployment and enhancing the developer experience. This year, the companies prioritized community feedback, incorporating highly requested features into the Google Cloud provider to address evolving user needs.

In version 5.16.0 of the Google provider, a new goog-terraform-provisioned = true label was introduced, allowing users to easily identify resources created by Terraform when using other tools like gcloud or the GCP console. Initially, this label had to be manually enabled. However, with the release of version 6.0, the label is now automatically applied to all newly created resources by default. This behavior can be turned off through the provider configuration if needed. Users who prefer not to use the default label can disable it by setting the add_terraform_attribution_label option to false in the provider block configuration:

provider "google" {
 add_terraform_attribution_label = false
}

Furthermore, Terraform 1.8 added support for custom provider functions, allowing them to be called within Terraform configurations. Earlier this year, the Google Cloud provider introduced provider-defined functions, enabling users to easily retrieve regions, zones, names, and projects from resource IDs not managed by Terraform. These functions now also support parsing Google IDs when adding IAM bindings to resources managed outside of Terraform, simplifying the process further:

resource "google_cloud_run_service_iam_member" "example_run_invoker" {
 member  = "user:jan.kowalski@mail.com"
 role   = "run.invoker"
 service = provider::google::name_from_id(var.cloud_run_service_id)
 location = provider::google::location_from_id(var.cloud_run_service_id)
 project = provider::google::project_from_id(var.cloud_run_service_id)
}

The version 6.0 release addresses an issue reported by Riccardo Albertazzi regarding the default behavior for name_prefix in multiple resources. The maximum length for user-defined name_prefix has been increased from 37 to 54 characters. For prefixes longer than 37 characters, the provider will now append a shorter suffix, providing flexibility for resource naming.

In version 6.0, the Terraform Google provider has removed various deprecated resources and properties that were either renamed or are no longer supported by Google. This major release addresses the accumulation of outdated elements over time. A complete list of behavior changes and removed properties can be found in the Google Provider 6.0 upgrade guide.

About the Author

Robert Krzaczyński

Show moreShow less

Rate this Article

Adoption
Style

This content is in the DevOps topic

Related Topics:

Related Content

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

BT

AltStyle によって変換されたページ (->オリジナル) /