service: tenant-dev
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: ap-southeast-1
authorizer: CognitoAuthorizer
apiGateway: TenantAPI
userPool: Tenant_Group
environment:
COGNITO_USERPOOLID: ap-southeast-1_faQUIpTCq
COGNITO_REGION: ap-southeast-1
GROUP_NAME: TenantGroup
COGNITO_GROUP_ROLE: arn:aws:iam::526821537466:role/Cognito_TenantIDPoolAuth_Role
custom:
region: ${self:provider.region}
authorizer: ${self:provider.authorizer}
apiGateway: ${self:provider.apiGateway}
stage: ${opt:stage, self:provider.stage}
prefix: ${self:custom.stage}-${self:service}
userPool: ${self:provider.userPool}
functions:
verifyTenant:
Type: 'AWS::Lambda::Function'
timeout: 10
handler: functions/VerifyTenant/verifyTenant.handler
name: ${self:custom.prefix}-verifyTenant
events:
- cognitoUserPool:
pool: ${self:custom.userPool}
trigger: PostConfirmation
resources:
Resources:
UserPool:
Type: "AWS::Cognito::UserPool"
Properties:
UserPoolName:
Ref: ${self:custom.userPool}
Thank you for reporting @balakrishna222111 :+1:
I did debugging the serverless.yml you provided.
Your serverless.yml has two wrong points.
First, You should specify CognitoUserPoolTenantGroup to resources > UserPoolName section instead of ${self:custom.userPool} like the following.
You need to specify the logical ID of CloudFormation here.
UserPoolName:
Ref: CognitoUserPoolTenantGroup
Second, seems that ap-southeast-1 region doesn't support for AWS::Cognito::UserPool yet.
I saw the following error.
Error --------------------------------------------------
The CloudFormation template is invalid: Template format error: Unrecognized resource types: [AWS::Cognito::UserPool]
Most helpful comment
Thank you for reporting @balakrishna222111 :+1:
I did debugging the serverless.yml you provided.
Your serverless.yml has two wrong points.
First, You should specify
CognitoUserPoolTenantGrouptoresources > UserPoolNamesection instead of${self:custom.userPool}like the following.You need to specify the logical ID of CloudFormation here.
Second, seems that
ap-southeast-1region doesn't support forAWS::Cognito::UserPoolyet.I saw the following error.