Mirza
06/14/2022, 12:32 PMauth.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>}/*',
],
}),
]);
I get the following error:
Type 'PolicyStatement' is not assignable to type 'string | Omit<string, SupportedPermissions> | IConstruct | [IConstruct, string] | PolicyStatement'.
Type 'PolicyStatement' is missing the following properties from type 'PolicyStatement': action, notAction, principal, notPrincipal, and 3 more.ts(2322)
Derek Kershner
06/14/2022, 12:34 PMMirza
06/14/2022, 12:37 PM"@serverless-stack/cli": "^1.2.22",
"@serverless-stack/resources": "^1.2.22",
"@tsconfig/node16": "^1.0.3",
"@types/aws-lambda": "^8.10.70",
"@types/node": "^17.0.42",
"aws-cdk-lib": "^2.27.0",
Mirza
06/14/2022, 1:35 PMIdentityPoolId: auth.cognitoIdentityPoolId,
The error is:
(property) IdentityPoolId: string | undefined
Type 'string | undefined' is not assignable to type 'string | CfnOutputProps'.
Type 'undefined' is not assignable to type 'string | CfnOutputProps'.ts(2322)
Changing it to the following passes:
IdentityPoolId: auth.cognitoIdentityPoolId || {
description: '',
value: '',
},
But, I have no idea whether that is valid.Derek Kershner
06/14/2022, 1:36 PMMirza
06/14/2022, 1:41 PM