2018-05-09 07:38:05 +02:00
|
|
|
locals {
|
2020-09-25 04:55:32 +02:00
|
|
|
# Pick a Flatcar Linux AMI
|
2018-05-09 07:38:05 +02:00
|
|
|
# flatcar-stable -> Flatcar Linux AMI
|
2022-01-14 18:59:11 +01:00
|
|
|
ami_id = var.arch == "arm64" ? data.aws_ami.flatcar-arm64[0].image_id : data.aws_ami.flatcar.image_id
|
2019-12-28 21:07:10 +01:00
|
|
|
channel = split("-", var.os_image)[1]
|
2018-05-09 07:38:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
data "aws_ami" "flatcar" {
|
|
|
|
most_recent = true
|
|
|
|
owners = ["075585003325"]
|
|
|
|
|
|
|
|
filter {
|
|
|
|
name = "architecture"
|
|
|
|
values = ["x86_64"]
|
|
|
|
}
|
|
|
|
|
|
|
|
filter {
|
|
|
|
name = "virtualization-type"
|
|
|
|
values = ["hvm"]
|
|
|
|
}
|
|
|
|
|
|
|
|
filter {
|
|
|
|
name = "name"
|
2020-09-25 04:55:32 +02:00
|
|
|
values = ["Flatcar-${local.channel}-*"]
|
2017-09-18 06:40:33 +02:00
|
|
|
}
|
|
|
|
}
|
2019-05-28 05:42:48 +02:00
|
|
|
|
2022-01-14 18:59:11 +01:00
|
|
|
data "aws_ami" "flatcar-arm64" {
|
|
|
|
count = var.arch == "arm64" ? 1 : 0
|
|
|
|
|
|
|
|
most_recent = true
|
|
|
|
owners = ["075585003325"]
|
|
|
|
|
|
|
|
filter {
|
|
|
|
name = "architecture"
|
|
|
|
values = ["arm64"]
|
|
|
|
}
|
|
|
|
|
|
|
|
filter {
|
|
|
|
name = "virtualization-type"
|
|
|
|
values = ["hvm"]
|
|
|
|
}
|
|
|
|
|
|
|
|
filter {
|
|
|
|
name = "name"
|
|
|
|
values = ["Flatcar-${local.channel}-*"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|