Open
Description
Description
SAM-T doesn't support using newer fields from Cognito UserPool. In particular, there's a recent UserPoolTier
field that was released at the end of last year.
The CognitoUserPool
model is not updated:
serverless-application-model/samtranslator/model/cognito.py
Lines 5 to 6 in 3ed5efe
Normally SAM-T would ignore non-Serverless, but because of the Cognito Event, SAM-T needs to read this resource to inject the Lambda configuration
Steps to reproduce
You can reproduce the problem with this template:
Transform: AWS::Serverless-2016-10-31
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: "s3://helloworld"
Handler: app.lambda_handler
Runtime: python3.11
Events:
myEvent:
Properties:
Trigger: MyEvent
UserPool: !Ref ExampleUserPool
Type: Cognito
ExampleUserPool:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: Example_CloudFormation_UserPool
UserPoolTier: PLUS
Observed result
If you try to transform that, you get an error
ERROR:__main__:Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [ExampleUserPool] is invalid. property UserPoolTier not defined for resource of type AWS::Cognito::UserPool
Expected result
Template should be correctly transformed.
Additional environment details
- OS:
- If using the SAM CLI,
sam --version
: - AWS region: