agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.codebuild"
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.CodeBuild"
},
"python": {
"module": "aws_cdk.aws_codebuild"
}
}
}

1158
cdk/node_modules/aws-cdk-lib/aws-codebuild/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
export * from './lib';

1
cdk/node_modules/aws-cdk-lib/aws-codebuild/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,105 @@
import type { Construct } from 'constructs';
import type { CfnProject } from './codebuild.generated';
import type { IProject } from './project';
import type * as s3 from '../../aws-s3';
/**
* The type returned from `IArtifacts#bind`.
*/
export interface ArtifactsConfig {
/**
* The low-level CloudFormation artifacts property.
*/
readonly artifactsProperty: CfnProject.ArtifactsProperty;
}
/**
* The abstract interface of a CodeBuild build output.
* Implemented by `Artifacts`.
*/
export interface IArtifacts {
/**
* The artifact identifier.
* This property is required on secondary artifacts.
*/
readonly identifier?: string;
/**
* The CodeBuild type of this artifact.
*/
readonly type: string;
/**
* Callback when an Artifacts class is used in a CodeBuild Project.
*
* @param scope a root Construct that allows creating new Constructs
* @param project the Project this Artifacts is used in
*/
bind(scope: Construct, project: IProject): ArtifactsConfig;
}
/**
* Properties common to all Artifacts classes.
*/
export interface ArtifactsProps {
/**
* The artifact identifier.
* This property is required on secondary artifacts.
*/
readonly identifier?: string;
}
/**
* Artifacts definition for a CodeBuild Project.
*/
export declare abstract class Artifacts implements IArtifacts {
static s3(props: S3ArtifactsProps): IArtifacts;
readonly identifier?: string;
abstract readonly type: string;
protected constructor(props: ArtifactsProps);
bind(_scope: Construct, _project: IProject): ArtifactsConfig;
}
/**
* Construction properties for `S3Artifacts`.
*/
export interface S3ArtifactsProps extends ArtifactsProps {
/**
* The name of the output bucket.
*/
readonly bucket: s3.IBucket;
/**
* The path inside of the bucket for the build output .zip file or folder.
* If a value is not specified, then build output will be stored at the root of the
* bucket (or under the <build-id> directory if `includeBuildId` is set to true).
*
* @default the root of the bucket
*/
readonly path?: string;
/**
* The name of the build output ZIP file or folder inside the bucket.
*
* The full S3 object key will be "<path>/<build-id>/<name>" or
* "<path>/<name>" depending on whether `includeBuildId` is set to true.
*
* If not set, `overrideArtifactName` will be set and the name from the
* buildspec will be used instead.
*
* @default undefined, and use the name from the buildspec
*/
readonly name?: string;
/**
* Indicates if the build ID should be included in the path. If this is set to true,
* then the build artifact will be stored in "<path>/<build-id>/<name>".
*
* @default true
*/
readonly includeBuildId?: boolean;
/**
* If this is true, all build output will be packaged into a single .zip file.
* Otherwise, all files will be uploaded to <path>/<name>
*
* @default true - files will be archived
*/
readonly packageZip?: boolean;
/**
* If this is false, build output will not be encrypted.
* This is useful if the artifact to publish a static website or sharing content with others
*
* @default true - output will be encrypted
*/
readonly encryption?: boolean;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Artifacts=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class Artifacts{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.Artifacts",version:"2.252.0"};static s3(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_S3ArtifactsProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.s3),error}return new S3Artifacts(props)}identifier;constructor(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_ArtifactsProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Artifacts),error}this.identifier=props.identifier}bind(_scope,_project){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_IProject(_project)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{artifactsProperty:{artifactIdentifier:this.identifier,type:this.type}}}}exports.Artifacts=Artifacts;class S3Artifacts extends Artifacts{props;type="S3";constructor(props){super(props),this.props=props}bind(_scope,project){return this.props.bucket.grantReadWrite(project),{artifactsProperty:{...super.bind(_scope,project).artifactsProperty,location:this.props.bucket.bucketName,path:this.props.path,namespaceType:this.props.includeBuildId===!1?"NONE":"BUILD_ID",name:this.props.name==null?void 0:this.props.name,packaging:this.props.packageZip===!1?"NONE":"ZIP",encryptionDisabled:this.props.encryption===!1?!0:void 0,overrideArtifactName:this.props.name==null?!0:void 0}}}}

View File

@@ -0,0 +1,49 @@
import type { Construct } from 'constructs';
/**
* BuildSpec for CodeBuild projects
*/
export declare abstract class BuildSpec {
static fromObject(value: {
[key: string]: any;
}): BuildSpec;
/**
* Create a buildspec from an object that will be rendered as YAML in the resulting CloudFormation template.
*
* @param value the object containing the buildspec that will be rendered as YAML
*/
static fromObjectToYaml(value: {
[key: string]: any;
}): BuildSpec;
/**
* Use a file from the source as buildspec
*
* Use this if you want to use a file different from 'buildspec.yml'`
*/
static fromSourceFilename(filename: string): BuildSpec;
/**
* Use the contents of a local file as the build spec string
*
* Use this if you have a local .yml or .json file that you want to use as the buildspec
*/
static fromAsset(path: string): BuildSpec;
/**
* Whether the buildspec is directly available or deferred until build-time
*/
abstract readonly isImmediate: boolean;
protected constructor();
/**
* Render the represented BuildSpec
*/
abstract toBuildSpec(scope?: Construct): string;
}
/**
* Merge two buildspecs into a new BuildSpec by doing a deep merge
*
* We decided to disallow merging of artifact specs, which is
* actually impossible since we can't merge two buildspecs with a
* single primary output into a buildspec with multiple outputs.
* In case of multiple outputs they must have identifiers but we won't have that information.
*
* In case of test reports we replace the whole object with the RHS (instead of recursively merging)
*/
export declare function mergeBuildSpecs(lhs: BuildSpec, rhs: BuildSpec): BuildSpec;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BuildSpec=void 0,exports.mergeBuildSpecs=mergeBuildSpecs;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var yaml_cfn=()=>{var tmp=require("./private/yaml-cfn");return yaml_cfn=()=>tmp,tmp},s3_assets=()=>{var tmp=require("../../aws-s3-assets");return s3_assets=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class BuildSpec{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.BuildSpec",version:"2.252.0"};static fromObject(value){return new ObjectBuildSpec(value)}static fromObjectToYaml(value){return new YamlBuildSpec(value)}static fromSourceFilename(filename){return new FilenameBuildSpec(filename)}static fromAsset(path){return new AssetBuildSpec(path)}constructor(){}}exports.BuildSpec=BuildSpec;class AssetBuildSpec extends BuildSpec{path;options;isImmediate=!0;asset;constructor(path,options={}){super(),this.path=path,this.options=options}toBuildSpec(scope){if(!scope)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`AssetBuildSpecRequiresScopeArgument`,"`AssetBuildSpec` requires a `scope` argument");if(!this.asset)this.asset=new(s3_assets()).Asset(scope,"Code",{path:this.path,...this.options});else if(core_1().Stack.of(this.asset)!==core_1().Stack.of(scope))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`AssetAlreadyAssociatedWithAnotherStack`,`Asset is already associated with another stack '${core_1().Stack.of(this.asset).stackName}'. Create a new BuildSpec instance for every stack.`);return this.asset.grantRead(scope),this.asset.bucket.arnForObjects(this.asset.s3ObjectKey)}toString(){return`<buildspec file: ${this.path}>`}}class FilenameBuildSpec extends BuildSpec{filename;isImmediate=!1;constructor(filename){super(),this.filename=filename}toBuildSpec(){return this.filename}toString(){return`<buildspec file: ${this.filename}>`}}class ObjectBuildSpec extends BuildSpec{spec;isImmediate=!0;constructor(spec){super(),this.spec=spec}toBuildSpec(){return core_1().Lazy.uncachedString({produce:ctx=>core_1().Stack.of(ctx.scope).toJsonString(this.spec,2)})}}class YamlBuildSpec extends BuildSpec{spec;isImmediate=!0;constructor(spec){super(),this.spec=spec}toBuildSpec(){return yaml_cfn().serialize(this.spec)}}function mergeBuildSpecs(lhs,rhs){if(!(lhs instanceof ObjectBuildSpec)||!(rhs instanceof ObjectBuildSpec))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CanOnlyMergeBuildSpecsFromObject`,"Can only merge buildspecs created using BuildSpec.fromObject()");if(lhs.spec.version==="0.1")throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CannotExtendBuildSpecVersionZeroOne`,'Cannot extend buildspec at version "0.1". Set the version to "0.2" or higher instead.');if(lhs.spec.artifacts&&rhs.spec.artifacts)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`OnlyOneBuildSpecCanSpecifyArtifacts`,"Only one build spec is allowed to specify artifacts.");const lhsSpec=JSON.parse(JSON.stringify(lhs.spec)),rhsSpec=JSON.parse(JSON.stringify(rhs.spec));normalizeSpec(lhsSpec),normalizeSpec(rhsSpec);const merged=mergeDeep(lhsSpec,rhsSpec);return lhsSpec.reports&&rhsSpec.reports&&(merged.reports={...lhsSpec.reports,...rhsSpec.reports}),new ObjectBuildSpec(merged)}function normalizeSpec(spec){spec.env&&typeof spec.env["exported-variables"]=="string"&&(spec.env["exported-variables"]=[spec.env["exported-variables"]]);for(const key in spec.phases)Object.prototype.hasOwnProperty.call(spec.phases,key)&&normalizeSpecPhase(spec.phases[key]);if(spec.reports){for(const key in spec.reports)if(Object.prototype.hasOwnProperty.call(spec.reports,key)){const report=spec.reports[key];typeof report.files=="string"&&(report.files=[report.files])}}if(spec.artifacts){typeof spec.artifacts.files=="string"&&(spec.artifacts.files=[spec.artifacts.files]);for(const key in spec.artifacts["secondary-artifacts"])if(Object.prototype.hasOwnProperty.call(spec.artifacts["secondary-artifacts"],key)){const secArtifact=spec.artifacts["secondary-artifacts"][key];typeof secArtifact.files=="string"&&(secArtifact.files=[secArtifact.files])}}spec.cache&&typeof spec.cache.paths=="string"&&(spec.cache.paths=[spec.cache.paths])}function normalizeSpecPhase(phase){phase.commands&&typeof phase.commands=="string"&&(phase.commands=[phase.commands]),phase.finally&&typeof phase.finally=="string"&&(phase.finally=[phase.finally])}function mergeDeep(lhs,rhs){if(Array.isArray(lhs)&&Array.isArray(rhs))return[...lhs,...rhs];if(Array.isArray(lhs)||Array.isArray(rhs))return rhs;const isObject=obj=>obj&&typeof obj=="object";if(isObject(lhs)&&isObject(rhs)){const ret={...lhs};for(const k of Object.keys(rhs))ret[k]=k in lhs?mergeDeep(lhs[k],rhs[k]):rhs[k];return ret}return rhs}

View File

@@ -0,0 +1,62 @@
import type { CfnProject } from './codebuild.generated';
import type { IProject } from './project';
import type { IBucket } from '../../aws-s3';
export interface BucketCacheOptions {
/**
* The prefix to use to store the cache in the bucket
*/
readonly prefix?: string;
/**
* Defines the scope of the cache.
* You can use this namespace to share a cache across multiple projects.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/caching-s3.html#caching-s3-sharing
*
* @default undefined - No cache namespace, which means that the cache is not shared across multiple projects.
*/
readonly cacheNamespace?: string;
}
/**
* Local cache modes to enable for the CodeBuild Project
*/
export declare enum LocalCacheMode {
/**
* Caches Git metadata for primary and secondary sources
*/
SOURCE = "LOCAL_SOURCE_CACHE",
/**
* Caches existing Docker layers
*/
DOCKER_LAYER = "LOCAL_DOCKER_LAYER_CACHE",
/**
* Caches directories you specify in the buildspec file
*/
CUSTOM = "LOCAL_CUSTOM_CACHE"
}
/**
* Cache options for CodeBuild Project.
* A cache can store reusable pieces of your build environment and use them across multiple builds.
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-caching.html
*/
export declare abstract class Cache {
static none(): Cache;
/**
* Create a local caching strategy.
* @param modes the mode(s) to enable for local caching
*/
static local(...modes: LocalCacheMode[]): Cache;
/**
* Create an S3 caching strategy.
* @param bucket the S3 bucket to use for caching
* @param options additional options to pass to the S3 caching
*/
static bucket(bucket: IBucket, options?: BucketCacheOptions): Cache;
/**
* @internal
*/
abstract _toCloudFormation(): CfnProject.ProjectCacheProperty | undefined;
/**
* @internal
*/
abstract _bind(project: IProject): void;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Cache=exports.LocalCacheMode=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},LocalCacheMode;(function(LocalCacheMode2){LocalCacheMode2.SOURCE="LOCAL_SOURCE_CACHE",LocalCacheMode2.DOCKER_LAYER="LOCAL_DOCKER_LAYER_CACHE",LocalCacheMode2.CUSTOM="LOCAL_CUSTOM_CACHE"})(LocalCacheMode||(exports.LocalCacheMode=LocalCacheMode={}));class Cache{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.Cache",version:"2.252.0"};static none(){return{_toCloudFormation(){return{type:"NO_CACHE"}},_bind(){}}}static local(...modes){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_LocalCacheMode(modes)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.local),error}return{_toCloudFormation:()=>({type:"LOCAL",modes}),_bind:()=>{}}}static bucket(bucket,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_s3_IBucket(bucket),jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_BucketCacheOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bucket),error}return{_toCloudFormation:()=>({type:"S3",location:core_1().Fn.join("/",[bucket.bucketName,options&&options.prefix||core_1().Aws.NO_VALUE]),cacheNamespace:options?.cacheNamespace}),_bind:project=>{bucket.grantReadWrite(project)}}}}exports.Cache=Cache;

View File

@@ -0,0 +1,28 @@
export interface MetricWithDims<D> {
readonly namespace: string;
readonly metricName: string;
readonly statistic: string;
readonly dimensionsMap: D;
}
export declare class CodeBuildMetrics {
static succeededBuildsSum(this: void, dimensions: {
ProjectName: string;
}): MetricWithDims<{
ProjectName: string;
}>;
static failedBuildsSum(this: void, dimensions: {
ProjectName: string;
}): MetricWithDims<{
ProjectName: string;
}>;
static buildsSum(this: void, dimensions: {
ProjectName: string;
}): MetricWithDims<{
ProjectName: string;
}>;
static durationAverage(this: void, dimensions: {
ProjectName: string;
}): MetricWithDims<{
ProjectName: string;
}>;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeBuildMetrics=void 0;class CodeBuildMetrics{static succeededBuildsSum(dimensions){return{namespace:"AWS/CodeBuild",metricName:"SucceededBuilds",dimensionsMap:dimensions,statistic:"Sum"}}static failedBuildsSum(dimensions){return{namespace:"AWS/CodeBuild",metricName:"FailedBuilds",dimensionsMap:dimensions,statistic:"Sum"}}static buildsSum(dimensions){return{namespace:"AWS/CodeBuild",metricName:"Builds",dimensionsMap:dimensions,statistic:"Sum"}}static durationAverage(dimensions){return{namespace:"AWS/CodeBuild",metricName:"Duration",dimensionsMap:dimensions,statistic:"Average"}}}exports.CodeBuildMetrics=CodeBuildMetrics;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import { Artifacts } from './artifacts';
/**
* CodePipeline Artifact definition for a CodeBuild Project.
* *Note*: this type cannot be used as a secondary artifact,
* and because of that, you're not allowed to specify an identifier for it.
*/
export declare class CodePipelineArtifacts extends Artifacts {
readonly type = "CODEPIPELINE";
constructor();
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodePipelineArtifacts=void 0;var artifacts_1=()=>{var tmp=require("./artifacts");return artifacts_1=()=>tmp,tmp};class CodePipelineArtifacts extends artifacts_1().Artifacts{type="CODEPIPELINE";constructor(){super({})}}exports.CodePipelineArtifacts=CodePipelineArtifacts;

View File

@@ -0,0 +1,10 @@
import { Source } from './source';
/**
* CodePipeline Source definition for a CodeBuild Project.
* *Note*: this type cannot be used as a secondary source,
* and because of that, you're not allowed to specify an identifier for it.
*/
export declare class CodePipelineSource extends Source {
readonly type = "CODEPIPELINE";
constructor();
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodePipelineSource=void 0;var source_1=()=>{var tmp=require("./source");return source_1=()=>tmp,tmp},source_types_1=()=>{var tmp=require("./source-types");return source_types_1=()=>tmp,tmp};class CodePipelineSource extends source_1().Source{type=source_types_1().CODEPIPELINE_SOURCE_ARTIFACTS_TYPE;constructor(){super({})}}exports.CodePipelineSource=CodePipelineSource;

View File

@@ -0,0 +1,74 @@
/**
* Build machine compute type.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
*/
export declare enum ComputeType {
SMALL = "BUILD_GENERAL1_SMALL",
MEDIUM = "BUILD_GENERAL1_MEDIUM",
LARGE = "BUILD_GENERAL1_LARGE",
X_LARGE = "BUILD_GENERAL1_XLARGE",
X2_LARGE = "BUILD_GENERAL1_2XLARGE",
LAMBDA_1GB = "BUILD_LAMBDA_1GB",
LAMBDA_2GB = "BUILD_LAMBDA_2GB",
LAMBDA_4GB = "BUILD_LAMBDA_4GB",
LAMBDA_8GB = "BUILD_LAMBDA_8GB",
LAMBDA_10GB = "BUILD_LAMBDA_10GB",
ATTRIBUTE_BASED = "ATTRIBUTE_BASED_COMPUTE",
CUSTOM_INSTANCE_TYPE = "CUSTOM_INSTANCE_TYPE"
}
/**
* Docker server compute type.
*
* @see https://docs.aws.amazon.com/codebuild/latest/APIReference/API_DockerServer.html
*/
export declare enum DockerServerComputeType {
/**
* BUILD_GENERAL1_SMALL
*/
SMALL = "BUILD_GENERAL1_SMALL",
/**
* BUILD_GENERAL1_MEDIUM
*/
MEDIUM = "BUILD_GENERAL1_MEDIUM",
/**
* BUILD_GENERAL1_LARGE
*/
LARGE = "BUILD_GENERAL1_LARGE",
/**
* BUILD_GENERAL1_XLARGE
*/
X_LARGE = "BUILD_GENERAL1_XLARGE",
/**
* BUILD_GENERAL1_2XLARGE
*/
X2_LARGE = "BUILD_GENERAL1_2XLARGE",
/**
* ATTRIBUTE_BASED_COMPUTE
*/
ATTRIBUTE_BASED_COMPUTE = "ATTRIBUTE_BASED_COMPUTE",
/**
* BUILD_LAMBDA_10GB
*/
BUILD_LAMBDA_10GB = "BUILD_LAMBDA_10GB",
/**
* BUILD_LAMBDA_1GB
*/
BUILD_LAMBDA_1GB = "BUILD_LAMBDA_1GB",
/**
* BUILD_LAMBDA_2GB
*/
BUILD_LAMBDA_2GB = "BUILD_LAMBDA_2GB",
/**
* BUILD_LAMBDA_4GB
*/
BUILD_LAMBDA_4GB = "BUILD_LAMBDA_4GB",
/**
* BUILD_LAMBDA_8GB
*/
BUILD_LAMBDA_8GB = "BUILD_LAMBDA_8GB",
/**
* CUSTOM_INSTANCE_TYPE
*/
CUSTOM_INSTANCE_TYPE = "CUSTOM_INSTANCE_TYPE"
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DockerServerComputeType=exports.ComputeType=void 0;var ComputeType;(function(ComputeType2){ComputeType2.SMALL="BUILD_GENERAL1_SMALL",ComputeType2.MEDIUM="BUILD_GENERAL1_MEDIUM",ComputeType2.LARGE="BUILD_GENERAL1_LARGE",ComputeType2.X_LARGE="BUILD_GENERAL1_XLARGE",ComputeType2.X2_LARGE="BUILD_GENERAL1_2XLARGE",ComputeType2.LAMBDA_1GB="BUILD_LAMBDA_1GB",ComputeType2.LAMBDA_2GB="BUILD_LAMBDA_2GB",ComputeType2.LAMBDA_4GB="BUILD_LAMBDA_4GB",ComputeType2.LAMBDA_8GB="BUILD_LAMBDA_8GB",ComputeType2.LAMBDA_10GB="BUILD_LAMBDA_10GB",ComputeType2.ATTRIBUTE_BASED="ATTRIBUTE_BASED_COMPUTE",ComputeType2.CUSTOM_INSTANCE_TYPE="CUSTOM_INSTANCE_TYPE"})(ComputeType||(exports.ComputeType=ComputeType={}));var DockerServerComputeType;(function(DockerServerComputeType2){DockerServerComputeType2.SMALL="BUILD_GENERAL1_SMALL",DockerServerComputeType2.MEDIUM="BUILD_GENERAL1_MEDIUM",DockerServerComputeType2.LARGE="BUILD_GENERAL1_LARGE",DockerServerComputeType2.X_LARGE="BUILD_GENERAL1_XLARGE",DockerServerComputeType2.X2_LARGE="BUILD_GENERAL1_2XLARGE",DockerServerComputeType2.ATTRIBUTE_BASED_COMPUTE="ATTRIBUTE_BASED_COMPUTE",DockerServerComputeType2.BUILD_LAMBDA_10GB="BUILD_LAMBDA_10GB",DockerServerComputeType2.BUILD_LAMBDA_1GB="BUILD_LAMBDA_1GB",DockerServerComputeType2.BUILD_LAMBDA_2GB="BUILD_LAMBDA_2GB",DockerServerComputeType2.BUILD_LAMBDA_4GB="BUILD_LAMBDA_4GB",DockerServerComputeType2.BUILD_LAMBDA_8GB="BUILD_LAMBDA_8GB",DockerServerComputeType2.CUSTOM_INSTANCE_TYPE="CUSTOM_INSTANCE_TYPE"})(DockerServerComputeType||(exports.DockerServerComputeType=DockerServerComputeType={}));

View File

@@ -0,0 +1,25 @@
/**
* Build environment type.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
*/
export declare enum EnvironmentType {
/** ARM container */
ARM_CONTAINER = "ARM_CONTAINER",
/** Linux container */
LINUX_CONTAINER = "LINUX_CONTAINER",
/** Linux GPU container */
LINUX_GPU_CONTAINER = "LINUX_GPU_CONTAINER",
/** Windows Server 2019 container */
WINDOWS_SERVER_2019_CONTAINER = "WINDOWS_SERVER_2019_CONTAINER",
/** Windows Server 2022 container */
WINDOWS_SERVER_2022_CONTAINER = "WINDOWS_SERVER_2022_CONTAINER",
/** MacOS ARM container */
MAC_ARM = "MAC_ARM",
/** Linux EC2 */
LINUX_EC2 = "LINUX_EC2",
/** ARM EC2 */
ARM_EC2 = "ARM_EC2",
/** Windows EC2 */
WINDOWS_EC2 = "WINDOWS_EC2"
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EnvironmentType=void 0;var EnvironmentType;(function(EnvironmentType2){EnvironmentType2.ARM_CONTAINER="ARM_CONTAINER",EnvironmentType2.LINUX_CONTAINER="LINUX_CONTAINER",EnvironmentType2.LINUX_GPU_CONTAINER="LINUX_GPU_CONTAINER",EnvironmentType2.WINDOWS_SERVER_2019_CONTAINER="WINDOWS_SERVER_2019_CONTAINER",EnvironmentType2.WINDOWS_SERVER_2022_CONTAINER="WINDOWS_SERVER_2022_CONTAINER",EnvironmentType2.MAC_ARM="MAC_ARM",EnvironmentType2.LINUX_EC2="LINUX_EC2",EnvironmentType2.ARM_EC2="ARM_EC2",EnvironmentType2.WINDOWS_EC2="WINDOWS_EC2"})(EnvironmentType||(exports.EnvironmentType=EnvironmentType={}));

View File

@@ -0,0 +1,53 @@
/**
* Event fields for the CodeBuild "state change" event
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html#sample-build-notifications-ref
*/
export declare class StateChangeEvent {
/**
* The triggering build's status
*/
static get buildStatus(): string;
/**
* The triggering build's project name
*/
static get projectName(): string;
/**
* Return the build id
*/
static get buildId(): string;
static get currentPhase(): string;
private constructor();
}
/**
* Event fields for the CodeBuild "phase change" event
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html#sample-build-notifications-ref
*/
export declare class PhaseChangeEvent {
/**
* The triggering build's project name
*/
static get projectName(): string;
/**
* The triggering build's id
*/
static get buildId(): string;
/**
* The phase that was just completed
*/
static get completedPhase(): string;
/**
* The status of the completed phase
*/
static get completedPhaseStatus(): string;
/**
* The duration of the completed phase
*/
static get completedPhaseDurationSeconds(): string;
/**
* Whether the build is complete
*/
static get buildComplete(): string;
private constructor();
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PhaseChangeEvent=exports.StateChangeEvent=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var events=()=>{var tmp=require("../../aws-events");return events=()=>tmp,tmp};class StateChangeEvent{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.StateChangeEvent",version:"2.252.0"};static get buildStatus(){return events().EventField.fromPath("$.detail.build-status")}static get projectName(){return events().EventField.fromPath("$.detail.project-name")}static get buildId(){return events().EventField.fromPath("$.detail.build-id")}static get currentPhase(){return events().EventField.fromPath("$.detail.current-phase")}constructor(){}}exports.StateChangeEvent=StateChangeEvent;class PhaseChangeEvent{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.PhaseChangeEvent",version:"2.252.0"};static get projectName(){return events().EventField.fromPath("$.detail.project-name")}static get buildId(){return events().EventField.fromPath("$.detail.build-id")}static get completedPhase(){return events().EventField.fromPath("$.detail.completed-phase")}static get completedPhaseStatus(){return events().EventField.fromPath("$.detail.completed-phase-status")}static get completedPhaseDurationSeconds(){return events().EventField.fromPath("$.detail.completed-phase-duration-seconds")}static get buildComplete(){return events().EventField.fromPath("$.detail.build-complete")}constructor(){}}exports.PhaseChangeEvent=PhaseChangeEvent;

View File

@@ -0,0 +1,58 @@
import type { Construct } from 'constructs';
import type { CfnProject } from './codebuild.generated';
import type { IProject } from './project';
/**
* The type returned from `IFileSystemLocation#bind`.
*/
export interface FileSystemConfig {
/**
* File system location wrapper property.
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html
*/
readonly location: CfnProject.ProjectFileSystemLocationProperty;
}
/**
* The interface of a CodeBuild FileSystemLocation.
* Implemented by `EfsFileSystemLocation`.
*/
export interface IFileSystemLocation {
/**
* Called by the project when a file system is added so it can perform
* binding operations on this file system location.
*/
bind(scope: Construct, project: IProject): FileSystemConfig;
}
/**
* FileSystemLocation provider definition for a CodeBuild Project.
*/
export declare class FileSystemLocation {
/**
* EFS file system provider.
* @param props the EFS File System location property.
*/
static efs(props: EfsFileSystemLocationProps): IFileSystemLocation;
}
/**
* Construction properties for `EfsFileSystemLocation`.
*/
export interface EfsFileSystemLocationProps {
/**
* The name used to access a file system created by Amazon EFS.
*/
readonly identifier: string;
/**
* A string that specifies the location of the file system, like Amazon EFS.
*
* This value looks like `fs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory`.
*/
readonly location: string;
/**
* The mount options for a file system such as Amazon EFS.
* @default 'nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2'.
*/
readonly mountOptions?: string;
/**
* The location in the container where you mount the file system.
*/
readonly mountPoint: string;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileSystemLocation=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class FileSystemLocation{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.FileSystemLocation",version:"2.252.0"};static efs(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_EfsFileSystemLocationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.efs),error}return new EfsFileSystemLocation(props)}}exports.FileSystemLocation=FileSystemLocation;class EfsFileSystemLocation{props;constructor(props){this.props=props}bind(_scope,_project){return{location:{identifier:this.props.identifier,location:this.props.location,mountOptions:this.props.mountOptions,mountPoint:this.props.mountPoint,type:"EFS"}}}}

View File

@@ -0,0 +1,313 @@
import type { Construct } from 'constructs';
import type { EnvironmentType } from './environment-type';
import * as ec2 from '../../aws-ec2';
import * as iam from '../../aws-iam';
import type { IResource, Size } from '../../core';
import { Resource } from '../../core';
import type { IFleetRef, FleetReference } from '../../interfaces/generated/aws-codebuild-interfaces.generated';
/**
* Construction properties of a CodeBuild Fleet.
*/
export interface FleetProps {
/**
* The name of the Fleet.
*
* @default - CloudFormation generated name
*/
readonly fleetName?: string;
/**
* The number of machines allocated to the compute fleet.
* Defines the number of builds that can run in parallel.
*
* Minimum value of 1.
*/
readonly baseCapacity: number;
/**
* The instance type of the compute fleet.
*
* @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.ComputeType.html
*/
readonly computeType: FleetComputeType;
/**
* The build environment (operating system/architecture/accelerator) type
* made available to projects using this fleet
*/
readonly environmentType: EnvironmentType;
/**
* The compute configuration of the compute fleet.
*
* This is only permitted if `computeType` is set to ATTRIBUTE_BASED or
* CUSTOM_INSTANCE_TYPE. In such cases, this is required.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types
*
* @default - do not specify compute configuration
*/
readonly computeConfiguration?: ComputeConfiguration;
/**
* The compute fleet overflow behavior.
*
* For overflow behavior `QUEUE`, overflow builds need to wait on the existing fleet instances to become available.
*
* For overflow behavior `ON_DEMAND`, overflow builds run on CodeBuild on-demand.
*
* @default undefined - AWS CodeBuild default behavior is QUEUE
*/
readonly overflowBehavior?: FleetOverflowBehavior;
/**
* Service Role assumed by Fleet instances.
*
* This Role is not used by Project builds running on Fleet instances; Project
* builds assume the `role` on Project instead.
*
* @default - A role will be created if any permissions are granted
*/
readonly role?: iam.IRole;
/**
* VPC network to place fleet instance network interfaces.
*
* Specify this if the fleet needs to access resources in a VPC.
*
* @default - No VPC is specified.
*/
readonly vpc?: ec2.IVpc;
/**
* Where to place the network interfaces within the VPC.
*
* To access AWS services, your fleet needs to be in one of the following types of subnets:
*
* 1. Subnets with access to the internet (of type PRIVATE_WITH_EGRESS).
* 2. Private subnets unconnected to the internet, but with [VPC endpoints](https://docs.aws.amazon.com/codebuild/latest/userguide/use-vpc-endpoints-with-codebuild.html) for the necessary services.
*
* If you don't specify a subnet selection, the default behavior is to use PRIVATE_WITH_EGRESS subnets first if they exist,
* then PRIVATE_WITHOUT_EGRESS, and finally PUBLIC subnets. If your VPC doesn't have PRIVATE_WITH_EGRESS subnets but you need
* AWS service access, add VPC Endpoints to your private subnets.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/vpc-support.html
*
* @default - private subnets if available else public subnets
*/
readonly subnetSelection?: ec2.SubnetSelection;
/**
* What security groups to associate with the fleet's network interfaces.
* If none are provided, one will be created automatically.
*
* Only used if `vpc` is supplied.
*
* @default - A security group will be automatically created.
*/
readonly securityGroups?: ec2.ISecurityGroup[];
}
/**
* The compute type of the fleet.
*/
export declare enum MachineType {
/**
* General purpose compute type.
*/
GENERAL = "GENERAL",
/**
* Non-Volatile Memory Express (NVMe) storage optimized compute type.
*/
NVME = "NVME"
}
/**
* The compute configuration for the fleet.
*/
export interface ComputeConfiguration {
/**
* When using ATTRIBUTE_BASED, the amount of disk
* space of the instance type included in your fleet. When using CUSTOM_INSTANCE_TYPE,
* the additional amount of disk space to provision over the 64GB included by
* default.
*
* @default - No requirement, the actual value will be based on the other selected configuration properties
*/
readonly disk?: Size;
/**
* When using ATTRIBUTE_BASED, the machine type of the instance type included in your fleet.
*
* @default - No requirement, the actual value will be based on the other selected configuration properties
*/
readonly machineType?: MachineType;
/**
* When using ATTRIBUTE_BASED, the amount of memory of the instance type included in your fleet.
*
* @default - No requirement, the actual value will be based on the other selected configuration properties
*/
readonly memory?: Size;
/**
* When using ATTRIBUTE_BASED, the number of vCPUs of the instance type included in your fleet.
*
* @default - No requirement, the actual value will be based on the other selected configuration properties
*/
readonly vCpu?: number;
/**
* When using CUSTOM_INSTANCE_TYPE, the EC2 instance type to use for fleet instances.
*
* Not all instance types are supported by CodeBuild. If you use a disallowed type, the
* CloudFormation deployment will fail.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.instance-types
* @default none
*/
readonly instanceType?: ec2.InstanceType;
}
/**
* Represents a Fleet for a reserved capacity CodeBuild project.
*/
export interface IFleet extends IResource, iam.IGrantable, ec2.IConnectable, IFleetRef {
/**
* The ARN of the fleet.
* @attribute
*/
readonly fleetArn: string;
/**
* The name of the fleet.
* @attribute
*/
readonly fleetName: string;
/**
* The compute type of the fleet.
*
* @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.ComputeType.html
*/
readonly computeType: FleetComputeType;
/**
* The build environment (operating system/architecture/accelerator) type
* made available to projects using this fleet
*/
readonly environmentType: EnvironmentType;
}
/**
* Fleet for a reserved capacity CodeBuild project.
*
* Fleets allow for process builds or tests to run immediately and reduces build durations,
* by reserving compute resources for your projects.
*
* You will be charged for the resources in the fleet, even if they are idle.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/fleets.html
*/
export declare class Fleet extends Resource implements IFleet {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* Creates a Fleet construct that represents an external fleet.
*
* @param scope The scope creating construct (usually `this`).
* @param id The construct's id.
* @param fleetArn The ARN of the fleet.
*/
static fromFleetArn(scope: Construct, id: string, fleetArn: string): IFleet;
/**
* The ARN of the fleet.
*/
get fleetArn(): string;
/**
* The name of the fleet.
*/
get fleetName(): string;
/**
* The compute type of the fleet.
*
* @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.ComputeType.html
*/
readonly computeType: FleetComputeType;
/**
* The build environment (operating system/architecture/accelerator) type
* made available to projects using this fleet
*/
readonly environmentType: EnvironmentType;
get fleetRef(): FleetReference;
private _connections?;
private readonly resource;
/**
* The network connections associated with this Fleet's security group(s) in
* the configured VPC.
*/
get connections(): ec2.Connections;
private role;
/**
* The grant principal for this Fleet's service role.
*/
get grantPrincipal(): iam.IPrincipal;
constructor(scope: Construct, id: string, props: FleetProps);
private validatePositiveInteger;
private configureVpc;
}
/**
* Fleet build machine compute type. Subset of Fleet compatible ComputeType values.
*
* The allocated memory, vCPU count and disk space of the build machine for a
* given compute type are dependent on the environment type.
* Some compute types may also not be available for all environment types.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
*/
export declare enum FleetComputeType {
/**
* Small compute type
*
* May not be available for all environment types.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
*/
SMALL = "BUILD_GENERAL1_SMALL",
/**
* Medium compute type
*
* May not be available for all environment types.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
*/
MEDIUM = "BUILD_GENERAL1_MEDIUM",
/** Large compute type */
LARGE = "BUILD_GENERAL1_LARGE",
/**
* Extra Large compute type
*
* May not be available for all environment types.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
*/
X_LARGE = "BUILD_GENERAL1_XLARGE",
/**
* Extra, Extra Large compute type
*
* May not be available for all environment types.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
*/
X2_LARGE = "BUILD_GENERAL1_2XLARGE",
/**
* Specify the amount of vCPUs, memory, disk space, and the type of machine.
*
* AWS CodeBuild will select the cheapest instance that satisfies your specified attributes from `computeConfiguration`.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types
*/
ATTRIBUTE_BASED = "ATTRIBUTE_BASED_COMPUTE",
/**
* Specify a specific EC2 instance type to use for compute.
*
* You must set `instanceType` on `computeConfiguration`, and optionally set a
* `disk` size if the provided 64GB is insufficient.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.instance-types
*/
CUSTOM_INSTANCE_TYPE = "CUSTOM_INSTANCE_TYPE"
}
/**
* The compute fleet overflow behavior.
*/
export declare enum FleetOverflowBehavior {
/**
* Overflow builds wait for existing fleet instances to become available.
*/
QUEUE = "QUEUE",
/**
* Overflow builds run on CodeBuild on-demand instances.
*/
ON_DEMAND = "ON_DEMAND"
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
/**
* The type of principal CodeBuild will use to pull your build Docker image.
*/
export declare enum ImagePullPrincipalType {
/**
* CODEBUILD specifies that CodeBuild uses its own identity when pulling the image.
* This means the resource policy of the ECR repository that hosts the image will be modified to trust
* CodeBuild's service principal.
* This is the required principal type when using CodeBuild's pre-defined images.
*/
CODEBUILD = "CODEBUILD",
/**
* SERVICE_ROLE specifies that AWS CodeBuild uses the project's role when pulling the image.
* The role will be granted pull permissions on the ECR repository hosting the image.
*/
SERVICE_ROLE = "SERVICE_ROLE"
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ImagePullPrincipalType=void 0;var ImagePullPrincipalType;(function(ImagePullPrincipalType2){ImagePullPrincipalType2.CODEBUILD="CODEBUILD",ImagePullPrincipalType2.SERVICE_ROLE="SERVICE_ROLE"})(ImagePullPrincipalType||(exports.ImagePullPrincipalType=ImagePullPrincipalType={}));

View File

@@ -0,0 +1,21 @@
export * from './events';
export * from './pipeline-project';
export * from './project';
export * from './project-logs';
export * from './report-group';
export * from './source';
export * from './source-credentials';
export * from './artifacts';
export * from './cache';
export * from './build-spec';
export * from './file-location';
export * from './linux-gpu-build-image';
export * from './untrusted-code-boundary-policy';
export * from './linux-arm-build-image';
export * from './image-pull-principal-type';
export * from './linux-lambda-build-image';
export * from './linux-arm-lambda-build-image';
export * from './compute-type';
export * from './environment-type';
export * from './fleet';
export * from './codebuild.generated';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
import { ComputeType } from './compute-type';
export declare function isLambdaComputeType(computeType: ComputeType): boolean;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isLambdaComputeType=isLambdaComputeType;var compute_type_1=()=>{var tmp=require("./compute-type");return compute_type_1=()=>tmp,tmp};function isLambdaComputeType(computeType){return Object.values(compute_type_1().ComputeType).filter(value=>value.startsWith("BUILD_LAMBDA")).includes(computeType)}

View File

@@ -0,0 +1,74 @@
import type { BuildSpec } from './build-spec';
import { ComputeType } from './compute-type';
import { ImagePullPrincipalType } from './image-pull-principal-type';
import type { BuildEnvironment, IBuildImage, DockerImageOptions } from './project';
import type * as ecr from '../../aws-ecr';
import type * as secretsmanager from '../../aws-secretsmanager';
/**
* A CodeBuild image running aarch64 Linux.
*
* This class has a bunch of public constants that represent the CodeBuild ARM images.
*
* You can also specify a custom image using the static method:
*
* - LinuxBuildImage.fromEcrRepository(repo[, tag])
* - LinuxBuildImage.fromDockerRegistry(image[, { secretsManagerCredentials }])
*
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
*/
export declare class LinuxArmBuildImage implements IBuildImage {
/**
* Image "aws/codebuild/amazonlinux2-aarch64-standard:1.0".
* @deprecated Use {@link LinuxArmBuildImage.AMAZON_LINUX_2_STANDARD_3_0} instead.
* */
static readonly AMAZON_LINUX_2_STANDARD_1_0: IBuildImage;
/** Image "aws/codebuild/amazonlinux2-aarch64-standard:2.0" based on Amazon Linux 2. */
static readonly AMAZON_LINUX_2_STANDARD_2_0: IBuildImage;
/** Image "aws/codebuild/amazonlinux2-aarch64-standard:3.0" based on Amazon Linux 2023. */
static readonly AMAZON_LINUX_2_STANDARD_3_0: IBuildImage;
/** Image "aws/codebuild/amazonlinux-aarch64-standard:2.0" based on Amazon Linux 2023. */
static readonly AMAZON_LINUX_2023_STANDARD_2_0: IBuildImage;
/** Image "aws/codebuild/amazonlinux-aarch64-standard:3.0" based on Amazon Linux 2023. */
static readonly AMAZON_LINUX_2023_STANDARD_3_0: IBuildImage;
/**
* @returns a aarch-64 Linux build image from a Docker Hub image.
*/
static fromDockerRegistry(name: string, options?: DockerImageOptions): IBuildImage;
/**
* Returns an ARM image running Linux from an ECR repository.
*
* NOTE: if the repository is external (i.e. imported), then we won't be able to add
* a resource policy statement for it so CodeBuild can pull the image.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-ecr.html
*
* @param repository The ECR repository
* @param tagOrDigest Image tag or digest (default "latest", digests must start with `sha256:`)
* @returns An aarch64 Linux build image from an ECR repository.
*/
static fromEcrRepository(repository: ecr.IRepository, tagOrDigest?: string): IBuildImage;
/**
* Uses a Docker image provided by CodeBuild.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
*
* @param id The image identifier
* @example 'aws/codebuild/amazonlinux2-aarch64-standard:1.0'
* @returns A Docker image provided by CodeBuild.
*/
static fromCodeBuildImageId(id: string): IBuildImage;
readonly type: string;
readonly defaultComputeType = ComputeType.LARGE;
readonly imageId: string;
readonly imagePullPrincipalType?: ImagePullPrincipalType;
readonly secretsManagerCredentials?: secretsmanager.ISecret;
readonly repository?: ecr.IRepository;
private constructor();
/**
* Validates by checking the BuildEnvironments' images are not Lambda ComputeTypes
* @param buildEnvironment BuildEnvironment
*/
validate(buildEnvironment: BuildEnvironment): string[];
runScriptBuildspec(entrypoint: string): BuildSpec;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinuxArmBuildImage=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var compute_type_1=()=>{var tmp=require("./compute-type");return compute_type_1=()=>tmp,tmp},environment_type_1=()=>{var tmp=require("./environment-type");return environment_type_1=()=>tmp,tmp},image_pull_principal_type_1=()=>{var tmp=require("./image-pull-principal-type");return image_pull_principal_type_1=()=>tmp,tmp},is_lambda_compute_type_1=()=>{var tmp=require("./is-lambda-compute-type");return is_lambda_compute_type_1=()=>tmp,tmp},run_script_linux_build_spec_1=()=>{var tmp=require("./private/run-script-linux-build-spec");return run_script_linux_build_spec_1=()=>tmp,tmp};class LinuxArmBuildImage{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.LinuxArmBuildImage",version:"2.252.0"};static AMAZON_LINUX_2_STANDARD_1_0=LinuxArmBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux2-aarch64-standard:1.0");static AMAZON_LINUX_2_STANDARD_2_0=LinuxArmBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux2-aarch64-standard:2.0");static AMAZON_LINUX_2_STANDARD_3_0=LinuxArmBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux2-aarch64-standard:3.0");static AMAZON_LINUX_2023_STANDARD_2_0=LinuxArmBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-standard:2.0");static AMAZON_LINUX_2023_STANDARD_3_0=LinuxArmBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-standard:3.0");static fromDockerRegistry(name,options={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_DockerImageOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromDockerRegistry),error}return new LinuxArmBuildImage({...options,imageId:name,imagePullPrincipalType:image_pull_principal_type_1().ImagePullPrincipalType.SERVICE_ROLE})}static fromEcrRepository(repository,tagOrDigest="latest"){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecr_IRepository(repository)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromEcrRepository),error}return new LinuxArmBuildImage({imageId:repository.repositoryUriForTagOrDigest(tagOrDigest),imagePullPrincipalType:image_pull_principal_type_1().ImagePullPrincipalType.SERVICE_ROLE,repository})}static fromCodeBuildImageId(id){return new LinuxArmBuildImage({imageId:id,imagePullPrincipalType:image_pull_principal_type_1().ImagePullPrincipalType.CODEBUILD})}type=environment_type_1().EnvironmentType.ARM_CONTAINER;defaultComputeType=compute_type_1().ComputeType.LARGE;imageId;imagePullPrincipalType;secretsManagerCredentials;repository;constructor(props){this.imageId=props.imageId,this.imagePullPrincipalType=props.imagePullPrincipalType,this.secretsManagerCredentials=props.secretsManagerCredentials,this.repository=props.repository}validate(buildEnvironment){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_BuildEnvironment(buildEnvironment)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.validate),error}const ret=[];return buildEnvironment.computeType&&(0,is_lambda_compute_type_1().isLambdaComputeType)(buildEnvironment.computeType)&&ret.push(`ARM images do not support Lambda ComputeTypes, got ${buildEnvironment.computeType}`),ret}runScriptBuildspec(entrypoint){return(0,run_script_linux_build_spec_1().runScriptLinuxBuildSpec)(entrypoint)}}exports.LinuxArmBuildImage=LinuxArmBuildImage;

View File

@@ -0,0 +1,60 @@
import type { BuildSpec } from './build-spec';
import { ComputeType } from './compute-type';
import type { BuildEnvironment, IBuildImage } from './project';
/**
* A CodeBuild image running aarch64 Lambda.
*
* This class has a bunch of public constants that represent the CodeBuild aarch64 Lambda images.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
*/
export declare class LinuxArmLambdaBuildImage implements IBuildImage {
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:nodejs18` build image. */
static readonly AMAZON_LINUX_2_NODE_18: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:nodejs20` build image. */
static readonly AMAZON_LINUX_2023_NODE_20: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:nodejs22` build image. */
static readonly AMAZON_LINUX_2023_NODE_22: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.11` build image. */
static readonly AMAZON_LINUX_2_PYTHON_3_11: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.12` build image. */
static readonly AMAZON_LINUX_2023_PYTHON_3_12: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.13` build image. */
static readonly AMAZON_LINUX_2023_PYTHON_3_13: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:ruby3.2` build image. */
static readonly AMAZON_LINUX_2_RUBY_3_2: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:ruby3.4` build image. */
static readonly AMAZON_LINUX_2023_RUBY_3_4: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:corretto21` build image. */
static readonly AMAZON_LINUX_2023_CORRETTO_21: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:corretto17` build image. */
static readonly AMAZON_LINUX_2_CORRETTO_17: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:corretto11` build image. */
static readonly AMAZON_LINUX_2_CORRETTO_11: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:go1.21` build image. */
static readonly AMAZON_LINUX_2_GO_1_21: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:go1.24` build image. */
static readonly AMAZON_LINUX_2023_GO_1_24: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:dotnet6` build image. */
static readonly AMAZON_LINUX_2_DOTNET_6: IBuildImage;
/** The `aws/codebuild/amazonlinux-aarch64-lambda-standard:dotnet8` build image. */
static readonly AMAZON_LINUX_2023_DOTNET_8: IBuildImage;
/**
* Uses a Docker image provided by CodeBuild.
*
* NOTE: In Lambda compute, since only specified images can be used, this method is set to private.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
*
* @param id The image identifier
* @example 'aws/codebuild/amazonlinux-aarch64-lambda-standard:nodejs18'
* @returns A Docker image provided by CodeBuild.
*/
private static fromCodeBuildImageId;
readonly type = "ARM_LAMBDA_CONTAINER";
readonly defaultComputeType = ComputeType.LAMBDA_1GB;
readonly imageId: string;
private constructor();
validate(buildEnvironment: BuildEnvironment): string[];
runScriptBuildspec(entrypoint: string): BuildSpec;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinuxArmLambdaBuildImage=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var compute_type_1=()=>{var tmp=require("./compute-type");return compute_type_1=()=>tmp,tmp},is_lambda_compute_type_1=()=>{var tmp=require("./is-lambda-compute-type");return is_lambda_compute_type_1=()=>tmp,tmp},run_script_linux_build_spec_1=()=>{var tmp=require("./private/run-script-linux-build-spec");return run_script_linux_build_spec_1=()=>tmp,tmp};class LinuxArmLambdaBuildImage{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.LinuxArmLambdaBuildImage",version:"2.252.0"};static AMAZON_LINUX_2_NODE_18=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:nodejs18");static AMAZON_LINUX_2023_NODE_20=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:nodejs20");static AMAZON_LINUX_2023_NODE_22=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:nodejs22");static AMAZON_LINUX_2_PYTHON_3_11=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.11");static AMAZON_LINUX_2023_PYTHON_3_12=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.12");static AMAZON_LINUX_2023_PYTHON_3_13=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:python3.13");static AMAZON_LINUX_2_RUBY_3_2=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:ruby3.2");static AMAZON_LINUX_2023_RUBY_3_4=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:ruby3.4");static AMAZON_LINUX_2023_CORRETTO_21=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:corretto21");static AMAZON_LINUX_2_CORRETTO_17=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:corretto17");static AMAZON_LINUX_2_CORRETTO_11=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:corretto11");static AMAZON_LINUX_2_GO_1_21=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:go1.21");static AMAZON_LINUX_2023_GO_1_24=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:go1.24");static AMAZON_LINUX_2_DOTNET_6=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:dotnet6");static AMAZON_LINUX_2023_DOTNET_8=LinuxArmLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-aarch64-lambda-standard:dotnet8");static fromCodeBuildImageId(id){return new LinuxArmLambdaBuildImage({imageId:id})}type="ARM_LAMBDA_CONTAINER";defaultComputeType=compute_type_1().ComputeType.LAMBDA_1GB;imageId;constructor(props){this.imageId=props.imageId}validate(buildEnvironment){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_BuildEnvironment(buildEnvironment)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.validate),error}const errors=[];return buildEnvironment.privileged&&errors.push("Lambda compute type does not support privileged mode"),buildEnvironment.computeType&&!(0,is_lambda_compute_type_1().isLambdaComputeType)(buildEnvironment.computeType)&&errors.push(["Lambda images only support Lambda ComputeTypes between",`'${compute_type_1().ComputeType.LAMBDA_1GB}'`,"and",`'${compute_type_1().ComputeType.LAMBDA_10GB}',`,`got '${buildEnvironment.computeType}'`].join(" ")),errors}runScriptBuildspec(entrypoint){return(0,run_script_linux_build_spec_1().runScriptLinuxBuildSpec)(entrypoint)}}exports.LinuxArmLambdaBuildImage=LinuxArmLambdaBuildImage;

