Skip to content
Dev.to1 min read

LAB: Terraform EC2 with `user_data`

🎯 Goal Provision an EC2 instance that: Installs Nginx automatically Starts the service Serves a custom web page πŸ‘‰ All using user_data (bootstrapping) πŸ“ Project Structure terraform-userdata-lab/ β”œβ”€β”€ main.tf β”œβ”€β”€ variables.tf β”œβ”€β”€ terraform.tfvars β”œβ”€β”€ providers.tf β”œβ”€β”€ versions.tf β”œβ”€β”€ outputs.tf └── user_data.sh.tpl πŸ“„ versions.tf terraform { required_version = ">= 1.5.0" required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } } πŸ“„ providers.tf provider "aws" { region = var.aws_reg
Read original on dev.to
0
0

Comment

Sign in to join the discussion.

Loading comments…

Related

Get the 10 best reads every Sunday

Curated by AI, voted by readers. Free forever.

Liked this? Start your own feed.

0
0