UNPKG

2.15 kBTypeScriptView Raw
1import { Handler } from "../handler";
2
3// Note, responses are *not* lambda results, they are sent to the event ResponseURL.
4export type CloudFormationCustomResourceHandler = Handler<CloudFormationCustomResourceEvent, void>;
5
6export type CloudFormationCustomResourceEvent =
7 | CloudFormationCustomResourceCreateEvent
8 | CloudFormationCustomResourceUpdateEvent
9 | CloudFormationCustomResourceDeleteEvent;
10
11export type CloudFormationCustomResourceResponse =
12 | CloudFormationCustomResourceSuccessResponse
13 | CloudFormationCustomResourceFailedResponse;
14
15/**
16 * CloudFormation Custom Resource event and response
17 * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref.html
18 */
19export interface CloudFormationCustomResourceEventCommon {
20 ServiceToken: string;
21 ResponseURL: string;
22 StackId: string;
23 RequestId: string;
24 LogicalResourceId: string;
25 ResourceType: string;
26 ResourceProperties: {
27 ServiceToken: string;
28 [Key: string]: any;
29 };
30}
31
32export interface CloudFormationCustomResourceCreateEvent extends CloudFormationCustomResourceEventCommon {
33 RequestType: 'Create';
34}
35
36export interface CloudFormationCustomResourceUpdateEvent extends CloudFormationCustomResourceEventCommon {
37 RequestType: 'Update';
38 PhysicalResourceId: string;
39 OldResourceProperties: {
40 [Key: string]: any;
41 };
42}
43
44export interface CloudFormationCustomResourceDeleteEvent extends CloudFormationCustomResourceEventCommon {
45 RequestType: 'Delete';
46 PhysicalResourceId: string;
47}
48
49export interface CloudFormationCustomResourceResponseCommon {
50 PhysicalResourceId: string;
51 StackId: string;
52 RequestId: string;
53 LogicalResourceId: string;
54 Data?: {
55 [Key: string]: any;
56 } | undefined;
57 NoEcho?: boolean | undefined;
58}
59
60export interface CloudFormationCustomResourceSuccessResponse extends CloudFormationCustomResourceResponseCommon {
61 Status: 'SUCCESS';
62 Reason?: string | undefined;
63}
64
65export interface CloudFormationCustomResourceFailedResponse extends CloudFormationCustomResourceResponseCommon {
66 Status: 'FAILED';
67 Reason: string;
68}