Skip to content

Code example for RollingUpdate with Terraform and Packer

Notifications You must be signed in to change notification settings

souzaxx/Rolling-Update-Terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rolling Update with Terraform

This code is just a representation on how you could apply rolling update to yours EC2 instances. Do not use it in production.

terraform --version
Terraform v0.13.1

packer --version
1.6.0

Instructions:

Create the first image

cd packer
packer build .

Apply the terraform

cd ..
terraform init
terraform apply

Check the current color of the page

In another terminal:

while true; do
curl $(terraform output lb_dns)
sleep 1
done

Create another image with a different color

cd packer
packer build -var 'color=blue' .

Apply the new image version

cd ..
terraform apply

Clean up

terraform destroy

Deregister AMI from the console.

About

Code example for RollingUpdate with Terraform and Packer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published