Gabriel
06/16/2021, 8:39 AMFrank
Gabriel
06/16/2021, 7:39 PMFrank
Frank
Frank
Gabriel
06/18/2021, 8:18 AMFrank
Frank
Frank
Gabriel
06/18/2021, 8:56 PMFrank
Gabriel
06/19/2021, 8:28 PMFrank
import { HttpUserPoolAuthorizer } from "@aws-cdk/aws-apigatewayv2-authorizers";
const userPool = cognito.UserPool.fromUserPoolId(this, 'my-pool', 'us-east-1_oiuR12Abd');
const userPoolClient = cognito.UserPoolClient.fromUserPoolClientId(this, "my-client', '...');
new Api(this, "Api", {
defaultAuthorizationType: ApiAuthorizationType.JWT,
defaultAuthorizer: new HttpUserPoolAuthorizer({
userPool,
userPoolClient,
}),
defaultAuthorizationScopes: ["user.id", "user.email"],
routes: {
"GET /notes": "src/list.main",
},
});
Frank
Auth
. Here’s an example https://docs.serverless-stack.com/constructs/Auth#importing-an-existing-user-poolGabriel
02/27/2022, 9:50 AM