Link to chapter — https://serverless-stack.com/chapters/adding-auth-to-our-serverless-app.html
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.
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
@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!
BBCODE
new iam.PolicyStatement({
actions: ["s3:*"],
effect: iam.Effect.ALLOW,
resources: [
bucket.bucketArn + "/private/${cognito-identity.amazonaws.com:sub}/*",
],
}),
where this code need to be placed
Oh that’s from a previous version. It should be referencing the snippet from above instead.
{
actions: ["s3:*"],
resources: [
$concat(bucket.arn, "/private/${cognito-identity.amazonaws.com:sub}/*"),
],
},