View File

@@ -0,0 +1,84 @@
import type { Construct } from 'constructs';
import type { BuildSpec } from './build-spec';
import { ComputeType } from './compute-type';
import { ImagePullPrincipalType } from './image-pull-principal-type';
import type { BuildEnvironment, BuildImageBindOptions, BuildImageConfig, IBindableBuildImage, IBuildImage, IProject } from './project';
import * as ecr from '../../aws-ecr';
/**
* A CodeBuild GPU image running Linux.
*
* This class has public constants that represent the most popular GPU images from AWS Deep Learning Containers.
*
* @see https://aws.amazon.com/releasenotes/available-deep-learning-containers-images
*/
export declare class LinuxGpuBuildImage implements IBindableBuildImage {
private readonly repositoryName;
private readonly account;
/** Tensorflow 1.14.0 GPU image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_1_14_0: IBuildImage;
/** Tensorflow 1.15.0 GPU image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_1_15_0: IBuildImage;
/** Tensorflow 1.15.2 GPU training image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_1_15_2_TRAINING: IBuildImage;
/** Tensorflow 1.15.2 GPU inference image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_1_15_2_INFERENCE: IBuildImage;
/** Tensorflow 2.0.0 GPU image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_2_0_0: IBuildImage;
/** Tensorflow 2.0.1 GPU image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_2_0_1: IBuildImage;
/** Tensorflow 2.1.0 GPU training image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_2_1_0_TRAINING: IBuildImage;
/** Tensorflow 2.1.0 GPU inference image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_2_1_0_INFERENCE: IBuildImage;
/** Tensorflow 2.2.0 GPU training image from AWS Deep Learning Containers. */
static readonly DLC_TENSORFLOW_2_2_0_TRAINING: IBuildImage;
/** PyTorch 1.2.0 GPU image from AWS Deep Learning Containers. */
static readonly DLC_PYTORCH_1_2_0: IBuildImage;
/** PyTorch 1.3.1 GPU image from AWS Deep Learning Containers. */
static readonly DLC_PYTORCH_1_3_1: IBuildImage;
/** PyTorch 1.4.0 GPU training image from AWS Deep Learning Containers. */
static readonly DLC_PYTORCH_1_4_0_TRAINING: IBuildImage;
/** PyTorch 1.4.0 GPU inference image from AWS Deep Learning Containers. */
static readonly DLC_PYTORCH_1_4_0_INFERENCE: IBuildImage;
/** PyTorch 1.5.0 GPU training image from AWS Deep Learning Containers. */
static readonly DLC_PYTORCH_1_5_0_TRAINING: IBuildImage;
/** PyTorch 1.5.0 GPU inference image from AWS Deep Learning Containers. */
static readonly DLC_PYTORCH_1_5_0_INFERENCE: IBuildImage;
/** MXNet 1.4.1 GPU image from AWS Deep Learning Containers. */
static readonly DLC_MXNET_1_4_1: IBuildImage;
/** MXNet 1.6.0 GPU image from AWS Deep Learning Containers. */
static readonly DLC_MXNET_1_6_0: IBuildImage;
/**
* Returns a Linux GPU build image from AWS Deep Learning Containers.
*
* @param repositoryName the name of the repository,
* for example "pytorch-inference"
* @param tag the tag of the image, for example "1.5.0-gpu-py36-cu101-ubuntu16.04"
* @param account the AWS account ID where the DLC repository for this region is hosted in.
* In many cases, the CDK can infer that for you, but for some newer region our information
* might be out of date; in that case, you can specify the region explicitly using this optional parameter
* @see https://aws.amazon.com/releasenotes/available-deep-learning-containers-images
*/
static awsDeepLearningContainersImage(repositoryName: string, tag: string, account?: string): IBuildImage;
/**
* Returns a GPU image running Linux from an ECR repository.
*
* NOTE: if the repository is external (i.e. imported), then we won't be able to add
* a resource policy statement for it so CodeBuild can pull the image.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-ecr.html
*
* @param repository The ECR repository
* @param tag Image tag (default "latest")
*/
static fromEcrRepository(repository: ecr.IRepository, tag?: string): IBuildImage;
readonly type: string;
readonly defaultComputeType = ComputeType.LARGE;
readonly imagePullPrincipalType?: ImagePullPrincipalType;
readonly imageId: string;
private _imageAccount?;
private constructor();
bind(scope: Construct, project: IProject, _options: BuildImageBindOptions): BuildImageConfig;
validate(buildEnvironment: BuildEnvironment): string[];
runScriptBuildspec(entrypoint: string): BuildSpec;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,60 @@
import type { BuildSpec } from './build-spec';
import { ComputeType } from './compute-type';
import type { BuildEnvironment, IBuildImage } from './project';
/**
* A CodeBuild image running x86-64 Lambda.
*
* This class has a bunch of public constants that represent the CodeBuild Lambda x86-64 images.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
*/
export declare class LinuxLambdaBuildImage implements IBuildImage {
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:nodejs18` build image. */
static readonly AMAZON_LINUX_2_NODE_18: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:nodejs20` build image. */
static readonly AMAZON_LINUX_2023_NODE_20: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:nodejs22` build image. */
static readonly AMAZON_LINUX_2023_NODE_22: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:python3.11` build image. */
static readonly AMAZON_LINUX_2_PYTHON_3_11: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:python3.12` build image. */
static readonly AMAZON_LINUX_2023_PYTHON_3_12: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:python3.13` build image. */
static readonly AMAZON_LINUX_2023_PYTHON_3_13: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:ruby3.2` build image. */
static readonly AMAZON_LINUX_2_RUBY_3_2: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:ruby3.4` build image. */
static readonly AMAZON_LINUX_2023_RUBY_3_4: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:corretto21` build image. */
static readonly AMAZON_LINUX_2023_CORRETTO_21: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:corretto17` build image. */
static readonly AMAZON_LINUX_2_CORRETTO_17: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:corretto11` build image. */
static readonly AMAZON_LINUX_2_CORRETTO_11: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:go1.21` build image. */
static readonly AMAZON_LINUX_2_GO_1_21: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:go1.24` build image. */
static readonly AMAZON_LINUX_2023_GO_1_24: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:dotnet6` build image. */
static readonly AMAZON_LINUX_2_DOTNET_6: IBuildImage;
/** The `aws/codebuild/amazonlinux-x86_64-lambda-standard:dotnet8` build image. */
static readonly AMAZON_LINUX_2023_DOTNET_8: IBuildImage;
/**
* Uses a Docker image provided by CodeBuild.
*
* NOTE: In Lambda compute, since only specified images can be used, this method is set to private.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
*
* @param id The image identifier
* @example 'aws/codebuild/amazonlinux-x86_64-lambda-standard:nodejs18'
* @returns A Docker image provided by CodeBuild.
*/
private static fromCodeBuildImageId;
readonly type = "LINUX_LAMBDA_CONTAINER";
readonly defaultComputeType = ComputeType.LAMBDA_1GB;
readonly imageId: string;
private constructor();
validate(buildEnvironment: BuildEnvironment): string[];
runScriptBuildspec(entrypoint: string): BuildSpec;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinuxLambdaBuildImage=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var compute_type_1=()=>{var tmp=require("./compute-type");return compute_type_1=()=>tmp,tmp},is_lambda_compute_type_1=()=>{var tmp=require("./is-lambda-compute-type");return is_lambda_compute_type_1=()=>tmp,tmp},run_script_linux_build_spec_1=()=>{var tmp=require("./private/run-script-linux-build-spec");return run_script_linux_build_spec_1=()=>tmp,tmp};class LinuxLambdaBuildImage{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.LinuxLambdaBuildImage",version:"2.252.0"};static AMAZON_LINUX_2_NODE_18=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:nodejs18");static AMAZON_LINUX_2023_NODE_20=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:nodejs20");static AMAZON_LINUX_2023_NODE_22=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:nodejs22");static AMAZON_LINUX_2_PYTHON_3_11=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:python3.11");static AMAZON_LINUX_2023_PYTHON_3_12=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:python3.12");static AMAZON_LINUX_2023_PYTHON_3_13=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:python3.13");static AMAZON_LINUX_2_RUBY_3_2=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:ruby3.2");static AMAZON_LINUX_2023_RUBY_3_4=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:ruby3.4");static AMAZON_LINUX_2023_CORRETTO_21=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:corretto21");static AMAZON_LINUX_2_CORRETTO_17=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:corretto17");static AMAZON_LINUX_2_CORRETTO_11=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:corretto11");static AMAZON_LINUX_2_GO_1_21=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:go1.21");static AMAZON_LINUX_2023_GO_1_24=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:go1.24");static AMAZON_LINUX_2_DOTNET_6=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:dotnet6");static AMAZON_LINUX_2023_DOTNET_8=LinuxLambdaBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux-x86_64-lambda-standard:dotnet8");static fromCodeBuildImageId(id){return new LinuxLambdaBuildImage({imageId:id})}type="LINUX_LAMBDA_CONTAINER";defaultComputeType=compute_type_1().ComputeType.LAMBDA_1GB;imageId;constructor(props){this.imageId=props.imageId}validate(buildEnvironment){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_BuildEnvironment(buildEnvironment)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.validate),error}const errors=[];return buildEnvironment.privileged&&errors.push("Lambda compute type does not support privileged mode"),buildEnvironment.computeType&&!(0,is_lambda_compute_type_1().isLambdaComputeType)(buildEnvironment.computeType)&&errors.push(["Lambda images only support Lambda ComputeTypes between",`'${compute_type_1().ComputeType.LAMBDA_1GB}'`,"and",`'${compute_type_1().ComputeType.LAMBDA_10GB}',`,`got '${buildEnvironment.computeType}'`].join(" ")),errors}runScriptBuildspec(entrypoint){return(0,run_script_linux_build_spec_1().runScriptLinuxBuildSpec)(entrypoint)}}exports.LinuxLambdaBuildImage=LinuxLambdaBuildImage;

