【问题标题】:Scheduled AWS Batch Job with EventBridge Not Working使用 EventBridge 的计划 AWS 批处理作业不工作
【发布时间】:2022-07-15 11:54:45
【问题描述】:

我想做什么:

使用 Eventbridge 安排 AWS Batch 作业每天运行。

问题:

我在 Eventbridge 中为工作中的 AWS 批处理作业创建了一条规则。但它没有在预定时间启动。

我能想到的唯一问题是我可能没有正确的角色类型、信任关系和规则策略?提供任何帮助将不胜感激,谢谢!

角色信息

角色用例类型:允许 EC2 实例代表您调用 aws 服务

信任关系

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "ec2.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        },
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "events.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

权限(仅与 EventBridge 相关):AWSBatchServiceEventTargetRole

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "batch:SubmitJob"
            ],
            "Resource": "*"
        }
    ]
}

【问题讨论】:

    标签: aws-event-bridge aws-batch


    【解决方案1】:

    [AWS-User-0570900] 在以下链接中回答的问题: https://repost.aws/questions/QUTY4nNS7jRMir8on3U8Ntwg/scheduled-aws-batch-job-with-event-bridge-not-working

    提供的角色具有以下信任关系:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Service": "events.amazonaws.com"
                },
                "Action": "sts:AssumeRole"
            }
        ]
    }
    

    并遵循政策中的许可:

    {
    
            "Statement": [
                {
                    "Action": [
                        "batch:SubmitJob"
                    ],
                    "Effect": "Allow",
                    "Resource": [
                        "arn:aws:batch:region:account-number:job-definition/our-job-xxxxxxx",
                        "arn:aws:batch:region:account-number:job-definition/our-job-xxxxxxx:*",
                        "arn:aws:batch:region:account-number:job-queue/our-job-xxxxxxx"
                    ]
                }
            ],
            "Version": "2012-10-17"
        }
    

    【讨论】:

      猜你喜欢
      • 2014-11-12
      • 2018-04-30
      • 2019-10-04
      • 2019-01-09
      • 1970-01-01
      • 2022-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多