11
22# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#ecs-optimized-ami-linux
33data "aws_ssm_parameter" "ecs_optimized_ami" {
4- name = " /aws/service/ecs/optimized-ami/amazon-linux-2023/recommended"
4+ # name = "/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended"
5+ name = " /aws/service/ecs/optimized-ami/amazon-linux-2023/arm64/recommended"
56}
67
78# https://registry.terraform.io/modules/terraform-aws-modules/autoscaling/aws/latest
@@ -10,7 +11,7 @@ module "autoscaling" {
1011 version = " ~> 6.5"
1112
1213 name = " ${ local . name } -spot"
13- min_size = 1
14+ min_size = 2
1415 max_size = 4
1516 desired_capacity = 2
1617
@@ -27,22 +28,34 @@ module "autoscaling" {
2728
2829 override = [
2930 {
30- instance_type = " t3.small"
31- weighted_capacity = " 2"
32- },
33- {
34- instance_type = " t3a.small"
35- weighted_capacity = " 2"
36- },
37- {
38- instance_type = " t3.micro"
31+ instance_type = " t4g.small"
3932 weighted_capacity = " 1"
4033 },
4134 {
42- instance_type = " t3a .micro"
35+ instance_type = " t4g .micro"
4336 weighted_capacity = " 1"
4437 }
4538 ]
39+
40+ # amd64 options
41+ # override = [
42+ # {
43+ # instance_type = "t3.small"
44+ # weighted_capacity = "2"
45+ # },
46+ # {
47+ # instance_type = "t3a.small"
48+ # weighted_capacity = "2"
49+ # },
50+ # {
51+ # instance_type = "t3.micro"
52+ # weighted_capacity = "1"
53+ # },
54+ # {
55+ # instance_type = "t3a.micro"
56+ # weighted_capacity = "1"
57+ # }
58+ # ]
4659 }
4760
4861 image_id = jsondecode (data. aws_ssm_parameter . ecs_optimized_ami . value )[" image_id" ]
0 commit comments