Skip to content

Commit a05b488

Browse files
committed
Switch to arm due to amd64 spot unreliability
Signed-off-by: Irving Popovetsky <[email protected]>
1 parent dec0ddc commit a05b488

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

terraform/apps.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ module "pybot_prod" {
200200
logs_group = aws_cloudwatch_log_group.ecslogs.name
201201
ecs_cluster_id = module.ecs.cluster_id
202202
task_execution_role = data.aws_iam_role.ecs_task_execution_role.arn
203-
image_tag = "master"
203+
image_tag = "latest"
204204
}
205205

206206
resource "aws_lb_listener_rule" "pybot_prod" {

terraform/asg.tf

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#ecs-optimized-ami-linux
33
data "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

Comments
 (0)