- 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.tf
file in the current directory using the gcloud default values forzone
,region
andproject
run:gcloud alpha resource-config terraform init-provider
To generate a
main.tf
file in the current directory using the user suppplied values forzone
,region
andproject
run:gcloud alpha resource-config terraform init-provider --project="my-project-id" --region="us-central1" --zone="us-central1-c
To generate a
main.tf
file in the current directory using the gcloud defaultbilling_project
run:gcloud alpha resource-config terraform init-provider --use-gcloud-billing-project
To generate a
main.tf
file in the current directory using user specifiedbilling_project
value 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/region
property will be used. --zone
=ZONE
-
Default Google Cloud Zone for Zonal Resources. If not specified the current
compute/zone
property will be used. -
The below flags specify how the optional
user_project_override
andbilling_project
settings 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_override
value in the Terrafom provider config totrue
and setbilling_project
to the current gcloudbilling/quota_project
property. -
Account Override Flags.
--tf-user-project-override
-
If specified, sets the
user_project_override
value 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_project
value 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 help
for 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.
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 2024-02-06 UTC.