gcloud alpha resource-config terraform init-provider

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 amain.tf file in the current directory using thegcloud default values forzone,region andproject run:
gcloudalpharesource-configterraforminit-provider

To generate amain.tf file in the current directory using the usersuppplied values forzone,region andproject run:

gcloudalpharesource-configterraforminit-provider--project="my-project-id"--region="us-central1"--zone="us-central1-c

To generate amain.tf file in the current directory using thegcloud defaultbilling_project run:

gcloudalpharesource-configterraforminit-provider--use-gcloud-billing-project

To generate amain.tf file in the current directory using userspecifiedbilling_project value 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 currentcompute/region property will be used.
--zone=ZONE
Default Google Cloud Zone for Zonal Resources. If not specified the currentcompute/zone property will be used.
The below flags specify how the optionaluser_project_override andbilling_project settings 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 setuser_project_override value in the Terrafomprovider config totrue and setbilling_project to thecurrent gcloudbilling/quota_project property.
Account Override Flags.
--tf-user-project-override
If specified, sets theuser_project_override value 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 thebilling_project value 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 help for 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.