Skip to content

pkolbasin/https-github.com-pkolbasin-terraformHW-terraform_hw_1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Practice for Lesson 1

  1. Create service account with permission to create/delete compute instances - Compute Engine Admine role
  • IAM->Service Accounts-> Create Service Account
  • grant role Compute Admin and Network Admin
  • Open Compute Engine default service account and grant newly created service account role - Service Account user
  • Generate Key for S/A and download to your laptop
  1. Update provider.tf file with your project info and location of S/A key

  2. Create google_computer_instance resource using https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#example-usage

  3. run terraform init to initialise project workspace and download terraform plugins

    • Сheck .terraform folder content
  4. Create variables for image, zone, network name , replace hardcoded values with links to variables

    • terraform plan + terraform apply
  5. Add output for ip address re-run terraform plan + terraform apply

  6. destroy environment by running - terraform destroy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 100.0%