Skip to content

Bug: KafkaSelfManagedEventModel eventSource not correct #3324

Closed
@leandrodamascena

Description

@leandrodamascena

Expected Behavior

Original issue: aws-powertools/powertools-lambda-python#5559

The schema KafkaSelfManagedEventSchema must have eventSource: z.literal('SelfManagedKafka'), instead of eventSource: z.literal('aws:SelfManagedKafka'),.

Reference: https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html

Current Behavior

Trying to validate with aws:SelfManagedKafka fails.

Code snippet

No code snippet

Steps to Reproduce

Use this event to validate

{
   "eventSource": "SelfManagedKafka",
   "bootstrapServers":"b-2.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092,b-1.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092",
   "records":{
      "mytopic-0":[
         {
            "topic":"mytopic",
            "partition":0,
            "offset":15,
            "timestamp":1545084650987,
            "timestampType":"CREATE_TIME",
            "key":"abcDEFghiJKLmnoPQRstuVWXyz1234==",
            "value":"SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==",
            "headers":[
               {
                  "headerKey":[
                     104,
                     101,
                     97,
                     100,
                     101,
                     114,
                     86,
                     97,
                     108,
                     117,
                     101
                  ]
               }
            ]
         }
      ]
   }
}

Possible Solution

No response

Powertools for AWS Lambda (TypeScript) version

latest

AWS Lambda function runtime

20.x

Packaging format used

npm, Lambda Layers

Execution logs

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompletedThis item is complete and has been merged/shippedparserThis item relates to the Parser Utility

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions