Adding Auth to Our Serverless App

Link to chapter —

I missed something in lib/index.js

Specifically, I did not create a new variable
const apiStack = new ApiStack(...
and use it in the new AuthStack constructor

new AuthStack(app, 'auth', {
    api: apiStack.api, ...

I mistakenly had api: ApiStack.api

This caused a build time error with a message of
error: The specified permissions are not supported.

Of course, with the correct code, everything works as expected. Posting this here if someone else runs into this.

1 Like

Makes sense. Thanks for sharing!

Error [ValidationError]: Template format error: Unrecognized resource types: [AWS::Cognito::UserPool, AWS::Cognito::IdentityPoolRoleAttachment, AWS::Cognito::UserPoolClient, AWS::Cognito::IdentityPool

Might anyone have come across this error while going through section?
If you have an idea why this might be happening, I’ll appreciate it

My bad, had used a Cape Town as my region, which apparently doesn’t support. Reverted to the default region in the guide.

In this section when I run

npx sst add-cdk @aws-cdk/aws-iam

I get an error

:x: @aws-cdk/aws-iam is an AWS CDK v1 package. Only v2 packages are supported.

We are in the process of updating the guide to CDK v2, so these steps will change soon!