Serverless: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [Tenant_Group] in the Resources block of the template

Created on 30 Nov 2017  路  1Comment  路  Source: serverless/serverless

  1. i want a lambda(verify-tenant)function that should be come in "trigger-->postconfirmation" which is in user cognito poool

    but it throws an error like "The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [Tenant_Group] in the Resources block of the template"

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}
question

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 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]

>All comments

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]

Was this page helpful?
0 / 5 - 0 ratings