Pick and configure a cloud load balancer - either GCP or AWS ELB.
Uses standard Terraform modules downloaded from the Terraform Module Registry:
To use:
- Log into AWS and make sure required AWS Environment Variables are set.
- Make sure you've got required GCP Service Account JSON and Environment Variables set:
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/gce.json
GOOGLE_CLOUD_PROJECT=project-name-goes-here
- cd into the folder:
terraform init
terraform plan && terraform apply
- you've created a GCP load balancer.terraform destroy
- destroy the GCP load balancer.- Comment the GCP variables in lb.tf, uncomment the AWS variables.
- Change
source = "./modules/lb/gcp"
tosource = "./modules/lb/aws"
terraform plan && terraform apply
- you've created an AWS load balancer.terraform destroy
- destroy the AWS load balancer.