-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.tf
61 lines (53 loc) · 1.26 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_vpc" "selected" {
id = var.vpc_id
}
data "aws_subnet" "selected" {
id = var.subnet_id
}
data "aws_ami" "selected" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["amzn2-ami-*"]
}
}
data "http" "relay_auth_key_response" {
url = "https://api.tailscale.com/api/v2/tailnet/${var.tailscale_domain}/keys/${tailscale_tailnet_key.relay_auth.id}"
request_headers = {
Accept = "application/json"
Authorization = "Basic ${local.tailscale_auth_token}"
}
}
data "aws_route_tables" "_subnet_filtered" {
filter {
name = "association.subnet-id"
values = [var.subnet_id]
}
}
data "aws_route_table" "selected" {
route_table_id = (length(data.aws_route_tables._subnet_filtered.ids) > 0
? data.aws_route_tables._subnet_filtered.ids[0]
: data.aws_vpc.selected.main_route_table_id
)
}
data "aws_vpc_peering_connections" "requested_peerings" {
filter {
name = "requester-vpc-info.vpc-id"
values = [var.vpc_id]
}
filter {
name = "status-code"
values = ["active"]
}
}
data "aws_vpc_peering_connections" "accepted_peerings" {
filter {
name = "accepter-vpc-info.vpc-id"
values = [var.vpc_id]
}
filter {
name = "status-code"
values = ["active"]
}
}