0

I've deployed everything except for the following pieces:

# Create a CloudWatch Event Rule to schedule the Glue Job
resource "aws_cloudwatch_event_rule" "glue_job_schedule_rule" {
name                = "glue-job-schedule-rule"
description         = "Rule to schedule Glue Job to run daily at 4 PM CST"
schedule_expression = "cron(0 22 * * ? *)" # 4 PM CST is 10 PM UTC
}

# Create CloudWatch Event Target to trigger the Glue Job
resource "aws_cloudwatch_event_target" "glue_job_schedule_target" {
rule      = aws_cloudwatch_event_rule.glue_job_schedule_rule.name
target_id = "trigger-glue-job"
arn       =  "arn:aws:glue:${var.aws_region}:${data.aws_caller_identity.current.account_id}:job/${var.report_glue_name}"
input = jsonencode({
"JobName" = var.report_glue_name
 })
 }

However, I'm encountering the following error:

Error: creating EventBridge Target (glue-job-schedule-rule-trigger-glue-job): operation error EventBridge: PutTargets, https response error StatusCode: 400, RequestID: 03b0fdd0-251d-4808-be72-ba2a715ec1a2, api error ValidationException: Parameter arn:aws:glue:us-east-1:1234567890:job/missing_recordings_report is not valid. Reason: Provided Arn is not in correct format.

This error occurs at the following line in my main.tf file:

resource "aws_cloudwatch_event_target" "glue_job_schedule_target" {

I've verified that everything else is deployed to aws-qa. Any insights on why the ARN format might be incorrect and how to resolve this issue would be greatly appreciated. Thank you!

What I Tried:

I used Terraform to set up a schedule and trigger for an AWS Glue Job using CloudWatch Event Rule and Event Target.

What I Expected:

I expected everything to be created successfully and the Glue Job to run as scheduled.

What Actually Happened:

I received an error message saying the ARN format for the Glue Job is not valid. The error mentioned a ValidationException and provided details about the incorrect ARN format.

1
  • 2
    arn format looks correct. did you verify in AWS that the job name really exist in the correct account correct region? Commented Mar 12 at 7:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.