-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.tf
36 lines (32 loc) · 1.1 KB
/
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
35
36
resource "aws_glue_job" "default" {
name = var.name
connections = var.connections
glue_version = var.glue_version
max_capacity = var.max_capacity
max_retries = var.max_retries
number_of_workers = var.number_of_workers
role_arn = var.role_arn != null ? var.role_arn : aws_iam_role.default[0].arn
security_configuration = var.security_configuration
worker_type = var.worker_type
tags = var.tags
command {
name = var.command_name
python_version = var.python_version
script_location = var.script_location
}
default_arguments = merge({
"--continuous-log-logGroup" : aws_cloudwatch_log_group.default.name,
"--enable-continuous-cloudwatch-log" : "true",
}, var.default_arguments)
}
resource "aws_glue_trigger" "default" {
count = var.trigger_type != null ? 1 : 0
name = var.name
enabled = var.schedule_active
schedule = var.schedule
type = var.trigger_type
tags = var.tags
actions {
job_name = aws_glue_job.default.name
}
}