Skip to content

Commit

Permalink
delete ec2, so it can be rebuilt with new settings
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewsearle01 committed Mar 19, 2024
1 parent 3aca16c commit d176e8f
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions terraform/environments/tribunals/asg-shared.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,35 +127,35 @@ resource "aws_iam_instance_profile" "ec2_instance_profile" {
}

# Create the Launch Template and assign the instance profile
resource "aws_launch_template" "tribunals-all-lt" {
name_prefix = "tribunals-all"
image_id = "ami-0b145c21f0f71b68c"
instance_type = "m5.xlarge"
update_default_version = true

iam_instance_profile {
name = aws_iam_instance_profile.ec2_instance_profile.name
}

block_device_mappings {
device_name = "/dev/sda1"

ebs {
volume_size = 80
volume_type = "gp2"
}
}
ebs_optimized = true

network_interfaces {
device_index = 0
security_groups = [aws_security_group.cluster_ec2.id]#[aws_security_group.tribunals_lb_sc.id]
subnet_id = data.aws_subnet.public_subnets_a.id
delete_on_termination = true
}

user_data = filebase64("ec2-shared-user-data.sh")
}
# resource "aws_launch_template" "tribunals-all-lt" {
# name_prefix = "tribunals-all"
# image_id = "ami-0b145c21f0f71b68c"
# instance_type = "m5.xlarge"
# update_default_version = true

# iam_instance_profile {
# name = aws_iam_instance_profile.ec2_instance_profile.name
# }

# block_device_mappings {
# device_name = "/dev/sda1"

# ebs {
# volume_size = 80
# volume_type = "gp2"
# }
# }
# ebs_optimized = true

# network_interfaces {
# device_index = 0
# security_groups = [aws_security_group.cluster_ec2.id]#[aws_security_group.tribunals_lb_sc.id]
# subnet_id = data.aws_subnet.public_subnets_a.id
# delete_on_termination = true
# }

# user_data = filebase64("ec2-shared-user-data.sh")
# }

# Finally, create the Auto scaling group for the launch template
resource "aws_autoscaling_group" "tribunals-all-asg" {
Expand Down

0 comments on commit d176e8f

Please sign in to comment.