You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

通过Serverless框架创建EventBridge集成报错:EventBridge-PutEvents不被支持

解决ApiGateway V2集成EventBridge时的「EventBridge-PutEvents is not supported」错误

问题原因

出现该错误的核心原因是负载格式版本配置错误。ApiGateway V2与EventBridge的PutEvents集成要求使用2.0版本的负载格式,而你当前配置的1.0版本不支持该集成子类型。

修正后的配置

将PayloadFormatVersion改为2.0,修正后的完整配置如下:

# Create event bridge integration
EventBridgeIntegration:
  DependsOn:
    - HttpApiRole
  Type: AWS::ApiGatewayV2::Integration
  Properties:
    ApiId: !Ref HttpApi
    Description: Event Bridge integration
    IntegrationType: AWS_PROXY
    IntegrationSubtype: EventBridge-PutEvents        
    PayloadFormatVersion: 2.0  # 关键修改:将版本改为2.0
    CredentialsArn: !GetAtt HttpApiRole.Arn
    RequestParameters:
      Detail: $request.body.detail
      DetailType: $request.body.action
      Source: $request.body.source
      EventBusName: !GetAtt EventBus.Name

IAM角色权限验证

同时需确保你的HttpApiRole拥有events:PutEvents权限,示例权限配置参考:

HttpApiRole:
  Type: AWS::IAM::Role
  Properties:
    AssumeRolePolicyDocument:
      Version: '2012-10-17'
      Statement:
        - Effect: Allow
          Principal:
            Service: apigateway.amazonaws.com
          Action: sts:AssumeRole
    Policies:
      - PolicyName: EventBridgePutEventsPolicy
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Action: events:PutEvents
              Resource: !GetAtt EventBus.Arn

额外检查点

  • 确保使用的Serverless框架版本支持ApiGateway V2的EventBridge集成(建议升级至最新稳定版)
  • 确认AWS账号所在区域支持ApiGateway与EventBridge的直接集成(主流区域均已支持)

内容的提问来源于stack exchange,提问作者Gaurav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 10:51:09