Olivers
09/07/2021, 7:43 PMAccessDeniedException: User:arn:aws:sts::xxx... is not authorized to perform: cognito-idp:ListUsers on resource....
This is my stack code:
// Create a HTTP API
const api = new sst.Api(this, "Api", {
defaultAuthorizationType: sst.ApiAuthorizationType.AWS_IAM,
routes: {
"GET /private": "src/private.handler",
"GET /health": {
function: "src/health.handler",
authorizationType: sst.ApiAuthorizationType.NONE,
},
},
});
const auth = new sst.Auth(this, "Auth", {
cognito: {
userPool: {
signInAliases: { email: true, phone: true },
signInCaseSensitive: false,
},
},
});
auth.attachPermissionsForAuthUsers([
api,
new iam.PolicyStatement({
actions: ["cognito-idp:ListUsers"],
effect: iam.Effect.ALLOW,
resources: ["arn:aws:cognito-idp:xxx"],
}),
]);
I don't now if I'm attaching the permission in the correct place or I'm missing something elseFrank
Frank
auth.attachPermissionsForAuthUsers([api]);
api.attachPermissions([
new iam.PolicyStatement({
actions: ["cognito-idp:ListUsers"],
effect: iam.Effect.ALLOW,
resources: ["arn:aws:cognito-idp:xxx"],
}),
]);
Olivers
09/07/2021, 7:46 PMOlivers
09/07/2021, 7:50 PMFrank
AccessDeniedException
error?Olivers
09/07/2021, 7:52 PMthdxr
09/07/2021, 7:52 PMOlivers
09/07/2021, 7:56 PMthdxr
09/07/2021, 7:57 PMOlivers
09/07/2021, 7:57 PMthdxr
09/07/2021, 7:57 PMOlivers
09/07/2021, 7:58 PM