UNPKG

3.51 kBTypeScriptView Raw
1import { EventBridgeEvent, EventBridgeHandler } from "./eventbridge";
2
3export type CodeBuildCloudWatchStateHandler = EventBridgeHandler<
4 "CodeBuild Build State Change",
5 CodeBuildStateEventDetail,
6 void
7>;
8
9export type CodeBuildStateType = "IN_PROGRESS" | "SUCCEEDED" | "FAILED" | "STOPPED";
10export type CodeBuildPhaseType =
11 | "COMPLETED"
12 | "FINALIZING"
13 | "UPLOAD_ARTIFACTS"
14 | "POST_BUILD"
15 | "BUILD"
16 | "PRE_BUILD"
17 | "INSTALL"
18 | "QUEUED"
19 | "DOWNLOAD_SOURCE"
20 | "PROVISIONING"
21 | "SUBMITTED";
22export type CodeBuildPhaseStatusType = "TIMED_OUT" | "STOPPED" | "FAILED" | "SUCCEEDED" | "FAULT" | "CLIENT_ERROR";
23export type CodeBuildCacheType = "NO_CACHE" | "LOCAL" | "S3";
24export type CodeBuildSourceLocationType =
25 | "CODECOMMIT"
26 | "CODEPIPELINE"
27 | "GITHUB"
28 | "GITHUB_ENTERPRISE"
29 | "BITBUCKET"
30 | "S3"
31 | "NO_SOURCE";
32export type CodeBuildEnvironmentType =
33 | "LINUX_CONTAINER"
34 | "LINUX_GPU_CONTAINER"
35 | "WINDOWS_CONTAINER"
36 | "ARM_CONTAINER";
37export type CodeBuildEnvironmentPullCredentialsType = "CODEBUILD" | "SERVICE_ROLE";
38export type CodeBuildEnvironmentComputeType =
39 | "BUILD_GENERAL1_SMALL"
40 | "BUILD_GENERAL1_MEDIUM"
41 | "BUILD_GENERAL1_LARGE"
42 | "BUILD_GENERAL1_2XLARGE";
43export type CodeBuildEnvironmentVariableType = "PARAMETER_STORE" | "PLAINTEXT" | "SECRETS_MANAGER";
44
45export interface CodeBuildStateEventDetail {
46 "build-status": CodeBuildStateType;
47 "project-name": string;
48 "build-id": string;
49 "current-phase": CodeBuildPhaseType;
50 "current-phase-context": string;
51 version: string;
52 "additional-information": {
53 cache: {
54 type: CodeBuildCacheType;
55 };
56 "build-number": number;
57 "timeout-in-minutes": number;
58 "build-complete": boolean;
59 initiator: string;
60 "build-start-time": string;
61 source: {
62 buildspec: string;
63 location: string;
64 type: CodeBuildSourceLocationType;
65 };
66 "source-version": string;
67 artifact: {
68 location: string;
69 };
70 environment: {
71 image: string;
72 "privileged-mode": boolean;
73 "image-pull-credentials-type"?: CodeBuildEnvironmentPullCredentialsType | undefined;
74 "compute-type": CodeBuildEnvironmentComputeType;
75 type: CodeBuildEnvironmentType;
76 "environment-variables": Array<{
77 name: string;
78 type?: CodeBuildEnvironmentVariableType | undefined;
79 value: string;
80 }>;
81 };
82 "project-file-system-locations": [];
83 logs: {
84 "group-name": string;
85 "stream-name": string;
86 "deep-link": string;
87 };
88 phases: Array<{
89 "phase-context"?: string[] | undefined; // Not available for COMPLETED phase-type
90 "start-time": string;
91 "end-time"?: string | undefined; // Not available for COMPLETED phase-type
92 "duration-in-seconds"?: number | undefined; // Not available for COMPLETED phase-type
93 "phase-type": CodeBuildPhaseType;
94 "phase-status"?: CodeBuildPhaseStatusType | undefined; // Not available for COMPLETED phase-type
95 }>;
96 "queued-timeout-in-minutes": number;
97 };
98}
99
100export interface CodeBuildCloudWatchStateEvent
101 extends EventBridgeEvent<"CodeBuild Build State Change", CodeBuildStateEventDetail>
102{
103 source: "aws.codebuild";
104}