| title | Generate the providers | |||||
|---|---|---|---|---|---|---|
| weight | 110 | |||||
| aliases |
|
After making a change to the Terraform providers for Google Cloud, you must
integrate your changes with the providers. This page explains how to generate
provider changes to the google and google-beta Terraform providers.
- [Set up your development environment]({{< ref "/develop/set-up-dev-environment" >}}).
- Update
magic-modulesas needed. These updates could be any of the following changes:
- [Adding a resource]({{< ref "/develop/add-resource" >}}).
- [Adding a datasource]({{< ref "/develop/add-handwritten-datasource" >}}).
- [Adding custom resource code]({{< ref "/develop/custom-code" >}}).
- [Promoting a resource to GA]({{< ref "/develop/promote-to-ga" >}}).
-
Clone the
googleandgoogle-betaprovider repositories with the following commands:git clone https://github.com/hashicorp/terraform-provider-google.git $GOPATH/src/github.com/hashicorp/terraform-provider-google git clone https://github.com/hashicorp/terraform-provider-google-beta.git $GOPATH/src/github.com/hashicorp/terraform-provider-google-beta
-
Generate changes for the
googleprovider:make provider VERSION=ga OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google" PRODUCT=[PRODUCT_NAME]Where
[PRODUCT_NAME]is one of the folder names in https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/products.For example, if your product is
bigqueryanalyticshub, the command would be the following:make provider VERSION=ga OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google" PRODUCT=bigqueryanalyticshub -
Generate changes for the
google-betaprovider:make provider VERSION=beta OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google-beta" PRODUCT=[PRODUCT_NAME]Where
[PRODUCT_NAME]is one of the folder names in https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/products.For example, if your product name is
bigqueryanalyticshub, the command would be the following:make provider VERSION=beta OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google-beta" PRODUCT=bigqueryanalyticshub -
Confirm that the expected changes were generated:
cd $GOPATH/src/github.com/hashicorp/terraform-provider-google git diff -U0 cd $GOPATH/src/github.com/hashicorp/terraform-provider-google-beta git diff -U0
{{< hint info >}} Note: There may be additional changes present due to specifying a
PRODUCT=value or due to themagic-modulesrepository being out of sync with the provider repositories. {{< /hint >}}
If you are getting “Too many open files” ulimit needs to be raised.
{{< tabs "ulimit" >}} {{< tab "Mac OS" >}}
ulimit -n 8192{{< /tab >}} {{< /tabs >}}
- [Learn how to add resource tests]({{< ref "/test/test" >}})
- [Learn how to run tests]({{< ref "/test/run-tests" >}})
- [Learn about
makecommands]({{< ref "/reference/make-commands" >}})