Terraform Basics 4: Automatically Configure Load-Balanced Web Servers

preview_player
Показать описание
In this video we'll use Terraform to provision two more DigitalOcean droplets. One will be another (refactored) web server resource, the other will be our load balancer. We'll use a few Terraform /DigitalOceanfeatures to provision and configure all of this infrastructure automatically:

- Terraform template files and variables to automatically create a haproxy configuration file
- user-data to run configuration scripts on our DigitalOcean droplets at first boot

# TABLE OF CONTENTS
0:19 Configuring Droplets with User-Data
3:32 Provisioning a load balancer
4:45 Terraform Template Files
10:19 Terraform plugins/terraform init

Huge thanks to DigitalOcean for their sponsorship -- they made these videos possible!

Рекомендации по теме
Комментарии
Автор

# TABLE OF CONTENTS
0:19 Configuring Droplets with User-Data
3:32 Provisioning a load balancer
4:45 Terraform Template Files
10:19 Terraform plugins/terraform init

tutoriaLinux
Автор

Wanted to say thank you - you have condensed the learning curve for starting with terraform into something quite reasonable. Really appreciate the effort.

michaelotto
Автор

Thanks for the great tutorial!

For anyone getting `Upload failed: scp: /etc/haproxy/haproxy.cfg: Permission denied`, I added two commands to the first provisioner:
"sudo chmod 777 /etc/haproxy"
"sudo rm /etc/haproxy/haproxy.cfg"

In my case the file provisioner couldn't copy the file there otherwise. Maybe chmod is enough, but it didn't work for me for some reason.

leonholz
Автор

How does terraform plan work when the changes are made directly on the droplet in DO?

mallikadasa
Автор

Is there a way to disable the parallelization? I want to destroy only upon successful provision.

patchshorts
Автор

Great video, can someone explain why user_data comes out as a hash, and not the script like in the video? Thank You

masjxp
Автор

Hey Dave, Awesome video. What happens if another computer is used(other than the one that provisioned the servers) when working with Terraform? Would terraform init be able to detect the current states of web1 and web2?

braunson
Автор

Good contents, However, I am lost :(

simple_akira
Автор

20000 droplets might be a bit much, lol.

-lae