Selo
04/17/2022, 6:52 PMv1.0.0-beta
and made all change logs but I am getting this error when I run "npx sst build"thdxr
04/17/2022, 6:52 PMSelo
04/17/2022, 6:53 PMthdxr
04/17/2022, 6:53 PMthdxr
04/17/2022, 6:53 PMSelo
04/17/2022, 6:54 PMimport * as iam from "aws-cdk-lib/aws-iam";
import * as sst from "@serverless-stack/resources";
export default class AuthStack extends sst.Stack {
// Public reference to the auth instance
auth;
constructor(scope, id, props) {
super(scope, id, props);
const { api, bucket } = props;
// Create a Cognito User Pool and Identity Pool
this.auth = new sst.Auth(this, "Auth", {
login: ["email"],
defaults: {
function: {
timeout: 10,
},
},
cdk: {
userPool: {
//mfa: cognito.Mfa.OPTIONAL,
},
userPoolClient: {
},
},
});
this.auth.attachPermissionsForAuthUsers([
// Allow access to the API
api,
// Policy granting access to a specific folder in the bucket
new iam.PolicyStatement({
actions: ["s3:*"],
effect: iam.Effect.ALLOW,
resources: [
bucket.bucketArn + "/private/${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>}/*",
],
}),
]);
// Show the auth resources in the output
this.addOutputs({
Region: scope.region,
UserPoolId: this.auth.cdk.userPool.userPoolId,
IdentityPoolId: this.auth.cdk.cfnIdentityPool.ref,
UserPoolClientId: this.auth.cdk.userPoolClient.userPoolClientId,
});
}
}
Selo
04/17/2022, 7:07 PMSelo
04/17/2022, 7:07 PMSelo
04/17/2022, 7:07 PM