Skip to content

Instantly share code, notes, and snippets.

@IronCore864
Created November 19, 2022 07:50
Show Gist options
  • Save IronCore864/b4d5573a1f79d6bb157a6809e978e5f4 to your computer and use it in GitHub Desktop.
Save IronCore864/b4d5573a1f79d6bb157a6809e978e5f4 to your computer and use it in GitHub Desktop.
provider "aws" {
region = "us-west-1"
}
resource "aws_instance" "web" {
instance_type = "t2.micro"
ami = "ami-09b4b74c"
}
resource "aws_autoscaling_group" "my_asg" {
availability_zones = ["us-west-1a"]
name = "my_asg"
max_size = 5
min_size = 1
health_check_grace_period = 300
health_check_type = "ELB"
desired_capacity = 4
force_delete = true
launch_configuration = "my_web_config"
}
resource "aws_launch_configuration" "my_web_config" {
name = "my_web_config"
image_id = "ami-09b4b74c"
instance_type = "t2.micro"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment