-
Notifications
You must be signed in to change notification settings - Fork 1
/
_data.tf
35 lines (26 loc) · 895 Bytes
/
_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
data "aws_organizations_organization" "default" {}
data "aws_ec2_transit_gateway" "default" {
count = try(var.attachment, false) ? 1 : 0
filter {
name = "owner-id"
values = [var.transit_gateway_account_id]
}
}
data "aws_dx_connection" "default" {
for_each = {
for dx_connection in var.dx_connection : dx_connection.name => dx_connection
}
name = each.value.name
}
data "aws_ec2_transit_gateway_dx_gateway_attachment" "default" {
count = length(try(var.dx_connection, [])) > 0 ? 1 : 0
transit_gateway_id = aws_ec2_transit_gateway.default[0].id
dx_gateway_id = aws_dx_gateway.default[0].id
}
data "aws_ssm_parameter" "bgp_auth_key" {
for_each = {
for dx_connection in var.dx_connection : dx_connection.name => dx_connection
}
name = "/dx/transit-vif/${var.account_name}/${each.value.name}/bgp_auth_key"
with_decryption = true
}