-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
contributors/good-first-issueGood first issue for a contributorGood first issue for a contributorcontributors/welcomeContributors are welcome to work on thisContributors are welcome to work on thisstage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.Automatically applied to new issues and PRs, indicating they haven't been looked at.type/bug
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
class CognitoUserPool(Resource): | |
resource_type = "AWS::Cognito::UserPool" |
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:
Metadata
Metadata
Assignees
Labels
contributors/good-first-issueGood first issue for a contributorGood first issue for a contributorcontributors/welcomeContributors are welcome to work on thisContributors are welcome to work on thisstage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.Automatically applied to new issues and PRs, indicating they haven't been looked at.type/bug