Skip to content

Commit

Permalink
destroy ec2
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewsearle01 committed Apr 9, 2024
1 parent 67bcdac commit 4dfe052
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions terraform/environments/tribunals/asg-shared.tf
Original file line number Diff line number Diff line change
Expand Up @@ -150,51 +150,51 @@ 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
}

key_name = "ec2-dev-connect"

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]
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
# }

# key_name = "ec2-dev-connect"

# 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]
# 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" {
vpc_zone_identifier = [data.aws_subnet.private_subnets_a.id]
desired_capacity = 1
max_size = 1
min_size = 1
name = local.app_name

launch_template {
id = "${aws_launch_template.tribunals-all-lt.id}"
version = "$Latest"
}
}
# resource "aws_autoscaling_group" "tribunals-all-asg" {
# vpc_zone_identifier = [data.aws_subnet.private_subnets_a.id]
# desired_capacity = 1
# max_size = 1
# min_size = 1
# name = local.app_name

# launch_template {
# id = "${aws_launch_template.tribunals-all-lt.id}"
# version = "$Latest"
# }
# }

###########################################################################

Expand Down

0 comments on commit 4dfe052

Please sign in to comment.