Noah D
02/16/2022, 12:02 PMAPIGatewayProxyEventV2
from @types/aws-lambda
fine, however have been trying to get the identity pool id like seen in the guide using event.requestContext.authorizer.iam.cognitoIdentity.identityId
however the type seems to not think this field exists (it definitely does). My version is "@types/aws-lambda": "^8.10.92",
so might be related to that, but figure someone might have some insight into correct version to use if so 🙏Derek Kershner
02/16/2022, 3:56 PMApiGatewayProxyWithAuthorizerEventV2
.Frank
Noah D
02/17/2022, 8:34 AMimport { APIGatewayProxyEventV2WithRequestContext } from 'aws-lambda';
interface IAMContext {
accessKey: string,
accountId: string,
callerId: string,
cognitoIdentity: {
amr: string[],
identityId: string,
identityPoolId: string
},
principalOrgId: string,
userArn: string,
userId: string
}
interface AuthorizerContext {
accountId: string,
apiId: string,
authorizer: {
iam: IAMContext
}
}
type EndpointEvent = APIGatewayProxyEventV2WithRequestContext<AuthorizerContext>
export { EndpointEvent }
Noah D
02/17/2022, 8:35 AMDerek Kershner
02/17/2022, 3:01 PMDerek Kershner
02/17/2022, 3:05 PMinterface AuthorizerContext extends APIGatewayEventRequestContextV2 {
Noah D
02/18/2022, 9:45 PMauthorizer.iam.cognitoIdentity.identityId
Derek Kershner
02/18/2022, 11:08 PMextend
it, but not the end of the world.Noah D
02/18/2022, 11:08 PM