- Enable Kubernetes Engine API
- Enable Secret Manager API
- GitHub Personal Access Token (Required Scopes: Repository + Workflow)
- DB Password (Using as Cloud SQL password)
- SSH Public/Private Key (Required for ArgoCD)
- Create a service account with enough IAM Role Permission in target GCP Project.
- Generate JSON Service Account Key
- Download, rename to
service_account.json
and place JSON Service Account Key in root folder of this project
Note: Do not push GCP Service Account Key into GitHub Respository
- Generate
.env
file from.env.sample
- Update
GOOGLE_PROJECT
, andGOOGLE_APPLICATION_CREDENTIALS
values
- Create a Google Cloud Storage (GCS) Bucket for Terraform remote state
- Copy
config.gcs.tfbackend.sample
toconfig.gcs.tfbackend
- Update value of
bucket
- Copy
terraform.tfvars.sample
toterraform.tfvars
- Update value of
project_id
- Update value of
region
- Update value of
repo_user_name
(after fork repositories)
- Install
tfenv
: https://github.com/tfutils/tfenv - Install latest Terraform version
Using terraform.sh
script to execute terraform commands
./terraform.sh init
./terraform.sh plan
./terraform.sh apply