Variable DynamoDBStreamToKinesisRecordConst
DynamoDBStreamToKinesisRecord: ZodObject<
Omit<
extendShape<
{
awsRegion: ZodString;
dynamodb: ZodEffects<
ZodObject<
{
ApproximateCreationDateTime: ZodOptional<ZodNumber>;
Keys: ZodRecord<ZodString, ZodRecord<ZodString, ZodAny>>;
NewImage: ZodOptional<ZodRecord<ZodString, ZodAny>>;
OldImage: ZodOptional<ZodRecord<ZodString, ZodAny>>;
SequenceNumber: ZodString;
SizeBytes: ZodNumber;
StreamViewType: ZodEnum<
["NEW_IMAGE", "OLD_IMAGE", "NEW_AND_OLD_IMAGES", "KEYS_ONLY"],
>;
},
"strip",
ZodTypeAny,
{
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SequenceNumber: string;
SizeBytes: number;
StreamViewType:
| "NEW_IMAGE"
| "OLD_IMAGE"
| "NEW_AND_OLD_IMAGES"
| "KEYS_ONLY";
},
{
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SequenceNumber: string;
SizeBytes: number;
StreamViewType:
| "NEW_IMAGE"
| "OLD_IMAGE"
| "NEW_AND_OLD_IMAGES"
| "KEYS_ONLY";
},
>,
{
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SizeBytes: number;
},
{
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SequenceNumber: string;
SizeBytes: number;
StreamViewType:
| "NEW_IMAGE"
| "OLD_IMAGE"
| "NEW_AND_OLD_IMAGES"
| "KEYS_ONLY";
},
>;
eventID: ZodString;
eventName: ZodEnum<["INSERT", "MODIFY", "REMOVE"]>;
eventSource: ZodLiteral<"aws:dynamodb">;
eventSourceARN: ZodString;
eventVersion: ZodString;
userIdentity: ZodOptional<
ZodObject<
{
principalId: ZodLiteral<"dynamodb.amazonaws.com">;
type: ZodEnum<["Service"]>;
},
"strip",
ZodTypeAny,
{ principalId: "dynamodb.amazonaws.com"; type: "Service" },
{ principalId: "dynamodb.amazonaws.com"; type: "Service" },
>,
>;
},
{
dynamodb: ZodEffects<
ZodObject<
Omit<
{
ApproximateCreationDateTime: ZodOptional<ZodNumber>;
Keys: ZodRecord<ZodString, ZodRecord<ZodString, ZodAny>>;
NewImage: ZodOptional<ZodRecord<ZodString, ZodAny>>;
OldImage: ZodOptional<ZodRecord<ZodString, ZodAny>>;
SequenceNumber: ZodString;
SizeBytes: ZodNumber;
StreamViewType: ZodEnum<
["NEW_IMAGE", "OLD_IMAGE", "NEW_AND_OLD_IMAGES", "KEYS_ONLY"],
>;
},
"SequenceNumber"
| "StreamViewType",
>,
"strip",
ZodTypeAny,
{
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SizeBytes: number;
},
{
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SizeBytes: number;
},
>,
{
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SizeBytes: number;
},
{
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SizeBytes: number;
},
>;
recordFormat: ZodLiteral<"application/json">;
tableName: ZodString;
userIdentity: ZodOptional<
ZodNullable<
ZodObject<
{
principalId: ZodLiteral<"dynamodb.amazonaws.com">;
type: ZodEnum<["Service"]>;
},
"strip",
ZodTypeAny,
{ principalId: "dynamodb.amazonaws.com"; type: "Service" },
{ principalId: "dynamodb.amazonaws.com"; type: "Service" },
>,
>,
>;
},
>,
"eventVersion"
| "eventSourceARN",
>,
"strip",
ZodTypeAny,
{
awsRegion: string;
dynamodb: {
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SizeBytes: number;
};
eventID: string;
eventName: "INSERT"
| "MODIFY"
| "REMOVE";
eventSource: "aws:dynamodb";
recordFormat: "application/json";
tableName: string;
userIdentity?:
| null
| { principalId: "dynamodb.amazonaws.com"; type: "Service" };
},
{
awsRegion: string;
dynamodb: {
ApproximateCreationDateTime?: number;
Keys: Record<string, Record<string, any>>;
NewImage?: Record<string, any>;
OldImage?: Record<string, any>;
SizeBytes: number;
};
eventID: string;
eventName: "INSERT"
| "MODIFY"
| "REMOVE";
eventSource: "aws:dynamodb";
recordFormat: "application/json";
tableName: string;
userIdentity?:
| null
| { principalId: "dynamodb.amazonaws.com"; type: "Service" };
},
> = ...
Zod schema for Amazon DynamoDB Stream event sent to an Amazon Kinesis Stream.
This schema is best used in conjunction with the
KinesisEnvelope
when you want to work with the DynamoDB stream event coming from an Amazon Kinesis Stream.By default, we unmarshall the
dynamodb.Keys
,dynamodb.NewImage
, anddynamodb.OldImage
fields for you.If you want to extend the schema and provide your own Zod schema for any of these fields, you can use the
DynamoDBMarshalled
helper. In that case, we won't unmarshall the other fields.To extend the schema, you can use the
DynamoDBStreamToKinesisRecord
child schema and theDynamoDBMarshalled
helper together.