Skip to content

UnmarshalTypeError on CodePipelineEventBridgeEvent #552

Open
@lexedwards

Description

@lexedwards

Is your feature request related to a problem? Please describe.

Triggering a lambda with EventBridge CodePipeline events, i.e.:

{
  "detail-type": [
    "CodePipeline Pipeline Execution State Change",
    "CodePipeline Stage Execution State Change",
    "CodePipeline Action Execution State Change"
  ],
  "source": [
    "aws.codepipeline"
  ]
}

The Lambda in question has this structure:

func handler(_ context.Context, event *events.CodePipelineEventBridgeEvent) error {}

Upon execution, it almost immediately fails and outputs one of two errors (so far):

json: cannot unmarshal number 2.0 into Go struct field CodePipelineEventDetail.detail.version of type int64
json: cannot unmarshal string into Go struct field CodePipelineEventDetailType.detail.type.version of type int64

Describe the solution you'd like

I'm fairly certain I'm using the correct event type here, but I could be wrong. However, I'd like a solution to the lambda not failing immediately and the type being correct for what EventBridge is passing into the lambda.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtype/eventsissue or feature request related to the events package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions