-
-
Notifications
You must be signed in to change notification settings - Fork 330
/
Copy pathdata.tf
61 lines (45 loc) · 1.34 KB
/
data.tf
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
49
50
51
52
53
54
55
56
57
58
59
60
61
data "aws_caller_identity" "current" {}
data "aws_partition" "current" {}
data "aws_region" "current" {}
data "aws_subnet" "runners" {
id = var.subnet_id
}
data "aws_availability_zone" "runners" {
name = data.aws_subnet.runners.availability_zone
}
data "aws_ami" "runner_by_filter" {
count = length(var.runner_ami_id) > 0 ? 0 : 1
owners = var.runner_ami_owners
most_recent = "true"
dynamic "filter" {
for_each = var.runner_ami_filter
content {
name = filter.key
values = filter.value
}
}
}
data "aws_ami" "docker_machine_by_filter" {
count = var.runner_worker.type == "docker+machine" && length(var.runner_worker_docker_machine_ami_id) == 0 ? 1 : 0
owners = var.runner_worker_docker_machine_ami_owners
most_recent = "true"
dynamic "filter" {
for_each = var.runner_worker_docker_machine_ami_filter
content {
name = filter.key
values = filter.value
}
}
}
data "aws_ami" "docker_autoscaler_by_filter" {
count = var.runner_worker.type == "docker-autoscaler" && length(var.runner_worker_docker_autoscaler_ami_id) == 0 ? 1 : 0
owners = var.runner_worker_docker_autoscaler_ami_owners
most_recent = "true"
dynamic "filter" {
for_each = var.runner_worker_docker_autoscaler_ami_filter
content {
name = filter.key
values = filter.value
}
}
}