View File

@@ -0,0 +1,15 @@
import { Artifacts } from './artifacts';
/**
* A `NO_ARTIFACTS` CodeBuild Project Artifact definition.
* This is the default artifact type,
* if none was specified when creating the Project
* (and the source was not specified to be CodePipeline).
* *Note*: the `NO_ARTIFACTS` type cannot be used as a secondary artifact,
* and because of that, you're not allowed to specify an identifier for it.
*
* This class is private to the @aws-codebuild package.
*/
export declare class NoArtifacts extends Artifacts {
readonly type = "NO_ARTIFACTS";
constructor();
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NoArtifacts=void 0;var artifacts_1=()=>{var tmp=require("./artifacts");return artifacts_1=()=>tmp,tmp};class NoArtifacts extends artifacts_1().Artifacts{type="NO_ARTIFACTS";constructor(){super({})}}exports.NoArtifacts=NoArtifacts;

View File

@@ -0,0 +1,14 @@
import { Source } from './source';
/**
* A `NO_SOURCE` CodeBuild Project Source definition.
* This is the default source type,
* if none was specified when creating the Project.
* *Note*: the `NO_SOURCE` type cannot be used as a secondary source,
* and because of that, you're not allowed to specify an identifier for it.
*
* This class is private to the aws-codebuild package.
*/
export declare class NoSource extends Source {
readonly type = "NO_SOURCE";
constructor();
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NoSource=void 0;var source_1=()=>{var tmp=require("./source");return source_1=()=>tmp,tmp},source_types_1=()=>{var tmp=require("./source-types");return source_types_1=()=>tmp,tmp};class NoSource extends source_1().Source{type=source_types_1().NO_SOURCE_TYPE;constructor(){super({})}}exports.NoSource=NoSource;

View File

@@ -0,0 +1,13 @@
import type { Construct } from 'constructs';
import type { CommonProjectProps } from './project';
import { Project } from './project';
export interface PipelineProjectProps extends CommonProjectProps {
}
/**
* A convenience class for CodeBuild Projects that are used in CodePipeline.
*/
export declare class PipelineProject extends Project {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
constructor(scope: Construct, id: string, props?: PipelineProjectProps);
}

View File

@@ -0,0 +1 @@
"use strict";var __esDecorate=exports&&exports.__esDecorate||function(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(f!==void 0&&typeof f!="function")throw new TypeError("Function expected");return f}for(var kind=contextIn.kind,key=kind==="getter"?"get":kind==="setter"?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),_,done=!1,i=decorators.length-1;i>=0;i--){var context={};for(var p in contextIn)context[p]=p==="access"?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null))};var result=(0,decorators[i])(kind==="accessor"?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if(kind==="accessor"){if(result===void 0)continue;if(result===null||typeof result!="object")throw new TypeError("Object expected");(_=accept(result.get))&&(descriptor.get=_),(_=accept(result.set))&&(descriptor.set=_),(_=accept(result.init))&&initializers.unshift(_)}else(_=accept(result))&&(kind==="field"?initializers.unshift(_):descriptor[key]=_)}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0},__runInitializers=exports&&exports.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i<initializers.length;i++)value=useValue?initializers[i].call(thisArg,value):initializers[i].call(thisArg);return useValue?value:void 0};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipelineProject=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var codepipeline_artifacts_1=()=>{var tmp=require("./codepipeline-artifacts");return codepipeline_artifacts_1=()=>tmp,tmp},codepipeline_source_1=()=>{var tmp=require("./codepipeline-source");return codepipeline_source_1=()=>tmp,tmp},project_1=()=>{var tmp=require("./project");return project_1=()=>tmp,tmp},metadata_resource_1=()=>{var tmp=require("../../core/lib/metadata-resource");return metadata_resource_1=()=>tmp,tmp},prop_injectable_1=()=>{var tmp=require("../../core/lib/prop-injectable");return prop_injectable_1=()=>tmp,tmp};let PipelineProject=(()=>{let _classDecorators=[prop_injectable_1().propertyInjectable],_classDescriptor,_classExtraInitializers=[],_classThis,_classSuper=project_1().Project;var PipelineProject2=class extends _classSuper{static{_classThis=this}static{const _metadata=typeof Symbol=="function"&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;__esDecorate(null,_classDescriptor={value:_classThis},_classDecorators,{kind:"class",name:_classThis.name,metadata:_metadata},null,_classExtraInitializers),PipelineProject2=_classThis=_classDescriptor.value,_metadata&&Object.defineProperty(_classThis,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.PipelineProject",version:"2.252.0"};static PROPERTY_INJECTION_ID="aws-cdk-lib.aws-codebuild.PipelineProject";constructor(scope,id,props){super(scope,id,{source:new(codepipeline_source_1()).CodePipelineSource,artifacts:new(codepipeline_artifacts_1()).CodePipelineArtifacts,...props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_PipelineProjectProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,PipelineProject2),error}(0,metadata_resource_1().addConstructMetadata)(this,props)}static{__runInitializers(_classThis,_classExtraInitializers)}};return PipelineProject2=_classThis})();exports.PipelineProject=PipelineProject;

View File

@@ -0,0 +1,4 @@
import { BuildSpec } from '../build-spec';
export declare const S3_BUCKET_ENV = "SCRIPT_S3_BUCKET";
export declare const S3_KEY_ENV = "SCRIPT_S3_KEY";
export declare function runScriptLinuxBuildSpec(entrypoint: string): BuildSpec;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.S3_KEY_ENV=exports.S3_BUCKET_ENV=void 0,exports.runScriptLinuxBuildSpec=runScriptLinuxBuildSpec;var build_spec_1=()=>{var tmp=require("../build-spec");return build_spec_1=()=>tmp,tmp};exports.S3_BUCKET_ENV="SCRIPT_S3_BUCKET",exports.S3_KEY_ENV="SCRIPT_S3_KEY";function runScriptLinuxBuildSpec(entrypoint){return build_spec_1().BuildSpec.fromObject({version:"0.2",phases:{pre_build:{commands:[`echo "Downloading scripts from s3://\${${exports.S3_BUCKET_ENV}}/\${${exports.S3_KEY_ENV}}"`,`aws s3 cp s3://\${${exports.S3_BUCKET_ENV}}/\${${exports.S3_KEY_ENV}} /tmp`,"mkdir -p /tmp/scriptdir",`unzip /tmp/$(basename $${exports.S3_KEY_ENV}) -d /tmp/scriptdir`]},build:{commands:["export SCRIPT_DIR=/tmp/scriptdir",`echo "Running ${entrypoint}"`,`chmod +x /tmp/scriptdir/${entrypoint}`,`/tmp/scriptdir/${entrypoint}`]}}})}

View File

@@ -0,0 +1,7 @@
/**
* Serializes the given data structure into valid YAML.
*
* @param obj the data structure to serialize
* @returns a string containing the YAML representation of {@param obj}
*/
export declare function serialize(obj: any): string;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.serialize=serialize;var yaml=()=>{var tmp=require("yaml");return yaml=()=>tmp,tmp},yaml_types=()=>{var tmp=require("yaml/types");return yaml_types=()=>tmp,tmp};function serialize(obj){const oldFold=yaml_types().strOptions.fold.lineWidth;try{return yaml_types().strOptions.fold.lineWidth=0,yaml().stringify(obj,{schema:"yaml-1.1"})}finally{yaml_types().strOptions.fold.lineWidth=oldFold}}

View File

@@ -0,0 +1,69 @@
import type * as logs from '../../aws-logs';
import type * as s3 from '../../aws-s3';
/**
* Information about logs built to an S3 bucket for a build project.
*/
export interface S3LoggingOptions {
/**
* Encrypt the S3 build log output
*
* @default true
*/
readonly encrypted?: boolean;
/**
* The S3 Bucket to send logs to
*/
readonly bucket: s3.IBucket;
/**
* The path prefix for S3 logs
*
* @default - no prefix
*/
readonly prefix?: string;
/**
* The current status of the logs in Amazon CloudWatch Logs for a build project
*
* @default true
*/
readonly enabled?: boolean;
}
/**
* Information about logs built to a CloudWatch Log Group for a build project.
*/
export interface CloudWatchLoggingOptions {
/**
* The Log Group to send logs to
*
* @default - no log group specified
*/
readonly logGroup?: logs.ILogGroup;
/**
* The prefix of the stream name of the Amazon CloudWatch Logs
*
* @default - no prefix
*/
readonly prefix?: string;
/**
* The current status of the logs in Amazon CloudWatch Logs for a build project
*
* @default true
*/
readonly enabled?: boolean;
}
/**
* Information about logs for the build project. A project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.
*/
export interface LoggingOptions {
/**
* Information about logs built to an S3 bucket for a build project.
*
* @default - disabled
*/
readonly s3?: S3LoggingOptions;
/**
* Information about Amazon CloudWatch Logs for a build project.
*
* @default - enabled
*/
readonly cloudWatch?: CloudWatchLoggingOptions;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import type { Construct } from 'constructs';
import * as cdk from '../../core';
export declare function renderReportGroupArn(scope: Construct, reportGroupName: string): string;
export declare function reportGroupArnComponents(reportGroupName: string): cdk.ArnComponents;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.renderReportGroupArn=renderReportGroupArn,exports.reportGroupArnComponents=reportGroupArnComponents;var cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp};function renderReportGroupArn(scope,reportGroupName){return cdk().Stack.of(scope).formatArn(reportGroupArnComponents(reportGroupName))}function reportGroupArnComponents(reportGroupName){return{service:"codebuild",resource:"report-group",resourceName:reportGroupName}}

View File

@@ -0,0 +1,123 @@
import type { Construct } from 'constructs';
import * as iam from '../../aws-iam';
import type * as s3 from '../../aws-s3';
import * as cdk from '../../core';
import type { IReportGroupRef, ReportGroupReference } from '../../interfaces/generated/aws-codebuild-interfaces.generated';
/**
* The interface representing the ReportGroup resource -
* either an existing one, imported using the
* `ReportGroup.fromReportGroupName` method,
* or a new one, created with the `ReportGroup` class.
*/
export interface IReportGroup extends cdk.IResource, IReportGroupRef {
/**
* The ARN of the ReportGroup.
*
* @attribute
*/
readonly reportGroupArn: string;
/**
* The name of the ReportGroup.
*
* @attribute
*/
readonly reportGroupName: string;
/**
* Grants the given entity permissions to write
* (that is, upload reports to)
* this report group.
*/
grantWrite(identity: iam.IGrantable): iam.Grant;
}
declare abstract class ReportGroupBase extends cdk.Resource implements IReportGroup {
abstract readonly reportGroupArn: string;
abstract readonly reportGroupName: string;
protected abstract readonly exportBucket?: s3.IBucket;
protected abstract readonly type?: ReportGroupType;
get reportGroupRef(): ReportGroupReference;
/**
* [disable-awslint:no-grants]
*/
grantWrite(identity: iam.IGrantable): iam.Grant;
}
/**
* The type of reports in the report group.
*/
export declare enum ReportGroupType {
/**
* The report group contains test reports.
*/
TEST = "TEST",
/**
* The report group contains code coverage reports.
*/
CODE_COVERAGE = "CODE_COVERAGE"
}
/**
* Construction properties for `ReportGroup`.
*/
export interface ReportGroupProps {
/**
* The physical name of the report group.
*
* @default - CloudFormation-generated name
*/
readonly reportGroupName?: string;
/**
* An optional S3 bucket to export the reports to.
*
* @default - the reports will not be exported
*/
readonly exportBucket?: s3.IBucket;
/**
* Whether to output the report files into the export bucket as-is,
* or create a ZIP from them before doing the export.
* Ignored if `exportBucket` has not been provided.
*
* @default - false (the files will not be ZIPped)
*/
readonly zipExport?: boolean;
/**
* What to do when this resource is deleted from a stack.
* As CodeBuild does not allow deleting a ResourceGroup that has reports inside of it,
* this is set to retain the resource by default.
*
* @default RemovalPolicy.RETAIN
*/
readonly removalPolicy?: cdk.RemovalPolicy;
/**
* The type of report group. This can be one of the following values:
*
* - **TEST** - The report group contains test reports.
* - **CODE_COVERAGE** - The report group contains code coverage reports.
*
* @default TEST
*/
readonly type?: ReportGroupType;
/**
* If true, deleting the report group force deletes the contents of the report group. If false, the report group must be empty before attempting to delete it.
*
* @default false
*/
readonly deleteReports?: boolean;
}
/**
* The ReportGroup resource class.
*/
export declare class ReportGroup extends ReportGroupBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* Reference an existing ReportGroup,
* defined outside of the CDK code,
* by name.
*/
static fromReportGroupName(scope: Construct, id: string, reportGroupName: string): IReportGroup;
get reportGroupArn(): string;
protected readonly exportBucket?: s3.IBucket;
protected readonly type?: ReportGroupType;
private readonly resource;
constructor(scope: Construct, id: string, props?: ReportGroupProps);
get reportGroupName(): string;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,73 @@
import type { Construct } from 'constructs';
import type { SecretValue } from '../../core';
import { Resource } from '../../core';
/**
* Creation properties for `GitHubSourceCredentials`.
*/
export interface GitHubSourceCredentialsProps {
/**
* The personal access token to use when contacting the GitHub API.
*/
readonly accessToken: SecretValue;
}
/**
* The source credentials used when contacting the GitHub API.
*
* **Note**: CodeBuild only allows a single credential for GitHub
* to be saved in a given AWS account in a given region -
* any attempt to add more than one will result in an error.
*
* @resource AWS::CodeBuild::SourceCredential
*/
export declare class GitHubSourceCredentials extends Resource {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
constructor(scope: Construct, id: string, props: GitHubSourceCredentialsProps);
}
/**
* Creation properties for `GitHubEnterpriseSourceCredentials`.
*/
export interface GitHubEnterpriseSourceCredentialsProps {
/**
* The personal access token to use when contacting the
* instance of the GitHub Enterprise API.
*/
readonly accessToken: SecretValue;
}
/**
* The source credentials used when contacting the GitHub Enterprise API.
*
* **Note**: CodeBuild only allows a single credential for GitHub Enterprise
* to be saved in a given AWS account in a given region -
* any attempt to add more than one will result in an error.
*
* @resource AWS::CodeBuild::SourceCredential
*/
export declare class GitHubEnterpriseSourceCredentials extends Resource {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
constructor(scope: Construct, id: string, props: GitHubEnterpriseSourceCredentialsProps);
}
/**
* Construction properties of `BitBucketSourceCredentials`.
*/
export interface BitBucketSourceCredentialsProps {
/** Your BitBucket username. */
readonly username: SecretValue;
/** Your BitBucket application password. */
readonly password: SecretValue;
}
/**
* The source credentials used when contacting the BitBucket API.
*
* **Note**: CodeBuild only allows a single credential for BitBucket
* to be saved in a given AWS account in a given region -
* any attempt to add more than one will result in an error.
*
* @resource AWS::CodeBuild::SourceCredential
*/
export declare class BitBucketSourceCredentials extends Resource {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
constructor(scope: Construct, id: string, props: BitBucketSourceCredentialsProps);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
export declare const NO_SOURCE_TYPE = "NO_SOURCE";
export declare const CODEPIPELINE_SOURCE_ARTIFACTS_TYPE = "CODEPIPELINE";
export declare const S3_SOURCE_TYPE = "S3";
export declare const CODECOMMIT_SOURCE_TYPE = "CODECOMMIT";
export declare const GITHUB_SOURCE_TYPE = "GITHUB";
export declare const GITHUB_ENTERPRISE_SOURCE_TYPE = "GITHUB_ENTERPRISE";
export declare const BITBUCKET_SOURCE_TYPE = "BITBUCKET";

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BITBUCKET_SOURCE_TYPE=exports.GITHUB_ENTERPRISE_SOURCE_TYPE=exports.GITHUB_SOURCE_TYPE=exports.CODECOMMIT_SOURCE_TYPE=exports.S3_SOURCE_TYPE=exports.CODEPIPELINE_SOURCE_ARTIFACTS_TYPE=exports.NO_SOURCE_TYPE=void 0,exports.NO_SOURCE_TYPE="NO_SOURCE",exports.CODEPIPELINE_SOURCE_ARTIFACTS_TYPE="CODEPIPELINE",exports.S3_SOURCE_TYPE="S3",exports.CODECOMMIT_SOURCE_TYPE="CODECOMMIT",exports.GITHUB_SOURCE_TYPE="GITHUB",exports.GITHUB_ENTERPRISE_SOURCE_TYPE="GITHUB_ENTERPRISE",exports.BITBUCKET_SOURCE_TYPE="BITBUCKET";

View File

@@ -0,0 +1,445 @@
import type { Construct } from 'constructs';
import type { CfnProject } from './codebuild.generated';
import type { IProject } from './project';
import type * as codecommit from '../../aws-codecommit';
import type * as s3 from '../../aws-s3';
/**
* The type returned from `ISource#bind`.
*/
export interface SourceConfig {
readonly sourceProperty: CfnProject.SourceProperty;
readonly buildTriggers?: CfnProject.ProjectTriggersProperty;
/**
* `AWS::CodeBuild::Project.SourceVersion`
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-sourceversion
* @default the latest version
*/
readonly sourceVersion?: string;
}
/**
* The abstract interface of a CodeBuild source.
* Implemented by `Source`.
*/
export interface ISource {
readonly identifier?: string;
readonly type: string;
readonly badgeSupported: boolean;
bind(scope: Construct, project: IProject): SourceConfig;
}
/**
* Properties common to all Source classes.
*/
export interface SourceProps {
/**
* The source identifier.
* This property is required on secondary sources.
*/
readonly identifier?: string;
}
/**
* Source provider definition for a CodeBuild Project.
*/
export declare abstract class Source implements ISource {
static s3(props: S3SourceProps): ISource;
static codeCommit(props: CodeCommitSourceProps): ISource;
static gitHub(props: GitHubSourceProps): ISource;
static gitHubEnterprise(props: GitHubEnterpriseSourceProps): ISource;
static bitBucket(props: BitBucketSourceProps): ISource;
readonly identifier?: string;
abstract readonly type: string;
readonly badgeSupported: boolean;
protected constructor(props: SourceProps);
/**
* Called by the project when the source is added so that the source can perform
* binding operations on the source. For example, it can grant permissions to the
* code build project to read from the S3 bucket.
*/
bind(_scope: Construct, _project: IProject): SourceConfig;
}
/**
* The construction properties common to all build sources that are backed by Git.
*/
interface GitSourceProps extends SourceProps {
/**
* The depth of history to download. Minimum value is 0.
* If this value is 0, greater than 25, or not provided,
* then the full history is downloaded with each build of the project.
*/
readonly cloneDepth?: number;
/**
* The commit ID, pull request ID, branch name, or tag name that corresponds to
* the version of the source code you want to build
*
* @example 'mybranch'
* @default the default branch's HEAD commit ID is used
*/
readonly branchOrRef?: string;
/**
* Whether to fetch submodules while cloning git repo.
*
* @default false
*/
readonly fetchSubmodules?: boolean;
}
/**
* The types of webhook event actions.
*/
export declare enum EventAction {
/**
* A push (of a branch, or a tag) to the repository.
*/
PUSH = "PUSH",
/**
* Creating a Pull Request.
*/
PULL_REQUEST_CREATED = "PULL_REQUEST_CREATED",
/**
* Updating a Pull Request.
*/
PULL_REQUEST_UPDATED = "PULL_REQUEST_UPDATED",
/**
* Closing a Pull Request.
*/
PULL_REQUEST_CLOSED = "PULL_REQUEST_CLOSED",
/**
* Merging a Pull Request.
*/
PULL_REQUEST_MERGED = "PULL_REQUEST_MERGED",
/**
* Re-opening a previously closed Pull Request.
* Note that this event is only supported for GitHub and GitHubEnterprise sources.
*/
PULL_REQUEST_REOPENED = "PULL_REQUEST_REOPENED",
/**
* A release is created in the repository.
* Works with GitHub only.
*/
RELEASED = "RELEASED",
/**
* A prerelease is created in the repository.
* Works with GitHub only.
*/
PRERELEASED = "PRERELEASED",
/**
* A workflow job is queued in the repository.
* Works with GitHub only.
*/
WORKFLOW_JOB_QUEUED = "WORKFLOW_JOB_QUEUED"
}
/**
* An object that represents a group of filter conditions for a webhook.
* Every condition in a given FilterGroup must be true in order for the whole group to be true.
* You construct instances of it by calling the `#inEventOf` static factory method,
* and then calling various `andXyz` instance methods to create modified instances of it
* (this class is immutable).
*
* You pass instances of this class to the `webhookFilters` property when constructing a source.
*/
export declare class FilterGroup {
/**
* Creates a new event FilterGroup that triggers on any of the provided actions.
*
* @param actions the actions to trigger the webhook on
*/
static inEventOf(...actions: EventAction[]): FilterGroup;
private readonly actions;
private readonly filters;
private constructor();
/**
* Create a new FilterGroup with an added condition:
* the event must affect the given branch.
*
* @param branchName the name of the branch (can be a regular expression)
*/
andBranchIs(branchName: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the event must not affect the given branch.
*
* @param branchName the name of the branch (can be a regular expression)
*/
andBranchIsNot(branchName: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the event must affect a head commit with the given message.
*
* @param commitMessage the commit message (can be a regular expression)
*/
andCommitMessageIs(commitMessage: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the event must not affect a head commit with the given message.
*
* @param commitMessage the commit message (can be a regular expression)
*/
andCommitMessageIsNot(commitMessage: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the event must affect the given tag.
*
* @param tagName the name of the tag (can be a regular expression)
*/
andTagIs(tagName: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the event must not affect the given tag.
*
* @param tagName the name of the tag (can be a regular expression)
*/
andTagIsNot(tagName: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the event must affect a Git reference (ie., a branch or a tag)
* that matches the given pattern.
*
* @param pattern a regular expression
*/
andHeadRefIs(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the event must not affect a Git reference (ie., a branch or a tag)
* that matches the given pattern.
*
* @param pattern a regular expression
*/
andHeadRefIsNot(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the account ID of the actor initiating the event must match the given pattern.
*
* @param pattern a regular expression
*/
andActorAccountIs(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the account ID of the actor initiating the event must not match the given pattern.
*
* @param pattern a regular expression
*/
andActorAccountIsNot(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the Pull Request that is the source of the event must target the given base branch.
* Note that you cannot use this method if this Group contains the `PUSH` event action.
*
* @param branchName the name of the branch (can be a regular expression)
*/
andBaseBranchIs(branchName: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the Pull Request that is the source of the event must not target the given base branch.
* Note that you cannot use this method if this Group contains the `PUSH` event action.
*
* @param branchName the name of the branch (can be a regular expression)
*/
andBaseBranchIsNot(branchName: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the Pull Request that is the source of the event must target the given Git reference.
* Note that you cannot use this method if this Group contains the `PUSH` event action.
*
* @param pattern a regular expression
*/
andBaseRefIs(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the Pull Request that is the source of the event must not target the given Git reference.
* Note that you cannot use this method if this Group contains the `PUSH` event action.
*
* @param pattern a regular expression
*/
andBaseRefIsNot(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the push that is the source of the event must affect a file that matches the given pattern.
* Note that you can only use this method if this Group contains only the `PUSH` event action,
* and only for GitHub, Bitbucket and GitHubEnterprise sources.
*
* @param pattern a regular expression
*/
andFilePathIs(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the push that is the source of the event must not affect a file that matches the given pattern.
* Note that you can only use this method if this Group contains only the `PUSH` event action,
* and only for GitHub, Bitbucket and GitHubEnterprise sources.
*
* @param pattern a regular expression
*/
andFilePathIsNot(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the push that is the source of the event affect only a repository name that matches the given pattern.
* Note that you can only use this method if this Group contains only the `WORKFLOW_JOB_QUEUED` event action,
* only for GitHub sources and only for organization webhook.
*
* @param pattern a regular expression
*/
andRepositoryNameIs(pattern: string): FilterGroup;
/**
* Create a new FilterGroup with an added condition:
* the push that is the source of the event must not affect a repository name that matches the given pattern.
* Note that you can only use this method if this Group contains only the `WORKFLOW_JOB_QUEUED` event action,
* only for GitHub sources and only for organization webhook.
*
* @param pattern a regular expression
*/
andRepositoryNameIsNot(pattern: string): FilterGroup;
/** @internal */
get _actions(): EventAction[];
/** @internal */
get _filters(): CfnProject.WebhookFilterProperty[];
/** @internal */
_toJson(): CfnProject.WebhookFilterProperty[];
private addCommitMessageFilter;
private addHeadBranchFilter;
private addHeadTagFilter;
private addHeadRefFilter;
private addActorAccountId;
private addBaseBranchFilter;
private addBaseRefFilter;
private addFilePathFilter;
private addRepositoryNameFilter;
private addFilter;
}
/**
* The construction properties common to all third-party build sources that are backed by Git.
*/
interface ThirdPartyGitSourceProps extends GitSourceProps {
/**
* Whether to send notifications on your build's start and end.
*
* @default true
*/
readonly reportBuildStatus?: boolean;
/**
* Whether to create a webhook that will trigger a build every time an event happens in the repository.
*
* @default true if any `webhookFilters` were provided, false otherwise
*/
readonly webhook?: boolean;
/**
* Trigger a batch build from a webhook instead of a standard one.
*
* Enabling this will enable batch builds on the CodeBuild project.
*
* @default false
*/
readonly webhookTriggersBatchBuild?: boolean;
/**
* A list of webhook filters that can constraint what events in the repository will trigger a build.
* A build is triggered if any of the provided filter groups match.
* Only valid if `webhook` was not provided as false.
*
* @default every push and every Pull Request (create or update) triggers a build
*/
readonly webhookFilters?: FilterGroup[];
/**
* The URL that the build will report back to the source provider.
* Can use built-in CodeBuild variables, like $AWS_REGION.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/create-project-cli.html#cli.source.buildstatusconfig.targeturl
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
*
* @example "$CODEBUILD_PUBLIC_BUILD_URL"
* @default - link to the AWS Console for CodeBuild to a particular build execution
*/
readonly buildStatusUrl?: string;
}
/**
* Construction properties for `CodeCommitSource`.
*/
export interface CodeCommitSourceProps extends GitSourceProps {
readonly repository: codecommit.IRepository;
}
/**
* Construction properties for `S3Source`.
*/
export interface S3SourceProps extends SourceProps {
readonly bucket: s3.IBucket;
readonly path: string;
/**
* The version ID of the object that represents the build input ZIP file to use.
*
* @default latest
*/
readonly version?: string;
}
/**
* Common properties between `GitHubSource` and `GitHubEnterpriseSource`.
*/
interface CommonGithubSourceProps extends ThirdPartyGitSourceProps {
/**
* This parameter is used for the `context` parameter in the GitHub commit status.
* Can use built-in CodeBuild variables, like $AWS_REGION.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/create-project-cli.html#cli.source.buildstatusconfig.context
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
*
* @example "My build #$CODEBUILD_BUILD_NUMBER"
* @default "AWS CodeBuild $AWS_REGION ($PROJECT_NAME)"
*/
readonly buildStatusContext?: string;
}
/**
* Construction properties for `GitHubSource` and `GitHubEnterpriseSource`.
*/
export interface GitHubSourceProps extends CommonGithubSourceProps {
/**
* The GitHub Organization/user that owns the repo.
*
* @example 'awslabs'
*/
readonly owner: string;
/**
* The name of the repo (without the username).
*
* @example 'aws-cdk'
* @default undefined will create an organization webhook
*/
readonly repo?: string;
}
/**
* Construction properties for `GitHubEnterpriseSource`.
*/
export interface GitHubEnterpriseSourceProps extends CommonGithubSourceProps {
/**
* The HTTPS URL of the repository in your GitHub Enterprise installation.
*/
readonly httpsCloneUrl: string;
/**
* Whether to ignore SSL errors when connecting to the repository.
*
* @default false
*/
readonly ignoreSslErrors?: boolean;
}
/**
* Construction properties for `BitBucketSource`.
*/
export interface BitBucketSourceProps extends ThirdPartyGitSourceProps {
/**
* The BitBucket account/user that owns the repo.
*
* @example 'awslabs'
*/
readonly owner: string;
/**
* The name of the repo (without the username).
*
* @example 'aws-cdk'
*/
readonly repo: string;
/**
* This parameter is used for the `name` parameter in the Bitbucket commit status.
* Can use built-in CodeBuild variables, like $AWS_REGION.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/create-project-cli.html#cli.source.buildstatusconfig.context
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
*
* @example "My build #$CODEBUILD_BUILD_NUMBER"
* @default "AWS CodeBuild $AWS_REGION ($PROJECT_NAME)"
*/
readonly buildStatusName?: string;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
import type { Construct } from 'constructs';
import * as iam from '../../aws-iam';
/**
* Construction properties for UntrustedCodeBoundaryPolicy
*/
export interface UntrustedCodeBoundaryPolicyProps {
/**
* The name of the managed policy.
*
* @default - A name is automatically generated.
*/
readonly managedPolicyName?: string;
/**
* Additional statements to add to the default set of statements
*
* @default - No additional statements
*/
readonly additionalStatements?: iam.PolicyStatement[];
}
/**
* Permissions Boundary for a CodeBuild Project running untrusted code
*
* This class is a Policy, intended to be used as a Permissions Boundary
* for a CodeBuild project. It allows most of the actions necessary to run
* the CodeBuild project, but disallows reading from Parameter Store
* and Secrets Manager.
*
* Use this when your CodeBuild project is running untrusted code (for
* example, if you are using one to automatically build Pull Requests
* that anyone can submit), and you want to prevent your future self
* from accidentally exposing Secrets to this build.
*
* (The reason you might want to do this is because otherwise anyone
* who can submit a Pull Request to your project can write a script
* to email those secrets to themselves).
*
* @example
*
* declare const project: codebuild.Project;
* iam.PermissionsBoundary.of(project).apply(new codebuild.UntrustedCodeBoundaryPolicy(this, 'Boundary'));
*/
export declare class UntrustedCodeBoundaryPolicy extends iam.ManagedPolicy {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
constructor(scope: Construct, id: string, props?: UntrustedCodeBoundaryPolicyProps);
}

View File

@@ -0,0 +1 @@
"use strict";var __esDecorate=exports&&exports.__esDecorate||function(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(f!==void 0&&typeof f!="function")throw new TypeError("Function expected");return f}for(var kind=contextIn.kind,key=kind==="getter"?"get":kind==="setter"?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),_,done=!1,i=decorators.length-1;i>=0;i--){var context={};for(var p in contextIn)context[p]=p==="access"?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null))};var result=(0,decorators[i])(kind==="accessor"?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if(kind==="accessor"){if(result===void 0)continue;if(result===null||typeof result!="object")throw new TypeError("Object expected");(_=accept(result.get))&&(descriptor.get=_),(_=accept(result.set))&&(descriptor.set=_),(_=accept(result.init))&&initializers.unshift(_)}else(_=accept(result))&&(kind==="field"?initializers.unshift(_):descriptor[key]=_)}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0},__runInitializers=exports&&exports.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i<initializers.length;i++)value=useValue?initializers[i].call(thisArg,value):initializers[i].call(thisArg);return useValue?value:void 0};Object.defineProperty(exports,"__esModule",{value:!0}),exports.UntrustedCodeBoundaryPolicy=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp},metadata_resource_1=()=>{var tmp=require("../../core/lib/metadata-resource");return metadata_resource_1=()=>tmp,tmp},prop_injectable_1=()=>{var tmp=require("../../core/lib/prop-injectable");return prop_injectable_1=()=>tmp,tmp};let UntrustedCodeBoundaryPolicy=(()=>{let _classDecorators=[prop_injectable_1().propertyInjectable],_classDescriptor,_classExtraInitializers=[],_classThis,_classSuper=iam().ManagedPolicy;var UntrustedCodeBoundaryPolicy2=class extends _classSuper{static{_classThis=this}static{const _metadata=typeof Symbol=="function"&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;__esDecorate(null,_classDescriptor={value:_classThis},_classDecorators,{kind:"class",name:_classThis.name,metadata:_metadata},null,_classExtraInitializers),UntrustedCodeBoundaryPolicy2=_classThis=_classDescriptor.value,_metadata&&Object.defineProperty(_classThis,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_codebuild.UntrustedCodeBoundaryPolicy",version:"2.252.0"};static PROPERTY_INJECTION_ID="aws-cdk-lib.aws-codebuild.UntrustedCodeBoundaryPolicy";constructor(scope,id,props={}){super(scope,id,{managedPolicyName:props.managedPolicyName,description:"Permissions Boundary Policy for CodeBuild Projects running untrusted code",statements:[new(iam()).PolicyStatement({actions:["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents","codebuild:CreateReportGroup","codebuild:CreateReport","codebuild:UpdateReport","codebuild:BatchPutTestCases","codebuild:BatchPutCodeCoverages","codebuild:StartBuild","codebuild:StopBuild","codebuild:RetryBuild","ecr:GetDownloadUrlForLayer","ecr:BatchGetImage","ecr:BatchCheckLayerAvailability","ec2:CreateNetworkInterfacePermission","ec2:CreateNetworkInterface","ec2:DescribeNetworkInterfaces","ec2:DeleteNetworkInterface","ec2:DescribeSubnets","ec2:DescribeSecurityGroups","ec2:DescribeDhcpOptions","ec2:DescribeVpcs"],resources:["*"]}),...props.additionalStatements??[]]});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_UntrustedCodeBoundaryPolicyProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,UntrustedCodeBoundaryPolicy2),error}(0,metadata_resource_1().addConstructMetadata)(this,props)}static{__runInitializers(_classThis,_classExtraInitializers)}};return UntrustedCodeBoundaryPolicy2=_classThis})();exports.UntrustedCodeBoundaryPolicy=UntrustedCodeBoundaryPolicy;