-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdata.tf
More file actions
48 lines (45 loc) · 1.55 KB
/
data.tf
File metadata and controls
48 lines (45 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# we extract the IAM username by getting the caller identity as an ARN
# then extracting the resource protion, which gives something like
# user/travis.downs, and finally we strip the user/ part to use as a tag
data "aws_caller_identity" "current" {}
data "aws_arn" "caller_arn" {
arn = data.aws_caller_identity.current.arn
}
data "aws_ami" "ami" {
most_recent = true
filter {
name = "name"
values = [
"ubuntu/images/hvm-ssd/ubuntu-*-amd64-server-*",
"ubuntu/images/hvm-ssd/ubuntu-*-arm64-server-*",
"Fedora-Cloud-Base-AmazonEC2.x86_64-*",
"Fedora-Cloud-Base-AmazonEC2.aarch64-*",
"Fedora-Cloud-Base-*.x86_64-hvm-${var.aws_region}-gp2-0",
"Fedora-Cloud-Base-*.aarch64-hvm-${var.aws_region}-gp2-0",
"Fedora-Cloud-Base-*.x86_64-hvm-${var.aws_region}-gp3-0",
"Fedora-Cloud-Base-*.aarch64-hvm-${var.aws_region}-gp3-0",
"Fedora-Cloud-Base-*.aarch64-hvm-${var.aws_region}-standard",
"debian-*-amd64-*",
"amzn2-ami-hvm-2.0.*-x86_64-gp2",
"RHEL*HVM-*-x86_64*Hourly2-GP2",
"debian-*-hvm-x86_64-gp3-*",
"amzn2-ami-hvm-2.0.*-x86_64-gp3",
"RHEL*HVM-*-x86_64*Hourly2-GP3",
"al2023-ami-2023.*-kernel-*-x86_64"
]
}
filter {
name = "architecture"
values = [var.machine_architecture]
}
filter {
name = "name"
values = ["*${var.distro}*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["099720109477", "125523088429", "136693071363", "137112412989", "309956199498"]
# Canonical, Fedora, Debian (new), Amazon, RedHat
}