Skip to content

Commit

Permalink
[FEAT] terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
ohksj77 committed Mar 16, 2024
1 parent 66a63e7 commit 49f3891
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions terraform/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,6 @@ resource "aws_launch_template" "asg_template" {
name_prefix = "lt-twtw-"
image_id = var.ami
instance_type = "t3a.medium"
}

resource "aws_autoscaling_group" "autoscaling_group" {
name_prefix = "server_launch_config"
min_size = 2
max_size = 4
health_check_type = "ELB"
health_check_grace_period = 100
force_delete = true

launch_template {
id = aws_launch_template.asg_template.id
version = "$Latest"
}

user_data = base64encode(<<-EOF
#!/bin/bash
Expand All @@ -222,6 +208,20 @@ resource "aws_autoscaling_group" "autoscaling_group" {
sudo docker-compose -f docker-compose.prod.yml up -d
EOF
)
}

resource "aws_autoscaling_group" "autoscaling_group" {
name_prefix = "server_launch_config"
min_size = 2
max_size = 4
health_check_type = "ELB"
health_check_grace_period = 100
force_delete = true

launch_template {
id = aws_launch_template.asg_template.id
version = "$Latest"
}

vpc_zone_identifier = [
aws_subnet.private-subnet-a.id,
Expand Down

0 comments on commit 49f3891

Please sign in to comment.