Open WhyNotHugo opened 3 years ago
you can simply change the block:
data "aws_ami" "latest_ecs_ami" {
most_recent = true
filter {
name = "name"
values = ["amzn2-ami-ecs-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["amazon"]
}
to this block:
data "aws_ami" "latest_ecs_ami" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["amzn2-ami-ecs-hvm-*-x86_64-ebs"]
}
}
The image used by default does not match the image recommended by AWS for ECS.
This returns
amzn2-ami-ecs-gpu-hvm-2.0.20210331-x86_64-ebs
:The recommended image, mentioned here, can be obtained with:
The image id is
amzn2-ami-ecs-hvm-2.0.20210331-x86_64-ebs
, and this can be fetched with terraform using: