mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Adds typing for CloudWatch Logs events (#21239)
This commit is contained in:
committed by
Mohamed Hegazy
parent
bdde08e944
commit
b2517cc5cf
@@ -65,6 +65,8 @@ var S3CreateEvent: AWSLambda.S3CreateEvent = {
|
||||
var cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent;
|
||||
var cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent;
|
||||
var cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse;
|
||||
var cloudwatchLogsEvent: AWSLambda.CloudWatchLogsEvent;
|
||||
var cloudwatchLogsDecodedData: AWSLambda.CloudWatchLogsDecodedData;
|
||||
|
||||
/* API Gateway Event request context */
|
||||
str = apiGwEvtReqCtx.accountId;
|
||||
@@ -364,6 +366,18 @@ clientCtx = context.clientContext;
|
||||
str = identity.cognitoIdentityId;
|
||||
str = identity.cognitoIdentityPoolId;
|
||||
|
||||
/* CloudWatch Logs */
|
||||
str = cloudwatchLogsEvent.awslogs.data;
|
||||
|
||||
str = cloudwatchLogsDecodedData.owner;
|
||||
str = cloudwatchLogsDecodedData.logGroup;
|
||||
str = cloudwatchLogsDecodedData.logStream;
|
||||
str = cloudwatchLogsDecodedData.subscriptionFilters[0];
|
||||
str = cloudwatchLogsDecodedData.messageType;
|
||||
str = cloudwatchLogsDecodedData.logEvents[0].id;
|
||||
num = cloudwatchLogsDecodedData.logEvents[0].timestamp;
|
||||
str = cloudwatchLogsDecodedData.logEvents[0].message;
|
||||
|
||||
/* ClientContext */
|
||||
clientContextClient = clientCtx.client;
|
||||
anyObj = clientCtx.Custom;
|
||||
|
||||
Vendored
+31
@@ -294,6 +294,37 @@ type CloudFormationCustomResourceFailedResponse = CloudFormationCustomResourceRe
|
||||
|
||||
export type CloudFormationCustomResourceResponse = CloudFormationCustomResourceSuccessResponse | CloudFormationCustomResourceFailedResponse;
|
||||
|
||||
/**
|
||||
* See http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-cloudwatch-logs
|
||||
*/
|
||||
interface CloudWatchLogsEvent {
|
||||
awslogs: CloudWatchLogsEventData;
|
||||
}
|
||||
|
||||
interface CloudWatchLogsEventData {
|
||||
data: string;
|
||||
}
|
||||
|
||||
interface CloudWatchLogsDecodedData {
|
||||
owner: string;
|
||||
logGroup: string;
|
||||
logStream: string;
|
||||
subscriptionFilters: string[];
|
||||
messageType: string;
|
||||
logEvents: CloudWatchLogsLogEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#LambdaFunctionExample
|
||||
*/
|
||||
interface CloudWatchLogsLogEvent {
|
||||
id: string;
|
||||
timestamp: number;
|
||||
message: string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Context
|
||||
// http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html
|
||||
interface Context {
|
||||
|
||||
Reference in New Issue
Block a user