Understanding Terraform meta-arguments
Meta-arguments are special constructs in Terraform. You already encountered the provider
meta-argument, but let’s look closely at it and other meta-arguments.
The provider meta-argument
Note
The code for this section is under chap02/provider
in the GitHub repo of this book.
We introduced the provider
meta-argument in the first chapter. Technically speaking, a provider is a plugin that communicates with the external API—in our case, the Google Cloud API. As mentioned, there are actually two providers for Google Cloud: google
and google-beta
. The latter provides the interface to the Google Beta API while the former provides the interface to the API that is in General Availability (GA). You can use both providers in your configuration code, and specify which provider you want to use for a resource:
chap02/provider/provider.tf
… provider "google" { project = var.project_id region...