AWS Glue作业持续运行

huangapple go评论60阅读模式
英文:

AWS Glue Job Run continuously

问题

有没有任何替代方案?

英文:

I want to run a Glue ETL job continuously (i.e. start automatically when previous execution of the same job finishes)

a cron trigger won't help because job doesn't always take the same time to finish.

Is there any alternative?

答案1

得分: 1

你应该能够创建一个 Lambda 函数,实现以下功能:

  1. 在 Lambda 函数体内运行 Glue 作业,代码看起来会像这样:

    import boto3 
    
    client = boto3.client('glue') 
    jobname = 'your glue job'
    response = client.start_job_run(JobName=jobname)
    
  2. 当 Glue 作业成功运行时触发 Lambda 函数(通过一个 EventBridge 触发器,监视相关 Glue 作业的状态变化)

请参考以下文档:使用 CloudWatch 事件自动化 AWS Glue

如果有帮助,请告诉我!

英文:

You should be able to create a lambda function that:

  1. Runs the glue job (in the body of the lambda). That would look something like this:

    import boto3 
    
    client = boto3.client('glue') 
    jobname = 'your glue job'
    response = client.start_job_run(JobName=jobname)
    
  2. Is triggered when the glue job runs successfully (with an eventbridge trigger that looks at the glue job state change for the relevant glue job(s))

Refer to these docs: Automating AWS Glue with CloudWatch Events

Let me know if this helps!

huangapple
  • 本文由 发表于 2023年6月14日 23:51:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76475403.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定