Skip to content

ashraf-minhaj/GCP-IaCs-with-Terraform

Repository files navigation

GCP-IaCs-with-Terraform

Different Google Cloud Platform resources written with Terraform.


   


List Of Infrastructures:

Configure GCloud CLI for Terraform

  1. set the current project -
gcloud auth list
gcloud config get-value project
gcloud config set project utility-cathode-451011-t4 # project id
  1. Create a service acc [ convention: sa-{short_project_name}-tf-{Environment} ]
gcloud iam service-accounts create sa-mfp-tf-dev --project utility-cathode-451011-t4 --display-name "Terraform dev acc"
  1. Assign role (permission) -
gcloud projects add-iam-policy-binding utility-cathode-451011-t4 --member="serviceAccount:sa-mfp-tf-dev@utility-cathode-451011-t4.iam.gserviceaccount.com" --role="roles/editor"
  1. Download the key -
gcloud iam service-accounts keys create ~/.config/gcloud/utility-cathode-451011-t4.json --iam-account=sa-mfp-tf-dev@utility-cathode-451011-t4.iam.gserviceaccount.com
Ashraf Minhaj
Find me on LinkedIn Ashraf-Minhaj