Open AmazingDreams opened 4 months ago
Hi, thanks for bringing up this issue, since you are creating the SAM template from CDK directly, this is not being used in SAM CLI, sending this over to the appropriate SAM repo.
Seems related to this issue https://github.com/aws/serverless-application-model/issues/3322
I guess CDK does not have the latest model setup?
Hi there, thanks for reaching out. I tested with this template
Resources:
somefunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs12.x
CodeUri: s3://bucket/key
Events:
sqs:
Properties:
BatchSize: 10
Queue:
Fn::GetAtt:
- somequeue
- Arn
Type: SQS
SAM is correctly transforming the template and the resulted event source mapping has batch size defined. This should be forwarded to AWS CDK repo.
Yes I can reproduce this issue
new sam.CfnFunction(this, 'some-function', {
events: {
sqs: {
type: 'SQS',
properties: {
queue: 'dummyArn',
batchSize: 10,
functionResponseTypes: ['foo'],
}
}
}
});
would synthesize into
somefunction:
Type: AWS::Serverless::Function
Properties:
Events:
sqs:
Properties:
BatchSize: 10
Queue: dummyArn
Type: SQS
And functionResponseTypes
is missing in the template.
Actually I am encountering more and more things that seem to be not included in CDK. As if the definitions for SAM are out of date.
Description:
I am trying to setup an SQS event handler with ReportBatchItemFailures enabled. I am using CDK. However, the option will still be disabled.
Steps to reproduce:
I am using this in CDK template:
Observed result:
The function response types are not inserted into the generated template:
Expected result:
I expect the ReportBatchItemFailures to be injected into the generated template:
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
:Add --debug flag to command you are running