- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
Hello,
At the high level, in Amazon EventBridge, which was formerly called Amazon CloudWatch Events, you create a rule based on your Glue job name, job state, select targets such as send a message to a SNS Topic. When a Glue job run execution time reaches the threshold specified by "Delay notification threshold (minutes)" parameter in the job detail, AWS Glue sends a notification ("Glue Job Run Status") to CloudWatch Events which will match against the rule created earlier.
I have tried and it works on my end. Below is my steps.
- Create a Glue job and specific "Delay notification threshold (minutes)" parameter in the job detail. You can use Python sleep function to control the execution time as following:
import time
#In seconds
time.sleep(100)
print("Printed after 100 seconds.")
- Create a topic and subscribe to it using my email in Amazon SNS Console.
- Create a rule by navigating to Amazon EventBridge Console > Buses > Rules > Create Rule > then create a rule with below properties: Rule type = Rule with an event pattern Creation method = Custom pattern (JSON editor) Pattern example 1: below pattern will match against any job state
{
"source": ["aws.glue"],
"detail-type": ["Glue Job Run Status"],
"detail": {
"jobName": ["<Glue job name>"]
}
}
Pattern example 2: below pattern will match against a specific job state
{
"source": ["aws.glue"],
"detail-type": ["Glue Job Run Status"],
"detail": {
"jobName": ["<Glue job name>"],
"state": ["RUNNING"]
}
}
***Note: - Replace the Glue job name by your job name accordingly - In the example 2, there are valid values for state: STARTING, RUNNING, STOPPING
- Target = SNS Topic > select the topic created in step 2
- Run your Glue job and you should be able to receive the email notification if the job run execution time reaches the threshold specified by "Delay notification threshold (minutes)" parameter.
I hope this helps.
I suggest to create a case with AWS Support if you need further assistance.
Thank you.
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata un anno fa
- Come posso monitorare gli eventi IAM e configurare le notifiche degli eventi con AWS CloudFormation?AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 2 anni fa