gcloud alpha resource-config terraform init-provider Stay organized with collections Save and categorize content based on your preferences.
- 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 TerraformProvider.ThiscommandsupportsGoogleTerraformProviderversionv3.90.0+andTerraformProviderSchema0.2
- EXAMPLES
- To generate a
main.tffile in the current directory using thegcloud default values forzone,regionandprojectrun:gcloudalpharesource-configterraforminit-providerTo generate a
main.tffile in the current directory using the usersuppplied values forzone,regionandprojectrun:gcloudalpharesource-configterraforminit-provider--project="my-project-id"--region="us-central1"--zone="us-central1-cTo generate a
main.tffile in the current directory using thegcloud defaultbilling_projectrun:gcloudalpharesource-configterraforminit-provider--use-gcloud-billing-projectTo generate a
main.tffile in the current directory using userspecifiedbilling_projectvalue run:gcloudalpharesource-configterraforminit-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 TerraformProvider. See theGoogleTerraform 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 Terrafomprovider config totrueand setbilling_projectto thecurrent gcloudbilling/quota_projectproperty. - Account Override Flags.
--tf-user-project-override- If specified, sets the
user_project_overridevalue in the Terraformprovider config totrue.This flag argument must be specified if any of the other arguments in this groupare specified.
--tf-billing-project=TF_BILLING_PROJECT- If specified, sets the
billing_projectvalue in the Terraformprovider 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 thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.