UNPKG

1.35 kBTypeScriptView Raw
1import { Handler } from "../handler";
2
3export type CodePipelineHandler = Handler<CodePipelineEvent, void>;
4
5/**
6 * CodePipeline events
7 * https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html
8 */
9export interface S3ArtifactLocation {
10 bucketName: string;
11 objectKey: string;
12}
13export interface S3ArtifactStore {
14 type: 'S3';
15 s3Location: S3ArtifactLocation;
16}
17
18export type ArtifactLocation = S3ArtifactStore;
19
20export interface Artifact {
21 name: string;
22 revision: string | null;
23 location: ArtifactLocation;
24}
25
26export interface Credentials {
27 accessKeyId: string;
28 secretAccessKey: string;
29 sessionToken?: string | undefined;
30}
31
32export interface EncryptionKey {
33 type: string;
34 id: string;
35}
36
37export interface CodePipelineEvent {
38 'CodePipeline.job': {
39 id: string;
40 accountId: string;
41 data: {
42 actionConfiguration: {
43 configuration: {
44 FunctionName: string;
45 UserParameters: string;
46 };
47 };
48 inputArtifacts: Artifact[];
49 outputArtifacts: Artifact[];
50 artifactCredentials: Credentials;
51 encryptionKey?: EncryptionKey & { type: 'KMS' } | undefined;
52 continuationToken?: string | undefined;
53 };
54 };
55}