Gaurav
Gaurav

Reputation: 21

Api Gateway connection to Event Bridge giving error. Eventbridge-PutEvents not supported

I am trying to create an event bridge connection via Serverless framework but getting EventBridge-PutEvents is not supported error.

# 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: 1.0
        CredentialsArn: !GetAtt HttpApiRole.Arn
        RequestParameters:
          Detail: $request.body.detail
          DetailType: $request.body.action
          Source: $request.body.source
          EventBusName: !GetAtt EventBus.Name

I am getting this error with above statement

Error: CREATE_FAILED: EventBridgeIntegration (AWS::ApiGatewayV2::Integration) Operation: EventBridge-PutEvents is not supported. (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException;

Upvotes: 1

Views: 340

Answers (1)

Gaurav
Gaurav

Reputation: 21

Found the issue. PayloadFormatVersion should be in quotes. This solved the issue for me.

PayloadFormatVersion: “1.0”

Upvotes: 1

Related Questions