2021年3月28日星期日

replace the cloudwatch request id with a custom unique id

I want to send an unique id to my cloudwatch event.
The below image shows the request id. This unique id has to be changed.

enter image description here

Below is the serverless.yml code for my lambda function.
I tried to add an input (InputTransformers) but it didn't do much.
What can i do here???

functions:    stream-function:      handler: src/stream-handler/stream.handler      memorySize: 1024 #in MB, also control CPU throughput      timeout: 31 #in seconds, match with downstream to avoid concurrent request      events:        - stream:            type: kinesis            arn:              Fn::GetAtt: [HagoStream, Arn]            batchSize: 1            parallelizationFactor: 2            Id: "my cloud watch rule name"            InputTransformer: {                 InputTemplate: '{"uniqueId": "96c80428-14fe-c8d0-f6e3-639384992391"}',                  InputPathsMap: {                    id: '$.uniqueId'                  }              }            maximumRetryAttempts: 2            destinations:              onFailure:                arn:                  Fn::GetAtt: [HagoFailedQueue, Arn]                type: sqs        environment:        DLQ_URL:          Ref: HagoDlqQueue    
https://stackoverflow.com/questions/66848639/replace-the-cloudwatch-request-id-with-a-custom-unique-id March 29, 2021 at 12:07PM

没有评论:

发表评论