diff --git a/types/aws-lambda/common/api-gateway.d.ts b/types/aws-lambda/common/api-gateway.d.ts index d42dd660d8..f6090f2b5e 100644 --- a/types/aws-lambda/common/api-gateway.d.ts +++ b/types/aws-lambda/common/api-gateway.d.ts @@ -10,22 +10,7 @@ export interface APIGatewayEventRequestContext { eventType?: string; extendedRequestId?: string; httpMethod: string; - identity: { - accessKey: string | null; - accountId: string | null; - apiKey: string | null; - apiKeyId: string | null; - caller: string | null; - cognitoAuthenticationProvider: string | null; - cognitoAuthenticationType: string | null; - cognitoIdentityId: string | null; - cognitoIdentityPoolId: string | null; - principalOrgId: string | null; - sourceIp: string; - user: string | null; - userAgent: string | null; - userArn: string | null; - }; + identity: APIGatewayEventIdentity; messageDirection?: string; messageId?: string | null; path: string; @@ -38,6 +23,23 @@ export interface APIGatewayEventRequestContext { routeKey?: string; } +export interface APIGatewayEventIdentity { + accessKey: string | null; + accountId: string | null; + apiKey: string | null; + apiKeyId: string | null; + caller: string | null; + cognitoAuthenticationProvider: string | null; + cognitoAuthenticationType: string | null; + cognitoIdentityId: string | null; + cognitoIdentityPoolId: string | null; + principalOrgId: string | null; + sourceIp: string; + user: string | null; + userAgent: string | null; + userArn: string | null; +} + /** * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */