- NAME
-
- gcloud alpha resource-config terraform init-provider - generate main.tf file to configure Google Cloud Terraform Provider
- SYNOPSIS
-
-
gcloud alpha resource-config terraform init-provider[--region=REGION] [--zone=ZONE] [--use-gcloud-billing-project| [--tf-user-project-override:--tf-billing-project=TF_BILLING_PROJECT]] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(ALPHA)Generate main.tf file to configure Google Cloud Terraform Provider.This command supports Google Terraform Provider version v3.90.0+ and Terraform Provider Schema 0.2
- EXAMPLES
-
To generate a
main.tffile in the current directory using the gcloud default values forzone,regionandprojectrun:gcloud alpha resource-config terraform init-providerTo generate a
main.tffile in the current directory using the user suppplied values forzone,regionandprojectrun:gcloud alpha resource-config terraform init-provider --project="my-project-id" --region="us-central1" --zone="us-central1-cTo generate a
main.tffile in the current directory using the gcloud defaultbilling_projectrun:gcloud alpha resource-config terraform init-provider --use-gcloud-billing-projectTo generate a
main.tffile in the current directory using user specifiedbilling_projectvalue run:gcloud alpha resource-config terraform init-provider --tf-user-project-override --tf-billing-project="my-other-project-id" - FLAGS
-
--region=REGION-
Default Google Cloud Region for Regional Resources. If not specified the current
compute/regionproperty will be used. --zone=ZONE-
Default Google Cloud Zone for Zonal Resources. If not specified the current
compute/zoneproperty will be used. -
The below flags specify how the optional
user_project_overrideandbilling_projectsettings are configured for the Google Terraform Provider. See the Google Terraform Provider Config Reference for more details.At most one of these can be specified:
--use-gcloud-billing-project-
If specified, will set
user_project_overridevalue in the Terrafom provider config totrueand setbilling_projectto the current gcloudbilling/quota_projectproperty. -
Account Override Flags.
--tf-user-project-override-
If specified, sets the
user_project_overridevalue in the Terraform provider config totrue.This flag argument must be specified if any of the other arguments in this group are specified.
--tf-billing-project=TF_BILLING_PROJECT-
If specified, sets the
billing_projectvalue in the Terraform provider config.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - NOTES
- This command is currently in alpha and might change without notice. If this command fails with API permission errors despite specifying the correct project, you might be trying to access an API with an invitation-only early access allowlist.
gcloud alpha resource-config terraform init-provider
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.