Skip to content

corentinl/terraform-gcp-example-output-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform basic example #2
Terraform output on Google Cloud Platform

refer to tutorials/terraform/outputs

Execution environment

Save you some time and use your own Google cloud shell environment:

Open in Cloud Shell

Prerequisite

  • Verify that terraform is available on your Cloud shell env
    > terraform --version
  • Have a Google cloud project with billing enabled
  • create manually (through cloud console) a service account that will be used by terraform

Select the project you created in the previous step.
Click "Create Service Account".
Give it any name you like and click "Create".
For the Role, choose "Project -> Editor" (bad practice follow least privilege standard), then click "Continue".
Skip granting additional users access, and click "Done".
After you create your service account, download your service account key.

  • create manually (through cloud console) a json credentials key for your service account

Select your service account from the list.
Select the "Keys" tab.
In the drop down menu, select "Create new key".
Leave the "Key Type" as JSON.
Click "Create" to create the key and save the key file to your system.
You can read more about service account keys in Google's documentation.

Update placeholder with your own data

Within provider.tf replace the following placeholder with your GCP project ID and path to your json service account key.

  • <REPLACE_ME_WITH_SERVICE_ACCOUNT_KEY_PATH>
  • <REPLACE_ME_WITH_GCP_PROJECT_ID>

Lab instructions

Follow instructions in instructions folder of this repository instruction02.md

About

Leverage basic terraform output for GCP resources

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages