Created ScheduledEvent on AWS Lambda Types (#22974)

* Created ScheduledEvent on AWS Lambda Types

* aws-lambda types

Fixed detail type on ScheduleEvent

* types/aws-lambda
Fixed header at index.d.ts
This commit is contained in:
Danilo Tenorio Raisi
2018-01-23 17:06:53 -02:00
committed by Andy
parent 3499d8a0d9
commit 8db0647a2d
2 changed files with 25 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ var cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEve
var cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse;
var cloudwatchLogsEvent: AWSLambda.CloudWatchLogsEvent;
var cloudwatchLogsDecodedData: AWSLambda.CloudWatchLogsDecodedData;
var scheduledEvent: AWSLambda.ScheduledEvent;
/* API Gateway Event request context */
str = apiGwEvtReqCtx.accountId;
@@ -350,6 +351,15 @@ str = cloudformationCustomResourceResponse.RequestId;
str = cloudformationCustomResourceResponse.StackId;
str = cloudformationCustomResourceResponse.Status;
/* ScheduledEvent */
str = scheduledEvent.account;
anyObj = scheduledEvent.detail;
str = scheduledEvent.id;
str = scheduledEvent.region;
str = scheduledEvent.resources[0];
str = scheduledEvent.source;
str = scheduledEvent.time;
/* Context */
b = context.callbackWaitsForEmptyEventLoop;
str = context.functionName;

View File

@@ -12,6 +12,7 @@
// Daniel Cottone <https://github.com/daniel-cottone>
// Kostya Misura <https://github.com/kostya-misura>
// Markus Tacker <https://github.com/coderbyheart>
// Danilo Raisi <https://github.com/daniloraisi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -294,6 +295,20 @@ type CloudFormationCustomResourceFailedResponse = CloudFormationCustomResourceRe
export type CloudFormationCustomResourceResponse = CloudFormationCustomResourceSuccessResponse | CloudFormationCustomResourceFailedResponse;
/**
* See https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-scheduled-event
*/
interface ScheduledEvent {
account: string;
region: string;
detail: any;
"detail-type": string;
source: string;
time: string;
id: string;
resources: string[]
}
/**
* See http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-cloudwatch-logs
*/