-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathglue_connection.tf
39 lines (32 loc) · 1.44 KB
/
glue_connection.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
#---------------------------------------------------
# AWS Glue connection
#---------------------------------------------------
resource "aws_glue_connection" "glue_connection" {
count = var.enable_glue_connection ? 1 : 0
name = var.glue_connection_name != "" ? lower(var.glue_connection_name) : "${lower(var.name)}-glue-connection-${lower(var.environment)}"
description = var.glue_connection_description
catalog_id = var.glue_connection_catalog_id
connection_properties = var.glue_connection_connection_properties
connection_type = upper(var.glue_connection_connection_type)
match_criteria = var.glue_connection_match_criteria
dynamic "physical_connection_requirements" {
iterator = physical_connection_requirements
for_each = var.glue_connection_physical_connection_requirements
content {
availability_zone = lookup(physical_connection_requirements.value, "availability_zone", null)
security_group_id_list = lookup(physical_connection_requirements.value, "security_group_id_list", [])
subnet_id = lookup(physical_connection_requirements.value, "subnet_id", null)
}
}
tags = merge(
{
Name = var.glue_connection_name != "" ? lower(var.glue_connection_name) : "${lower(var.name)}-glue-connection-${lower(var.environment)}"
},
var.tags
)
lifecycle {
create_before_destroy = true
ignore_changes = []
}
depends_on = []
}