-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmain.tf
34 lines (31 loc) · 928 Bytes
/
main.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
resource "aws_directory_service_directory" "this" {
name = var.name
short_name = var.short_name
password = var.password
size = var.size
type = var.type
alias = var.alias
description = var.description
enable_sso = var.enable_sso
edition = var.edition
tags = var.tags
dynamic "vpc_settings" {
for_each = var.type != "ADConnector" ? ["1"] : []
content {
subnet_ids = var.subnet_ids
vpc_id = data.aws_subnet.this.vpc_id
}
}
dynamic "connect_settings" {
for_each = var.type == "ADConnector" ? [var.connect_settings] : []
content {
customer_dns_ips = connect_settings.value.customer_dns_ips
customer_username = connect_settings.value.customer_username
subnet_ids = var.subnet_ids
vpc_id = data.aws_subnet.this.vpc_id
}
}
}
data "aws_subnet" "this" {
id = var.subnet_ids[0]
}