Generate the providers

Generate google and google-beta providers #

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.

Before you begin #

  1. Set up your development environment.
  2. Update magic-modules as needed. These updates could be any of the following changes:

By default, running a full make provider command cleans the output directory (OUTPUT_PATH) before generating code to prevent sync issues. This will override and delete any changes to that directory. See the make commands reference for details on advanced usage.

Generate a provider change #

  1. Clone the google and google-beta provider 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
    
  2. Generate changes for the google provider:

    make provider VERSION=ga OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google"
    
  3. Generate changes for the google-beta provider:

    make provider VERSION=beta OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google-beta"
    
  4. 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
    
    Note: You might see additional changes in your git diff output beyond your own. This can happen if your magic-modules repository is out of sync with the provider repositories, causing the generator to also apply any pending updates from magic-modules.

Troubleshoot #

Too many open files #

If you are getting “Too many open files” ulimit needs to be raised.

ulimit -n 8192

What’s next #