Skip to content

Commit

Permalink
added CW logging
Browse files Browse the repository at this point in the history
added CW logging
  • Loading branch information
thulasirajkomminar committed Dec 19, 2023
1 parent e329f20 commit c97de2b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cloudwatch.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "aws_cloudwatch_log_group" "default" {
name = "/aws/glue/jobs/${var.name}"
retention_in_days = var.log_retention_days
}
6 changes: 5 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
resource "aws_glue_job" "default" {
name = var.name
connections = var.connections
default_arguments = var.default_arguments
glue_version = var.glue_version
max_capacity = var.max_capacity
max_retries = var.max_retries
Expand All @@ -16,6 +15,11 @@ resource "aws_glue_job" "default" {
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" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ variable "glue_version" {
description = "The Glue version to use"
}

variable "log_retention_days" {
type = number
description = "The cloudwatch log group retention in days"
default = 90
}

variable "max_capacity" {
type = number
default = null
Expand Down

0 comments on commit c97de2b

Please sign in to comment.