Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 925 Bytes

Readme.md

File metadata and controls

33 lines (20 loc) · 925 Bytes

Google Cloud Engine with Terraform

This project describe how to manage Google Cloud Engine infrastructure with Terraform.

For the moment there two examples:

  • A network with a compute instance (nginx inside) and a firewall which allows to 80 and 22 ports.
  • A GKE cluster with 2 nodes

Deployment

Firstly you need to get and your Service Account ( here ) and put your key in the parent folder of your project with the name key.json

Next, you need to export some environment variables

export GOOGLE_PROJECT="<your_project_id>"
export GOOGLE_CLOUD_KEYFILE_JSON=$(cat <your_exported_key_as_json)

Go to the example that you want to instanciate and do : terraform plan or terraform apply

If you want to customize some variables. Create a file terraform.tfvars

region="<region_name>"
...

Enjoy !