Set up your development environment #
Before you start adding or updating a Terraform resource using magic-modules, you must first set up your environment by installing the necessary tools. This page explains the steps for setting up your development environment.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don’t already have a project to use for testing changes to the Terraform providers, create a project instead of selecting an existing poject. After you finish these steps, you can delete the project, removing all resources associated with the project.
Go to project selectorMake sure that billing is enabled for your Google Cloud project. Learn how to check if billing is enabled on a project.
Add the following values to your environment settings such as
.bashrc
:# Add GOPATH variable for convenience export GOPATH=$(go env GOPATH) # Add Go binaries to PATH export PATH=$PATH:$(go env GOPATH)/bin
Install goimports
go install golang.org/x/tools/cmd/goimports@latest
Clone the
magic-modules
repositorycd ~ git clone https://github.com/GoogleCloudPlatform/magic-modules.git
Run the following command from the root of your cloned
magic-modules
repository.cd magic-modules ./scripts/doctor
Expected output if everything is installed properly:
Check for go in path... found! Check for goimports in path... found! Check for git in path... found! Check for terraform in path... found! Check for make in path... found!