Hi Team
I have been working on creating schedules for DMS replication tasks and glue jobs through TF scripts. While doing so, I am facing “Validation error”, if I try to create the schedules by passing the target arn directly in the target block of the aws_schedules_schedule.
Can anyone please help me or clarify if TF supports the triggers without using Lambda function or do we need to have the Lambda for DMS replication tasks and Glue jobs.
Here is the error:
CreateSchedule, https response error StatusCode: 400, RequestID: cc9a66d1-1490-4b5e-ae1e-de3f1cf3781d, ValidationException: glue is not a supported service for a target.
Below is the code snippet:
resource “aws_scheduler_schedule” “glue_schedulers” {
for_each = { for t in var.aws_glue_jobs : t.name => t }
name = each.value.name
group_name = aws_scheduler_schedule_group.dms_schedule_group.name
schedule_expression = each.value.schedule_expression
schedule_expression_timezone = var.aws_schedule_time_zone
state = each.value.state
flexible_time_window {
mode = “OFF”
}
target {
arn = “arn:aws:glue:{var.aws_region}:{var.aws_account_id}:job/${each.value.glue_job_name}”
role_arn = aws_iam_role.eventbridge_dms_role.arn
retry_policy {
maximum_event_age_in_seconds = each.value.maximum_event_age_in_seconds
maximum_retry_attempts = each.value.maximum_retry_attempts
}
input = jsonencode({
Arguments = {
“–CONFIG_S3_PATH” = each.value.arguments
}
})
}
}