UNPKG

1.07 kBTypeScriptView Raw
1import { Handler } from "../handler";
2
3export type CodePipelineCloudWatchPipelineHandler = Handler<CodePipelineCloudWatchPipelineEvent, void>;
4
5export type CodePipelineState = 'STARTED' | 'SUCCEEDED' | 'RESUMED' | 'FAILED' | 'CANCELED' | 'SUPERSEDED';
6
7/**
8 * CodePipeline CloudWatch Events
9 * https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html
10 *
11 * The above CodePipelineEvent is when a lambda is invoked by a CodePipeline.
12 * These events are when you subscribe to CodePipeline events in CloudWatch.
13 *
14 * Their documentation says that detail.version is a string, but it is actually an integer
15 */
16
17export interface CodePipelineCloudWatchPipelineEvent {
18 version: string;
19 id: string;
20 'detail-type': 'CodePipeline Pipeline Execution State Change';
21 source: 'aws.codepipeline';
22 account: string;
23 time: string;
24 region: string;
25 resources: string[];
26 detail: {
27 pipeline: string;
28 version: number;
29 state: CodePipelineState;
30 'execution-id': string;
31 };
32}