Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudformation `StartingPositionTimestamp` for Lambda/Kinesis event source mapping

I'm looking to connect a Kinesis stream to a Lambda function via event source mapping, want to set the StartingPosition value to AT_TIMESTAMP -

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition

So now I'm looking to set the actual timestamp for that starting position.

If I look at the AWS CLI there seems to be a parameter for it (--starting-position-timestamp) -

aws lambda create-event-source-mapping help
SYNOPSIS
            create-event-source-mapping
          --event-source-arn <value>
          --function-name <value>
          [--enabled | --no-enabled]
          [--batch-size <value>]
          [--starting-position <value>]
          [--starting-position-timestamp <value>]
          [--cli-input-json <value>]
          [--generate-cli-skeleton <value>]

and if I look at boto3 there is a StartingPositionTimestamp parameter -

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.create_event_source_mapping

response = client.create_event_source_mapping(
    EventSourceArn='string',
    FunctionName='string',
    Enabled=True|False,
    BatchSize=123,
    StartingPosition='TRIM_HORIZON'|'LATEST'|'AT_TIMESTAMP',
    StartingPositionTimestamp=datetime(2015, 1, 1)
)

but I can't find any such StartingPositionTimestamp parameter in the AWS::Lambda::EventSourceMapping docs -

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html

So how do I set Kinesis starting position timestamp via Cloudformation ?

like image 356
Justin Avatar asked Oct 25 '25 00:10

Justin


1 Answers

It looks like this was a miss when the feature was originally launched, but it's correctly supported now: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp

like image 148
Renato Avatar answered Oct 26 '25 15:10

Renato



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!