Skip to content

This is sample of how to deploy a simple web server that is serving behind a load balancer using Terraform to staging or production environment in GCP.

Notifications You must be signed in to change notification settings

abdulaziz-git/terraform-deploy-web-lb-staging-prod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform deploy webserver LB to staging and production

This is sample of how to deploy a simple web server that is serving behind a load balancer using Terraform to staging or production environment in GCP.

Authentication to GCP

gcloud auth application-default login

Running terraform

terraform init
  • Create terraform workspace for staging and production
terraform workspace new staging
terraform workspace new production
  • Deploy to staging
terraform workspace select staging
terraform plan -var-file=environments/staging/staging.tfvars
terraform apply -var-file=environments/staging/staging.tfvars
  • Deploy to production
terraform workspace select production
terraform plan -var-file=environments/production/production.tfvars
terraform apply -var-file=environments/production/production.tfvars

Reference

About

This is sample of how to deploy a simple web server that is serving behind a load balancer using Terraform to staging or production environment in GCP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages