This documentation is for the developer preview release of the AWS CDK. Do not use this version of the AWS CDK in production. Subsequent releases of the AWS CDK will likely include breaking changes.

AWS CodeBuild

AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy. With CodeBuild, you don’t need to provision, manage, and scale your own build servers. CodeBuild scales continuously and processes multiple builds concurrently, so your builds are not left waiting in a queue. You can get started quickly by using prepackaged build environments, or you can create custom build environments that use your own build tools. With CodeBuild, you are charged by the minute for the compute resources you use.

Installation

Install the module:

$ npm i @aws-cdk/aws-codebuild

Import it into your code:

import codebuild = require('@aws-cdk/aws-codebuild');

The codebuild.Project construct represents a build project resource. See the reference documentation for a comprehensive list of initialization properties, methods and attributes.

Source

Build projects are usually associated with a source, which is specified via the source property which accepts a class that extends the BuildSource abstract base class. The supported sources are:

NoSource

This is the default and implies that no source is associated with this build project.

The buildSpec option is required in this case.

Here’s a CodeBuild project with no source which simply prints Hello, CodeBuild!:

new codebuild.Project(this, 'MyProject', {
  buildSpec: {
    version: '0.2',
    phases: {
      build: {
        commands: [
          'echo "Hello, CodeBuild!"'
        ]
      }
    }
  }
});

CodeCommitSource

Use an AWS CodeCommit repository as the source of this build:

import codebuild = require('@aws-cdk/aws-codebuild');
import codecommit = require('@aws-cdk/aws-codecommit');

const repository = new codecommit.Repository(this, 'MyRepo', { repositoryName: 'foo' });
new codebuild.Project(this, 'MyFirstCodeCommitProject', {
  source: new codebuild.CodeCommitSource({ repository }),
});

S3BucketSource

Create a CodeBuild project with an S3 bucket as the source:

import codebuild = require('@aws-cdk/aws-codebuild');
import s3 = require('@aws-cdk/aws-s3');

const bucket = new s3.Bucket(this, 'MyBucket');
new codebuild.Project(this, 'MyProject', {
  source: new codebuild.S3BucketSource({
    bucket: bucket,
    path: 'path/to/file.zip',
  }),
});

CodePipelineSource

Used as a special source type when a CodeBuild project is used as a CodePipeline action.

GitHubSource and GitHubEnterpriseSource

These source types can be used to build code from a GitHub repository. Example:

const gitHubSource = new codebuild.GitHubSource({
  owner: 'awslabs',
  repo: 'aws-cdk',
  oauthToken: new cdk.SecretParameter(this, 'GitHubOAuthToken', {
    ssmParameter: 'my-github-token',
  }).value,
  webhook: true, // optional, default: false
});

BitBucketSource

This source type can be used to build code from a BitBucket repository.

Environment

By default, projects use a small instance with an Ubuntu 14.04 image. You can use the environment property to customize the build environment:

  • buildImage defines the Docker image used. See Images below for details on how to define build images.
  • computeType defines the instance type used for the build.
  • privileged can be set to true to allow privileged access.
  • environmentVariables can be set at this level (and also at the project level).

Images

The CodeBuild library supports both Linux and Windows images via the LinuxBuildImage and WindowsBuildImage classes, respectively.

You can either specify one of the predefined Windows/Linux images by using one of the constants such as WindowsBuildImage.WIN_SERVER_CORE_2016_BASE or LinuxBuildImage.UBUNTU_14_04_RUBY_2_5_1.

Alternatively, you can specify a custom image using one of the static methods on XxxBuildImage:

  • Use .fromDockerHub(image) to reference an image publicly available in Docker Hub.
  • Use .fromEcrRepository(repo[, tag]) to reference an image available in an ECR repository.
  • Use .fromAsset(this, id, { directory: dir }) to use an image created from a local asset.

The following example shows how to define an image from a Docker asset:

environment: {
  buildImage: codebuild.LinuxBuildImage.fromAsset(this, 'MyImage', {
    directory: path.join(__dirname, 'demo-image')
  })
}

The following example shows how to define an image from an ECR repository:

environment: {
  buildImage: codebuild.LinuxBuildImage.fromEcrRepository(ecrRepository, "v1.0")
}

Events

CodeBuild projects can be used either as a source for events or be triggered by events via an event rule.

Using Project as an event target

The Project construct implements the IEventRuleTarget interface. This means that it can be used as a target for event rules:

// start build when a commit is pushed
codeCommitRepository.onCommit('OnCommit', project);

Using Project as an event source

To define Amazon CloudWatch event rules for build projects, use one of the onXxx methods:

const rule = project.onStateChange('BuildStateChange');
rule.addTarget(lambdaFunction);

Using a CodeBuild Project as an AWS CodePipeline action

Example of a Project used in CodePipeline, alongside CodeCommit:

import codebuild = require('@aws-cdk/aws-codebuild');
import codecommit = require('@aws-cdk/aws-codecommit');
import codepipeline = require('@aws-cdk/aws-codepipeline');

const repository = new codecommit.Repository(this, 'MyRepository', {
  repositoryName: 'MyRepository',
});
const project = new codebuild.PipelineProject(this, 'MyProject');

const sourceAction = repository.toCodePipelineSourceAction({ actionName: 'CodeCommit' });
const buildAction = new codebuild.PipelineBuildAction({
  actionName: 'CodeBuild',
  project,
  inputArtifact: sourceAction.outputArtifact,
});

new codepipeline.Pipeline(this, 'MyPipeline', {
  stages: [
    {
      name: 'Source',
      actions: [sourceAction],
    },
    {
      name: 'Build',
      actions: [buildAction],
    },
  ],
});

The PipelineProject utility class is a simple sugar around the Project class, it’s equivalent to:

const project = new codebuild.Project(this, 'MyProject', {
  source: new codebuild.CodePipelineSource(),
  artifacts: new codebuild.CodePipelineBuildArtifacts(),
  // rest of the properties from PipelineProject are passed unchanged...
}

You can also create the action from the Project directly:

// equivalent to the code above:
const buildAction = project.toCodePipelineBuildAction({
  actionName: 'CodeBuild',
  inputArtifact: sourceAction.outputArtifact,
});

In addition to the build Action, there is also a test Action. It works very similarly to the build Action, the only difference is that the test Action does not always produce an output artifact.

Examples:

const testAction = new codebuild.PipelineTestAction({
  actionName: 'IntegrationTest',
  project,
  inputArtifact: sourceAction.outputArtifact,
  // outputArtifactName is optional - if you don't specify it,
  // the Action will have an undefined `outputArtifact` property
  outputArtifactName: 'IntegrationTestOutput',
});

// equivalent to the code above:
const testAction = project.toCodePipelineTestAction({
  actionName: 'IntegrationTest',
  inputArtifact: sourceAction.outputArtifact,
  // of course, this property is optional here as well
  outputArtifactName: 'IntegrationTestOutput',
});

Secondary sources and artifacts

CodeBuild Projects can get their sources from multiple places, and produce multiple outputs. For example:

const project = new codebuild.Project(this, 'MyProject', {
  secondarySources: [
    new codebuild.CodeCommitSource({
    identifier: 'source2',
    repository: repo,
    }),
  ],
  secondaryArtifacts: [
    new codebuild.S3BucketBuildArtifacts({
    identifier: 'artifact2',
    bucket: bucket,
    path: 'some/path',
    name: 'file.zip',
    }),
  ],
  // ...
});

Note that the identifier property is required for both secondary sources and artifacts.

The contents of the secondary source is available to the build under the directory specified by the CODEBUILD_SRC_DIR_<identifier> environment variable (so, CODEBUILD_SRC_DIR_source2 in the above case).

The secondary artifacts have their own section in the buildspec, under the regular artifacts one. Each secondary artifact has its own section, beginning with their identifier.

So, a buildspec for the above Project could look something like this:

const project = new codebuild.Project(this, 'MyProject', {
  // secondary sources and artifacts as above...
  buildSpec: {
    version: '0.2',
    phases: {
    build: {
      commands: [
        'cd $CODEBUILD_SRC_DIR_source2',
        'touch output2.txt',
      ],
    },
    },
    artifacts: {
    'secondary-artifacts': {
      'artifact2': {
        'base-directory': '$CODEBUILD_SRC_DIR_source2',
        'files': [
        'output2.txt',
        ],
      },
    },
    },
  },
});

Multiple inputs and outputs in CodePipeline

When you want to have multiple inputs and/or outputs for a Project used in a Pipeline, instead of using the secondarySources and secondaryArtifacts properties, you need to use the additionalInputArtifacts and additionalOutputArtifactNames properties of the CodeBuild CodePipeline Actions. Example:

const sourceAction1 = repository1.toCodePipelineSourceAction({
  actionName: 'Source1',
});
const sourceAction2 = repository2.toCodePipelineSourceAction({
  actionName: 'Source2',
  outputArtifactName: 'source2',
});

const buildAction = project.toCodePipelineBuildAction({
  actionName: 'Build',
  inputArtifact: sourceAction1.outputArtifact,
  outputArtifactName: 'artifact1', // for better buildspec readability - see below
  additionalInputArtifacts: [
    sourceAction2.outputArtifact, // this is where 'source2' comes from
  ],
  additionalOutputArtifactNames: [
    'artifact2',
  ],
});

Note: when a CodeBuild Action in a Pipeline has more than one output, it only uses the secondary-artifacts field of the buildspec, never the primary output specification directly under artifacts. Because of that, it pays to name even your primary output artifact on the Pipeline, like we did above, so that you know what name to use in the buildspec.

Example buildspec for the above project:

const project = new codebuild.PipelineProject(this, 'MyProject', {
  buildSpec: {
    version: '0.2',
    phases: {
    build: {
      commands: [
        // By default, you're in a directory with the contents of the repository from sourceAction1.
          // Use the CODEBUILD_SRC_DIR_source2 environment variable
          // to get a path to the directory with the contents of the second input repository.
        ],
      },
    },
    artifacts: {
      'secondary-artifacts': {
        'artifact1': {
          // primary Action output artifact,
          // available as buildAction.outputArtifact
        },
        'artifact2': {
          // additional output artifact,
          // available as buildAction.additionalOutputArtifact('artifact2')
        },
      },
    },
  },
  // ...
});

Reference

View in Nuget

csproj:

<PackageReference Include="Amazon.CDK.AWS.CodeBuild" Version="0.25.3" />

dotnet:

dotnet add package Amazon.CDK.AWS.CodeBuild --version 0.25.3

packages.config:

<package id="Amazon.CDK.AWS.CodeBuild" version="0.25.3" />

View in Maven Central

Apache Buildr:

'software.amazon.awscdk:codebuild:jar:0.25.3'

Apache Ivy:

<dependency groupId="software.amazon.awscdk" name="codebuild" rev="0.25.3"/>

Apache Maven:

<dependency>
  <groupId>software.amazon.awscdk</groupId>
  <artifactId>codebuild</artifactId>
  <version>0.25.3</version>
</dependency>

Gradle / Grails:

compile 'software.amazon.awscdk:codebuild:0.25.3'

Groovy Grape:

@Grapes(
@Grab(group='software.amazon.awscdk', module='codebuild', version='0.25.3')
)

View in NPM

npm:

$ npm i @aws-cdk/aws-codebuild@0.25.3

package.json:

{
  "@aws-cdk/aws-codebuild": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-codebuild@0.25.3

View in NPM

npm:

$ npm i @aws-cdk/aws-codebuild@0.25.3

package.json:

{
  "@aws-cdk/aws-codebuild": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-codebuild@0.25.3

BitBucketSource

class @aws-cdk/aws-codebuild.BitBucketSource(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BitBucketSource;
const { BitBucketSource } = require('@aws-cdk/aws-codebuild');
import { BitBucketSource } from '@aws-cdk/aws-codebuild';

BitBucket Source definition for a CodeBuild project.

Extends:GitBuildSource
Parameters:props (BitBucketSourceProps) –
toSourceProperty() → any

Overrides @aws-cdk/aws-codebuild.BuildSource.toSourceProperty()

Protected method

Return type:any
type

Implements @aws-cdk/aws-codebuild.BuildSource.type()

Type:SourceType (readonly)
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:ProjectTriggersProperty (optional)
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:string (optional) (readonly)
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty

Inherited from @aws-cdk/aws-codebuild.GitBuildSource

Return type:SourceProperty

BitBucketSourceProps (interface)

class @aws-cdk/aws-codebuild.BitBucketSourceProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BitBucketSourceProps;
// BitBucketSourceProps is an interface
import { BitBucketSourceProps } from '@aws-cdk/aws-codebuild';

Construction properties for {@link BitBucketSource}.

Extends:GitBuildSourceProps
owner

The BitBucket account/user that owns the repo.

Type:string
repo

The name of the repo (without the username).

Type:string
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSourceProps

The source identifier.

This property is required on secondary sources.

Type:string (optional)
cloneDepth

Inherited from @aws-cdk/aws-codebuild.GitBuildSourceProps

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.

Type:number (optional)

BuildArtifacts

class @aws-cdk/aws-codebuild.BuildArtifacts(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BuildArtifacts;
const { BuildArtifacts } = require('@aws-cdk/aws-codebuild');
import { BuildArtifacts } from '@aws-cdk/aws-codebuild';

Artifacts definition for a CodeBuild Project.

Abstract:Yes
Parameters:props (BuildArtifactsProps) –
toArtifactsJSON() → @aws-cdk/aws-codebuild.CfnProject.ArtifactsProperty
Return type:ArtifactsProperty
toArtifactsProperty() → any

Protected method

Return type:any
type

Protected property

Type:string (readonly) (abstract)
identifier
Type:string (optional) (readonly)

BuildArtifactsProps (interface)

class @aws-cdk/aws-codebuild.BuildArtifactsProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BuildArtifactsProps;
// BuildArtifactsProps is an interface
import { BuildArtifactsProps } from '@aws-cdk/aws-codebuild';

Properties common to all Artifacts classes.

identifier

The artifact identifier.

This property is required on secondary artifacts.

Type:string (optional)

BuildEnvironment (interface)

class @aws-cdk/aws-codebuild.BuildEnvironment

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BuildEnvironment;
// BuildEnvironment is an interface
import { BuildEnvironment } from '@aws-cdk/aws-codebuild';
buildImage

The image used for the builds.

Type:IBuildImage (optional)
Default:LinuxBuildImage.UBUNTU_14_04_BASE
computeType

The type of compute to use for this build.

See the {@link ComputeType} enum for the possible values.

Type:ComputeType (optional)
Default:taken from {@link #buildImage#defaultComputeType}
environmentVariables

The environment variables that your builds can use.

Type:string => BuildEnvironmentVariable (optional)
privileged

Indicates how the project builds Docker images. Specify true to enable

running the Docker daemon inside a Docker container. This value must be

set to true only if this build project will be used to build Docker

images, and the specified build environment image is not one provided by

AWS CodeBuild with Docker support. Otherwise, all associated builds that

attempt to interact with the Docker daemon will fail.

Type:boolean (optional)
Default:false

BuildEnvironmentVariable (interface)

class @aws-cdk/aws-codebuild.BuildEnvironmentVariable

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BuildEnvironmentVariable;
// BuildEnvironmentVariable is an interface
import { BuildEnvironmentVariable } from '@aws-cdk/aws-codebuild';
value

The value of the environment variable (or the name of the parameter in

the SSM parameter store.)

Type:any
type

The type of environment variable.

Type:BuildEnvironmentVariableType (optional)
Default:PlainText

BuildEnvironmentVariableType (enum)

class @aws-cdk/aws-codebuild.BuildEnvironmentVariableType

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BuildEnvironmentVariableType;
const { BuildEnvironmentVariableType } = require('@aws-cdk/aws-codebuild');
import { BuildEnvironmentVariableType } from '@aws-cdk/aws-codebuild';
PlainText

An environment variable in plaintext format.

ParameterStore

An environment variable stored in Systems Manager Parameter Store.

BuildSource

class @aws-cdk/aws-codebuild.BuildSource(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BuildSource;
const { BuildSource } = require('@aws-cdk/aws-codebuild');
import { BuildSource } from '@aws-cdk/aws-codebuild';

Source provider definition for a CodeBuild Project.

Abstract:Yes
Parameters:props (BuildSourceProps) –
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty
Return type:ProjectTriggersProperty (optional)
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty
Return type:SourceProperty
toSourceProperty() → any

Protected method

Return type:any
type
Type:SourceType (readonly) (abstract)
identifier
Type:string (optional) (readonly)

BuildSourceProps (interface)

class @aws-cdk/aws-codebuild.BuildSourceProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.BuildSourceProps;
// BuildSourceProps is an interface
import { BuildSourceProps } from '@aws-cdk/aws-codebuild';

Properties common to all Source classes.

identifier

The source identifier.

This property is required on secondary sources.

Type:string (optional)

CfnProject

class @aws-cdk/aws-codebuild.CfnProject(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject;
const { CfnProject } = require('@aws-cdk/aws-codebuild');
import { CfnProject } from '@aws-cdk/aws-codebuild';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
projectArn
Type:string (readonly)
projectName
Type:string (readonly)
propertyOverrides
Type:CfnProjectProps (readonly)
tags

The TagManager handles setting, removing and formatting tags

Tags should be managed either passing them as properties during

initiation or by calling methods on this object. If both techniques are

used only the tags from the TagManager will be used. Tag (aspect)

will use the manager.

Type:@aws-cdk/cdk.TagManager (readonly)
class ArtifactsProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.ArtifactsProperty;
// CfnProject.ArtifactsProperty is an interface
import { CfnProject.ArtifactsProperty } from '@aws-cdk/aws-codebuild';
type

CfnProject.ArtifactsProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-type

Type:string
artifactIdentifier

CfnProject.ArtifactsProperty.ArtifactIdentifier

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-artifactidentifier

Type:string (optional)
encryptionDisabled

CfnProject.ArtifactsProperty.EncryptionDisabled

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-encryptiondisabled

Type:boolean or @aws-cdk/cdk.Token (optional)
location

CfnProject.ArtifactsProperty.Location

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-location

Type:string (optional)
name

CfnProject.ArtifactsProperty.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-name

Type:string (optional)
namespaceType

CfnProject.ArtifactsProperty.NamespaceType

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-namespacetype

Type:string (optional)
overrideArtifactName

CfnProject.ArtifactsProperty.OverrideArtifactName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-overrideartifactname

Type:boolean or @aws-cdk/cdk.Token (optional)
packaging

CfnProject.ArtifactsProperty.Packaging

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-packaging

Type:string (optional)
path

CfnProject.ArtifactsProperty.Path

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-artifacts.html#cfn-codebuild-project-artifacts-path

Type:string (optional)
class CloudWatchLogsConfigProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.CloudWatchLogsConfigProperty;
// CfnProject.CloudWatchLogsConfigProperty is an interface
import { CfnProject.CloudWatchLogsConfigProperty } from '@aws-cdk/aws-codebuild';
status

CfnProject.CloudWatchLogsConfigProperty.Status

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-cloudwatchlogsconfig.html#cfn-codebuild-project-cloudwatchlogsconfig-status

Type:string
groupName

CfnProject.CloudWatchLogsConfigProperty.GroupName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-cloudwatchlogsconfig.html#cfn-codebuild-project-cloudwatchlogsconfig-groupname

Type:string (optional)
streamName

CfnProject.CloudWatchLogsConfigProperty.StreamName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-cloudwatchlogsconfig.html#cfn-codebuild-project-cloudwatchlogsconfig-streamname

Type:string (optional)
class EnvironmentProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.EnvironmentProperty;
// CfnProject.EnvironmentProperty is an interface
import { CfnProject.EnvironmentProperty } from '@aws-cdk/aws-codebuild';
computeType

CfnProject.EnvironmentProperty.ComputeType

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-computetype

Type:string
image

CfnProject.EnvironmentProperty.Image

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-image

Type:string
type

CfnProject.EnvironmentProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-type

Type:string
certificate

CfnProject.EnvironmentProperty.Certificate

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-certificate

Type:string (optional)
environmentVariables

CfnProject.EnvironmentProperty.EnvironmentVariables

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-environmentvariables

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or EnvironmentVariableProperty)[] (optional)
imagePullCredentialsType

CfnProject.EnvironmentProperty.ImagePullCredentialsType

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-imagepullcredentialstype

Type:string (optional)
privilegedMode

CfnProject.EnvironmentProperty.PrivilegedMode

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-privilegedmode

Type:boolean or @aws-cdk/cdk.Token (optional)
registryCredential

CfnProject.EnvironmentProperty.RegistryCredential

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-registrycredential

Type:@aws-cdk/cdk.Token or RegistryCredentialProperty (optional)
class EnvironmentVariableProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.EnvironmentVariableProperty;
// CfnProject.EnvironmentVariableProperty is an interface
import { CfnProject.EnvironmentVariableProperty } from '@aws-cdk/aws-codebuild';
name

CfnProject.EnvironmentVariableProperty.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environmentvariable.html#cfn-codebuild-project-environmentvariable-name

Type:string
value

CfnProject.EnvironmentVariableProperty.Value

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environmentvariable.html#cfn-codebuild-project-environmentvariable-value

Type:string
type

CfnProject.EnvironmentVariableProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environmentvariable.html#cfn-codebuild-project-environmentvariable-type

Type:string (optional)
class LogsConfigProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.LogsConfigProperty;
// CfnProject.LogsConfigProperty is an interface
import { CfnProject.LogsConfigProperty } from '@aws-cdk/aws-codebuild';
cloudWatchLogs

CfnProject.LogsConfigProperty.CloudWatchLogs

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-logsconfig.html#cfn-codebuild-project-logsconfig-cloudwatchlogs

Type:@aws-cdk/cdk.Token or CloudWatchLogsConfigProperty (optional)
s3Logs

CfnProject.LogsConfigProperty.S3Logs

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-logsconfig.html#cfn-codebuild-project-logsconfig-s3logs

Type:@aws-cdk/cdk.Token or S3LogsConfigProperty (optional)
class ProjectCacheProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.ProjectCacheProperty;
// CfnProject.ProjectCacheProperty is an interface
import { CfnProject.ProjectCacheProperty } from '@aws-cdk/aws-codebuild';
type

CfnProject.ProjectCacheProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html#cfn-codebuild-project-projectcache-type

Type:string
location

CfnProject.ProjectCacheProperty.Location

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html#cfn-codebuild-project-projectcache-location

Type:string (optional)
modes

CfnProject.ProjectCacheProperty.Modes

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html#cfn-codebuild-project-projectcache-modes

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
class ProjectTriggersProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.ProjectTriggersProperty;
// CfnProject.ProjectTriggersProperty is an interface
import { CfnProject.ProjectTriggersProperty } from '@aws-cdk/aws-codebuild';
filterGroups

CfnProject.ProjectTriggersProperty.FilterGroups

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projecttriggers.html#cfn-codebuild-project-projecttriggers-filtergroups

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or WebhookFilterProperty)[])[] (optional)
webhook

CfnProject.ProjectTriggersProperty.Webhook

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projecttriggers.html#cfn-codebuild-project-projecttriggers-webhook

Type:boolean or @aws-cdk/cdk.Token (optional)
class RegistryCredentialProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.RegistryCredentialProperty;
// CfnProject.RegistryCredentialProperty is an interface
import { CfnProject.RegistryCredentialProperty } from '@aws-cdk/aws-codebuild';
credential

CfnProject.RegistryCredentialProperty.Credential

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-registrycredential.html#cfn-codebuild-project-registrycredential-credential

Type:string
credentialProvider

CfnProject.RegistryCredentialProperty.CredentialProvider

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-registrycredential.html#cfn-codebuild-project-registrycredential-credentialprovider

Type:string
class S3LogsConfigProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.S3LogsConfigProperty;
// CfnProject.S3LogsConfigProperty is an interface
import { CfnProject.S3LogsConfigProperty } from '@aws-cdk/aws-codebuild';
status

CfnProject.S3LogsConfigProperty.Status

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-s3logsconfig.html#cfn-codebuild-project-s3logsconfig-status

Type:string
location

CfnProject.S3LogsConfigProperty.Location

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-s3logsconfig.html#cfn-codebuild-project-s3logsconfig-location

Type:string (optional)
class SourceAuthProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.SourceAuthProperty;
// CfnProject.SourceAuthProperty is an interface
import { CfnProject.SourceAuthProperty } from '@aws-cdk/aws-codebuild';
type

CfnProject.SourceAuthProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-sourceauth.html#cfn-codebuild-project-sourceauth-type

Type:string
resource

CfnProject.SourceAuthProperty.Resource

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-sourceauth.html#cfn-codebuild-project-sourceauth-resource

Type:string (optional)
class SourceProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.SourceProperty;
// CfnProject.SourceProperty is an interface
import { CfnProject.SourceProperty } from '@aws-cdk/aws-codebuild';
type

CfnProject.SourceProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-type

Type:string
auth

CfnProject.SourceProperty.Auth

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-auth

Type:@aws-cdk/cdk.Token or SourceAuthProperty (optional)
buildSpec

CfnProject.SourceProperty.BuildSpec

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-buildspec

Type:string (optional)
gitCloneDepth

CfnProject.SourceProperty.GitCloneDepth

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-gitclonedepth

Type:number or @aws-cdk/cdk.Token (optional)
insecureSsl

CfnProject.SourceProperty.InsecureSsl

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-insecuressl

Type:boolean or @aws-cdk/cdk.Token (optional)
location

CfnProject.SourceProperty.Location

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-location

Type:string (optional)
reportBuildStatus

CfnProject.SourceProperty.ReportBuildStatus

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-reportbuildstatus

Type:boolean or @aws-cdk/cdk.Token (optional)
sourceIdentifier

CfnProject.SourceProperty.SourceIdentifier

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-sourceidentifier

Type:string (optional)
class VpcConfigProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.VpcConfigProperty;
// CfnProject.VpcConfigProperty is an interface
import { CfnProject.VpcConfigProperty } from '@aws-cdk/aws-codebuild';
securityGroupIds

CfnProject.VpcConfigProperty.SecurityGroupIds

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-vpcconfig.html#cfn-codebuild-project-vpcconfig-securitygroupids

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
subnets

CfnProject.VpcConfigProperty.Subnets

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-vpcconfig.html#cfn-codebuild-project-vpcconfig-subnets

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
vpcId

CfnProject.VpcConfigProperty.VpcId

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-vpcconfig.html#cfn-codebuild-project-vpcconfig-vpcid

Type:string (optional)
class WebhookFilterProperty

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProject.WebhookFilterProperty;
// CfnProject.WebhookFilterProperty is an interface
import { CfnProject.WebhookFilterProperty } from '@aws-cdk/aws-codebuild';
pattern

CfnProject.WebhookFilterProperty.Pattern

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-webhookfilter.html#cfn-codebuild-project-webhookfilter-pattern

Type:string
type

CfnProject.WebhookFilterProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-webhookfilter.html#cfn-codebuild-project-webhookfilter-type

Type:string
excludeMatchedPattern

CfnProject.WebhookFilterProperty.ExcludeMatchedPattern

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-webhookfilter.html#cfn-codebuild-project-webhookfilter-excludematchedpattern

Type:boolean or @aws-cdk/cdk.Token (optional)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)

CfnProjectProps (interface)

class @aws-cdk/aws-codebuild.CfnProjectProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CfnProjectProps;
// CfnProjectProps is an interface
import { CfnProjectProps } from '@aws-cdk/aws-codebuild';
artifacts

AWS::CodeBuild::Project.Artifacts

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-artifacts

Type:ArtifactsProperty or @aws-cdk/cdk.Token
environment

AWS::CodeBuild::Project.Environment

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-environment

Type:@aws-cdk/cdk.Token or EnvironmentProperty
serviceRole

AWS::CodeBuild::Project.ServiceRole

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-servicerole

Type:string
source

AWS::CodeBuild::Project.Source

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-source

Type:SourceProperty or @aws-cdk/cdk.Token
badgeEnabled

AWS::CodeBuild::Project.BadgeEnabled

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-badgeenabled

Type:boolean or @aws-cdk/cdk.Token (optional)
cache

AWS::CodeBuild::Project.Cache

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-cache

Type:@aws-cdk/cdk.Token or ProjectCacheProperty (optional)
description

AWS::CodeBuild::Project.Description

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-description

Type:string (optional)
encryptionKey

AWS::CodeBuild::Project.EncryptionKey

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-encryptionkey

Type:string (optional)
logsConfig

AWS::CodeBuild::Project.LogsConfig

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-logsconfig

Type:@aws-cdk/cdk.Token or LogsConfigProperty (optional)
name

AWS::CodeBuild::Project.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-name

Type:string (optional)
queuedTimeoutInMinutes

AWS::CodeBuild::Project.QueuedTimeoutInMinutes

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-queuedtimeoutinminutes

Type:number or @aws-cdk/cdk.Token (optional)
secondaryArtifacts

AWS::CodeBuild::Project.SecondaryArtifacts

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-secondaryartifacts

Type:@aws-cdk/cdk.Token or (ArtifactsProperty or @aws-cdk/cdk.Token)[] (optional)
secondarySources

AWS::CodeBuild::Project.SecondarySources

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-secondarysources

Type:@aws-cdk/cdk.Token or (SourceProperty or @aws-cdk/cdk.Token)[] (optional)
tags

AWS::CodeBuild::Project.Tags

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-tags

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or @aws-cdk/cdk.CfnTag)[] (optional)
timeoutInMinutes

AWS::CodeBuild::Project.TimeoutInMinutes

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-timeoutinminutes

Type:number or @aws-cdk/cdk.Token (optional)
triggers

AWS::CodeBuild::Project.Triggers

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-triggers

Type:ProjectTriggersProperty or @aws-cdk/cdk.Token (optional)
vpcConfig

AWS::CodeBuild::Project.VpcConfig

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-vpcconfig

Type:@aws-cdk/cdk.Token or VpcConfigProperty (optional)

CodeCommitSource

class @aws-cdk/aws-codebuild.CodeCommitSource(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CodeCommitSource;
const { CodeCommitSource } = require('@aws-cdk/aws-codebuild');
import { CodeCommitSource } from '@aws-cdk/aws-codebuild';

CodeCommit Source definition for a CodeBuild project.

Extends:GitBuildSource
Parameters:props (CodeCommitSourceProps) –
toSourceProperty() → any

Overrides @aws-cdk/aws-codebuild.BuildSource.toSourceProperty()

Protected method

Return type:any
type

Implements @aws-cdk/aws-codebuild.BuildSource.type()

Type:SourceType (readonly)
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:ProjectTriggersProperty (optional)
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:string (optional) (readonly)
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty

Inherited from @aws-cdk/aws-codebuild.GitBuildSource

Return type:SourceProperty

CodeCommitSourceProps (interface)

class @aws-cdk/aws-codebuild.CodeCommitSourceProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CodeCommitSourceProps;
// CodeCommitSourceProps is an interface
import { CodeCommitSourceProps } from '@aws-cdk/aws-codebuild';

Construction properties for {@link CodeCommitSource}.

Extends:GitBuildSourceProps
repository
Type:@aws-cdk/aws-codecommit.IRepository
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSourceProps

The source identifier.

This property is required on secondary sources.

Type:string (optional)
cloneDepth

Inherited from @aws-cdk/aws-codebuild.GitBuildSourceProps

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.

Type:number (optional)

CodePipelineBuildArtifacts

class @aws-cdk/aws-codebuild.CodePipelineBuildArtifacts

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CodePipelineBuildArtifacts;
const { CodePipelineBuildArtifacts } = require('@aws-cdk/aws-codebuild');
import { CodePipelineBuildArtifacts } from '@aws-cdk/aws-codebuild';

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.

Extends:BuildArtifacts
type

Implements @aws-cdk/aws-codebuild.BuildArtifacts.type()

Protected property

Type:string (readonly)
toArtifactsJSON() → @aws-cdk/aws-codebuild.CfnProject.ArtifactsProperty

Inherited from @aws-cdk/aws-codebuild.BuildArtifacts

Return type:ArtifactsProperty
toArtifactsProperty() → any

Inherited from @aws-cdk/aws-codebuild.BuildArtifacts

Protected method

Return type:any
identifier

Inherited from @aws-cdk/aws-codebuild.BuildArtifacts

Type:string (optional) (readonly)

CodePipelineSource

class @aws-cdk/aws-codebuild.CodePipelineSource

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CodePipelineSource;
const { CodePipelineSource } = require('@aws-cdk/aws-codebuild');
import { CodePipelineSource } from '@aws-cdk/aws-codebuild';

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.

Extends:BuildSource
type

Implements @aws-cdk/aws-codebuild.BuildSource.type()

Type:SourceType (readonly)
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:ProjectTriggersProperty (optional)
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:SourceProperty
toSourceProperty() → any

Inherited from @aws-cdk/aws-codebuild.BuildSource

Protected method

Return type:any
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:string (optional) (readonly)

CommonCodeBuildActionProps (interface)

class @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CommonCodeBuildActionProps;
// CommonCodeBuildActionProps is an interface
import { CommonCodeBuildActionProps } from '@aws-cdk/aws-codebuild';

Common construction properties of all CodeBuild Pipeline Actions.

additionalInputArtifacts

The list of additional input Artifacts for this Action.

Type:@aws-cdk/aws-codepipeline-api.Artifact[] (optional)
additionalOutputArtifactNames

The list of names for additional output Artifacts for this Action.

The resulting output artifacts can be accessed with the additionalOutputArtifacts

method of the Action.

Type:string[] (optional)

CommonPipelineBuildActionProps (interface)

class @aws-cdk/aws-codebuild.CommonPipelineBuildActionProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CommonPipelineBuildActionProps;
// CommonPipelineBuildActionProps is an interface
import { CommonPipelineBuildActionProps } from '@aws-cdk/aws-codebuild';

Common properties for creating {@link PipelineBuildAction} -

either directly, through its constructor,

or through {@link IProject#toCodePipelineBuildAction}.

Extends:CommonCodeBuildActionProps
Extends:@aws-cdk/aws-codepipeline-api.CommonActionProps
inputArtifact

The source to use as input for this build.

Type:@aws-cdk/aws-codepipeline-api.Artifact
outputArtifactName

The name of the build’s output artifact.

Type:string (optional)
Default:an auto-generated name will be used
additionalInputArtifacts

Inherited from @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

The list of additional input Artifacts for this Action.

Type:@aws-cdk/aws-codepipeline-api.Artifact[] (optional)
additionalOutputArtifactNames

Inherited from @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

The list of names for additional output Artifacts for this Action.

The resulting output artifacts can be accessed with the additionalOutputArtifacts

method of the Action.

Type:string[] (optional)
actionName

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The physical, human-readable name of the Action.

Not that Action names must be unique within a single Stage.

Type:string
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

Type:number (optional)
Default:1

CommonPipelineTestActionProps (interface)

class @aws-cdk/aws-codebuild.CommonPipelineTestActionProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CommonPipelineTestActionProps;
// CommonPipelineTestActionProps is an interface
import { CommonPipelineTestActionProps } from '@aws-cdk/aws-codebuild';

Common properties for creating {@link PipelineTestAction} -

either directly, through its constructor,

or through {@link IProject#toCodePipelineTestAction}.

Extends:CommonCodeBuildActionProps
Extends:@aws-cdk/aws-codepipeline-api.CommonActionProps
inputArtifact

The source to use as input for this test.

Type:@aws-cdk/aws-codepipeline-api.Artifact
outputArtifactName

The optional name of the primary output artifact.

If you provide a value here,

then the outputArtifact property of your Action will be non-null.

If you don’t, outputArtifact will be null.

Type:string (optional)
Default:the Action will not have an output artifact
additionalInputArtifacts

Inherited from @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

The list of additional input Artifacts for this Action.

Type:@aws-cdk/aws-codepipeline-api.Artifact[] (optional)
additionalOutputArtifactNames

Inherited from @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

The list of names for additional output Artifacts for this Action.

The resulting output artifacts can be accessed with the additionalOutputArtifacts

method of the Action.

Type:string[] (optional)
actionName

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The physical, human-readable name of the Action.

Not that Action names must be unique within a single Stage.

Type:string
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

Type:number (optional)
Default:1

CommonProjectProps (interface)

class @aws-cdk/aws-codebuild.CommonProjectProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.CommonProjectProps;
// CommonProjectProps is an interface
import { CommonProjectProps } from '@aws-cdk/aws-codebuild';
badge

Indicates whether AWS CodeBuild generates a publicly accessible URL for

your project’s build badge. For more information, see Build Badges Sample

in the AWS CodeBuild User Guide.

Type:boolean (optional)
buildScriptAsset

Run a script from an asset as build script

If supplied together with buildSpec, the asset script will be run

_after_ the existing commands in buildspec.

This feature can also be used without a source, to simply run an

arbitrary script in a serverless way.

Type:@aws-cdk/assets.Asset (optional)
Default:No asset build script
buildScriptAssetEntrypoint

The script in the asset to run.

Type:string (optional)
Default:build.sh
buildSpec

Filename or contents of buildspec in JSON format.

Type:any (optional)
cacheBucket

Bucket to store cached source artifacts

If not specified, source artifacts will not be cached.

Type:@aws-cdk/aws-s3.IBucket (optional)
cacheDir

Subdirectory to store cached artifacts

Type:string (optional)
description

A description of the project. Use the description to identify the purpose

of the project.

Type:string (optional)
encryptionKey

Encryption key to use to read and write artifacts

If not specified, a role will be created.

Type:@aws-cdk/aws-kms.IEncryptionKey (optional)
environment

Build environment to use for the build.

Type:BuildEnvironment (optional)
environmentVariables

Additional environment variables to add to the build environment.

Type:string => BuildEnvironmentVariable (optional)
projectName

The physical, human-readable name of the CodeBuild Project.

Type:string (optional)
role

Service Role to assume while running the build.

If not specified, a role will be created.

Type:@aws-cdk/aws-iam.IRole (optional)
timeout

The number of minutes after which AWS CodeBuild stops the build if it’s

not complete. For valid values, see the timeoutInMinutes field in the AWS

CodeBuild User Guide.

Type:number (optional)

ComputeType (enum)

class @aws-cdk/aws-codebuild.ComputeType

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.ComputeType;
const { ComputeType } = require('@aws-cdk/aws-codebuild');
import { ComputeType } from '@aws-cdk/aws-codebuild';

Build machine compute type.

Small
Medium
Large

GitBuildSource

class @aws-cdk/aws-codebuild.GitBuildSource(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.GitBuildSource;
const { GitBuildSource } = require('@aws-cdk/aws-codebuild');
import { GitBuildSource } from '@aws-cdk/aws-codebuild';

A common superclass of all build sources that are backed by Git.

Extends:BuildSource
Abstract:Yes
Parameters:props (GitBuildSourceProps) –
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty

Overrides @aws-cdk/aws-codebuild.BuildSource.toSourceJSON()

Return type:SourceProperty
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:ProjectTriggersProperty (optional)
toSourceProperty() → any

Inherited from @aws-cdk/aws-codebuild.BuildSource

Protected method

Return type:any
type

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:SourceType (readonly) (abstract)
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:string (optional) (readonly)

GitBuildSourceProps (interface)

class @aws-cdk/aws-codebuild.GitBuildSourceProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.GitBuildSourceProps;
// GitBuildSourceProps is an interface
import { GitBuildSourceProps } from '@aws-cdk/aws-codebuild';

The construction properties common to all build sources that are backed by Git.

Extends:BuildSourceProps
cloneDepth

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.

Type:number (optional)
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSourceProps

The source identifier.

This property is required on secondary sources.

Type:string (optional)

GitHubEnterpriseSource

class @aws-cdk/aws-codebuild.GitHubEnterpriseSource(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.GitHubEnterpriseSource;
const { GitHubEnterpriseSource } = require('@aws-cdk/aws-codebuild');
import { GitHubEnterpriseSource } from '@aws-cdk/aws-codebuild';

GitHub Enterprise Source definition for a CodeBuild project.

Extends:GitBuildSource
Parameters:props (GitHubEnterpriseSourceProps) –
toSourceProperty() → any

Overrides @aws-cdk/aws-codebuild.BuildSource.toSourceProperty()

Protected method

Return type:any
type

Implements @aws-cdk/aws-codebuild.BuildSource.type()

Type:SourceType (readonly)
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:ProjectTriggersProperty (optional)
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:string (optional) (readonly)
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty

Inherited from @aws-cdk/aws-codebuild.GitBuildSource

Return type:SourceProperty

GitHubEnterpriseSourceProps (interface)

class @aws-cdk/aws-codebuild.GitHubEnterpriseSourceProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.GitHubEnterpriseSourceProps;
// GitHubEnterpriseSourceProps is an interface
import { GitHubEnterpriseSourceProps } from '@aws-cdk/aws-codebuild';

Construction properties for {@link GitHubEnterpriseSource}.

Extends:GitBuildSourceProps
httpsCloneUrl

The HTTPS URL of the repository in your GitHub Enterprise installation.

Type:string
oauthToken

The OAuth token used to authenticate when cloning the git repository.

Type:@aws-cdk/cdk.Secret
ignoreSslErrors

Whether to ignore SSL errors when connecting to the repository.

Type:boolean (optional)
Default:false
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSourceProps

The source identifier.

This property is required on secondary sources.

Type:string (optional)
cloneDepth

Inherited from @aws-cdk/aws-codebuild.GitBuildSourceProps

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.

Type:number (optional)

GitHubSource

class @aws-cdk/aws-codebuild.GitHubSource(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.GitHubSource;
const { GitHubSource } = require('@aws-cdk/aws-codebuild');
import { GitHubSource } from '@aws-cdk/aws-codebuild';

GitHub Source definition for a CodeBuild project.

Extends:GitBuildSource
Parameters:props (GitHubSourceProps) –
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty

Overrides @aws-cdk/aws-codebuild.BuildSource.buildTriggers()

Return type:ProjectTriggersProperty (optional)
toSourceProperty() → any

Overrides @aws-cdk/aws-codebuild.BuildSource.toSourceProperty()

Protected method

Return type:any
type

Implements @aws-cdk/aws-codebuild.BuildSource.type()

Type:SourceType (readonly)
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:string (optional) (readonly)
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty

Inherited from @aws-cdk/aws-codebuild.GitBuildSource

Return type:SourceProperty

GitHubSourceProps (interface)

class @aws-cdk/aws-codebuild.GitHubSourceProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.GitHubSourceProps;
// GitHubSourceProps is an interface
import { GitHubSourceProps } from '@aws-cdk/aws-codebuild';

Construction properties for {@link GitHubSource} and {@link GitHubEnterpriseSource}.

Extends:GitBuildSourceProps
oauthToken

The oAuthToken used to authenticate when cloning source git repo.

Note that you need to give CodeBuild permissions to your GitHub account in order for the token to work.

That is a one-time operation that can be done through the AWS Console for CodeBuild.

Type:@aws-cdk/cdk.Secret
owner

The GitHub account/user that owns the repo.

Type:string
repo

The name of the repo (without the username).

Type:string
reportBuildStatus

Whether to send GitHub notifications on your build’s start and end.

Type:boolean (optional)
Default:true
webhook

Whether to create a webhook that will trigger a build every time a commit is pushed to the GitHub repository.

Type:boolean (optional)
Default:false
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSourceProps

The source identifier.

This property is required on secondary sources.

Type:string (optional)
cloneDepth

Inherited from @aws-cdk/aws-codebuild.GitBuildSourceProps

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.

Type:number (optional)

IBuildImage (interface)

class @aws-cdk/aws-codebuild.IBuildImage

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.IBuildImage;
// IBuildImage is an interface
import { IBuildImage } from '@aws-cdk/aws-codebuild';

Represents a Docker image used for the CodeBuild Project builds.

Use the concrete subclasses, either:

{@link LinuxBuildImage} or {@link WindowsBuildImage}.

defaultComputeType

The default {@link ComputeType} to use with this image,

if one was not specified in {@link BuildEnvironment#computeType} explicitly.

Type:ComputeType (readonly)
imageId

The Docker image identifier that the build environment uses.

Type:string (readonly)
type

The type of build environment.

Type:string (readonly)
runScriptBuildspec(entrypoint) → any

Make a buildspec to run the indicated script

Parameters:entrypoint (string) –
Return type:any
Abstract:Yes
validate(buildEnvironment) → string[]

Allows the image a chance to validate whether the passed configuration is correct.

Parameters:buildEnvironment (BuildEnvironment) – the current build environment
Return type:string[]
Abstract:Yes

IProject (interface)

class @aws-cdk/aws-codebuild.IProject

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.IProject;
// IProject is an interface
import { IProject } from '@aws-cdk/aws-codebuild';
Extends:@aws-cdk/cdk.IConstruct
Extends:@aws-cdk/aws-events.IEventRuleTarget
projectArn

The ARN of this Project.

Type:string (readonly)
projectName

The human-visible name of this Project.

Type:string (readonly)
role

The IAM service Role of this Project. Undefined for imported Projects.

Type:@aws-cdk/aws-iam.IRole (optional) (readonly)
export() → @aws-cdk/aws-codebuild.ProjectImportProps

Export this Project. Allows referencing this Project in a different CDK Stack.

Return type:ProjectImportProps
Abstract:Yes
metric(metricName, props) → @aws-cdk/aws-cloudwatch.Metric
Parameters:
Returns:

a CloudWatch metric associated with this build project.

Return type:

@aws-cdk/aws-cloudwatch.Metric

Abstract:

Yes

metricBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Measures the number of builds triggered.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
Abstract:Yes
metricDuration([props]) → @aws-cdk/aws-cloudwatch.Metric

Measures the duration of all builds over time.

Units: Seconds

Valid CloudWatch statistics: Average (recommended), Maximum, Minimum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
Abstract:Yes
metricFailedBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Measures the number of builds that failed because of client error or

because of a timeout.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
Abstract:Yes
metricSucceededBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Measures the number of successful builds.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
Abstract:Yes
onBuildFailed(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines an event rule which triggers when a build fails.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onBuildStarted(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines an event rule which triggers when a build starts.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onBuildSucceeded(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines an event rule which triggers when a build completes successfully.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onPhaseChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule that triggers upon phase change of this

build project.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule triggered when the build project state

changes. You can filter specific build status events using an event

pattern filter on the build-status detail field:

const rule = project.onStateChange(‘OnBuildStarted’, target);

rule.addEventPattern({

detail: {

‘build-status’: [

“IN_PROGRESS”,

“SUCCEEDED”,

“FAILED”,

“STOPPED”

]

}

});

You can also use the methods onBuildFailed and onBuildSucceeded to define rules for

these specific state changes.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

toCodePipelineBuildAction(props) → @aws-cdk/aws-codebuild.PipelineBuildAction

Convenience method for creating a new {@link PipelineBuildAction CodeBuild build Action}.

Parameters:props (CommonPipelineBuildActionProps) – the construction properties of the new Action
Returns:the newly created {@link PipelineBuildAction CodeBuild build Action}
Return type:PipelineBuildAction
Abstract:Yes
toCodePipelineTestAction(props) → @aws-cdk/aws-codebuild.PipelineTestAction

Convenience method for creating a new {@link PipelineTestAction CodeBuild test Action}.

Parameters:props (CommonPipelineTestActionProps) – the construction properties of the new Action
Returns:the newly created {@link PipelineTestAction CodeBuild test Action}
Return type:PipelineTestAction
Abstract:Yes
asEventRuleTarget(ruleArn, ruleUniqueId) → @aws-cdk/aws-events.EventRuleTargetProps

Inherited from @aws-cdk/aws-events.IEventRuleTarget

Returns the rule target specification.

NOTE: Do not use the various inputXxx options. They can be set in a call to addTarget.

Parameters:
  • ruleArn (string) – The ARN of the CloudWatch Event Rule that would trigger this target.
  • ruleUniqueId (string) – A unique ID for this rule. Can be used to implement idempotency.
Return type:

@aws-cdk/aws-events.EventRuleTargetProps

Abstract:

Yes

node

Inherited from @aws-cdk/cdk.IConstruct

The construct node in the scope tree.

Type:@aws-cdk/cdk.ConstructNode (readonly)
dependencyRoots

Inherited from @aws-cdk/cdk.IDependable

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)

LinuxBuildImage

class @aws-cdk/aws-codebuild.LinuxBuildImage

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.LinuxBuildImage;
const { LinuxBuildImage } = require('@aws-cdk/aws-codebuild');
import { LinuxBuildImage } from '@aws-cdk/aws-codebuild';

A CodeBuild image running Linux.

This class has a bunch of public constants that represent the most popular images.

You can also specify a custom image using one of the static methods:

  • LinuxBuildImage.fromDockerHub(image)
  • LinuxBuildImage.fromEcrRepository(repo[, tag])
  • LinuxBuildImage.fromAsset(parent, id, props)
Implements:IBuildImage
static fromAsset(scope, id, props) → @aws-cdk/aws-codebuild.LinuxBuildImage

Uses an Docker image asset as a Linux build image.

Parameters:
Return type:

LinuxBuildImage

static fromDockerHub(name) → @aws-cdk/aws-codebuild.LinuxBuildImage
Parameters:name (string) –
Returns:a Linux build image from a Docker Hub image.
Return type:LinuxBuildImage
static fromEcrRepository(repository[, tag]) → @aws-cdk/aws-codebuild.LinuxBuildImage
Parameters:
Returns:

A Linux build image 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.

Return type:

LinuxBuildImage

runScriptBuildspec(entrypoint) → any

Implements @aws-cdk/aws-codebuild.IBuildImage.runScriptBuildspec()

Make a buildspec to run the indicated script

Parameters:entrypoint (string) –
Return type:any
validate(_) → string[]

Implements @aws-cdk/aws-codebuild.IBuildImage.validate()

Allows the image a chance to validate whether the passed configuration is correct.

Parameters:_ (BuildEnvironment) –
Return type:string[]
UBUNTU_14_04_ANDROID_JAVA8_24_4_1
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_ANDROID_JAVA8_26_1_1
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_BASE
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_DOCKER_17_09_0
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_DOTNET_CORE_1_1
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_DOTNET_CORE_2_0
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_DOTNET_CORE_2_1
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_GOLANG_1_10
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_NODEJS_10_1_0
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_NODEJS_6_3_1
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_NODEJS_8_11_0
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_OPEN_JDK_8
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_OPEN_JDK_9
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_PHP_5_6
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_PHP_7_0
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_PYTHON_2_7_12
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_PYTHON_3_3_6
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_PYTHON_3_4_5
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_PYTHON_3_5_2
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_PYTHON_3_6_5
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_RUBY_2_2_5
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_RUBY_2_3_1
Type:LinuxBuildImage (readonly) (static)
UBUNTU_14_04_RUBY_2_5_1
Type:LinuxBuildImage (readonly) (static)
defaultComputeType

Implements @aws-cdk/aws-codebuild.IBuildImage.defaultComputeType()

The default {@link ComputeType} to use with this image,

if one was not specified in {@link BuildEnvironment#computeType} explicitly.

Type:ComputeType (readonly)
imageId

Implements @aws-cdk/aws-codebuild.IBuildImage.imageId()

Type:string (readonly)
type

Implements @aws-cdk/aws-codebuild.IBuildImage.type()

The type of build environment.

Type:string (readonly)

NoBuildArtifacts

class @aws-cdk/aws-codebuild.NoBuildArtifacts

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.NoBuildArtifacts;
const { NoBuildArtifacts } = require('@aws-cdk/aws-codebuild');
import { NoBuildArtifacts } from '@aws-cdk/aws-codebuild';

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.

Extends:BuildArtifacts
type

Implements @aws-cdk/aws-codebuild.BuildArtifacts.type()

Protected property

Type:string (readonly)
toArtifactsJSON() → @aws-cdk/aws-codebuild.CfnProject.ArtifactsProperty

Inherited from @aws-cdk/aws-codebuild.BuildArtifacts

Return type:ArtifactsProperty
toArtifactsProperty() → any

Inherited from @aws-cdk/aws-codebuild.BuildArtifacts

Protected method

Return type:any
identifier

Inherited from @aws-cdk/aws-codebuild.BuildArtifacts

Type:string (optional) (readonly)

NoSource

class @aws-cdk/aws-codebuild.NoSource

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.NoSource;
const { NoSource } = require('@aws-cdk/aws-codebuild');
import { NoSource } from '@aws-cdk/aws-codebuild';

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.

Extends:BuildSource
type

Implements @aws-cdk/aws-codebuild.BuildSource.type()

Type:SourceType (readonly)
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:ProjectTriggersProperty (optional)
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:SourceProperty
toSourceProperty() → any

Inherited from @aws-cdk/aws-codebuild.BuildSource

Protected method

Return type:any
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:string (optional) (readonly)

PipelineBuildAction

class @aws-cdk/aws-codebuild.PipelineBuildAction(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.PipelineBuildAction;
const { PipelineBuildAction } = require('@aws-cdk/aws-codebuild');
import { PipelineBuildAction } from '@aws-cdk/aws-codebuild';

CodePipeline build Action that uses AWS CodeBuild.

Extends:@aws-cdk/aws-codepipeline-api.BuildAction
Parameters:props (PipelineBuildActionProps) –
additionalOutputArtifact(name) → @aws-cdk/aws-codepipeline-api.Artifact

Returns the additional output artifact with the given name,

or throws an exception if an artifact with that name was not found

in the additonal output artifacts.

The names are defined by the {@link CommonCodeBuildActionProps#additionalOutputArtifactNames}

property.

Parameters:name (string) – the name of the artifact to find
Returns:the artifact with the given name
Return type:@aws-cdk/aws-codepipeline-api.Artifact
additionalOutputArtifacts() → @aws-cdk/aws-codepipeline-api.Artifact[]

Returns the additional output artifacts defined for this Action.

Their names will be taken from the {@link CommonCodeBuildActionProps#additionalOutputArtifactNames}

property.

Returns:all additional output artifacts defined for this Action
Return type:@aws-cdk/aws-codepipeline-api.Artifact[]
bind(stage, _scope)

Implements @aws-cdk/aws-codepipeline-api.Action.bind()

The method called when an Action is attached to a Pipeline.

This method is guaranteed to be called only once for each Action instance.

Protected method

Parameters:
addInputArtifact(artifact) → @aws-cdk/aws-codepipeline-api.Action

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Parameters:artifact (@aws-cdk/aws-codepipeline-api.Artifact) –
Return type:@aws-cdk/aws-codepipeline-api.Action
addOutputArtifact(name) → @aws-cdk/aws-codepipeline-api.Artifact

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Parameters:name (string) –
Return type:@aws-cdk/aws-codepipeline-api.Artifact
onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codepipeline-api.Action

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

validate() → string[]

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Return type:string[]
actionName

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
category

Inherited from @aws-cdk/aws-codepipeline-api.Action

The category of the action.

The category defines which action type the owner

(the entity that performs the action) performs.

Type:@aws-cdk/aws-codepipeline-api.ActionCategory (readonly)
owner

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
provider

Inherited from @aws-cdk/aws-codepipeline-api.Action

The service provider that the action calls.

Type:string (readonly)
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.Action

The order in which AWS CodePipeline runs this action.

For more information, see the AWS CodePipeline User Guide.

https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#action-requirements

Type:number (readonly)
scope

Inherited from @aws-cdk/aws-codepipeline-api.Action

Retrieves the Construct scope of this Action.

Only available after the Action has been added to a Stage,

and that Stage to a Pipeline.

Protected property

Type:@aws-cdk/cdk.Construct (readonly)
version

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
configuration

Inherited from @aws-cdk/aws-codepipeline-api.Action

The action’s configuration. These are key-value pairs that specify input values for an action.

For more information, see the AWS CodePipeline User Guide.

http://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#action-requirements

Type:any (optional) (readonly)
region

Inherited from @aws-cdk/aws-codepipeline-api.Action

The AWS region the given Action resides in.

Note that a cross-region Pipeline requires replication buckets to function correctly.

You can provide their names with the {@link PipelineProps#crossRegionReplicationBuckets} property.

If you don’t, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets,

that you will need to cdk deploy before deploying the main, Pipeline-containing Stack.

Type:string (optional) (readonly)
Default:the Action resides in the same region as the Pipeline
role

Inherited from @aws-cdk/aws-codepipeline-api.Action

The service role that is assumed during execution of action.

This role is not mandatory, however more advanced configuration

may require specifying it.

Type:@aws-cdk/aws-iam.IRole (optional) (readonly)
outputArtifact

Inherited from @aws-cdk/aws-codepipeline-api.BuildAction

Type:@aws-cdk/aws-codepipeline-api.Artifact (readonly)

PipelineBuildActionProps (interface)

class @aws-cdk/aws-codebuild.PipelineBuildActionProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.PipelineBuildActionProps;
// PipelineBuildActionProps is an interface
import { PipelineBuildActionProps } from '@aws-cdk/aws-codebuild';

Construction properties of the {@link PipelineBuildAction CodeBuild build CodePipeline Action}.

Extends:CommonPipelineBuildActionProps
project

The build project

Type:IProject
additionalInputArtifacts

Inherited from @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

The list of additional input Artifacts for this Action.

Type:@aws-cdk/aws-codepipeline-api.Artifact[] (optional)
additionalOutputArtifactNames

Inherited from @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

The list of names for additional output Artifacts for this Action.

The resulting output artifacts can be accessed with the additionalOutputArtifacts

method of the Action.

Type:string[] (optional)
inputArtifact

Inherited from @aws-cdk/aws-codebuild.CommonPipelineBuildActionProps

The source to use as input for this build.

Type:@aws-cdk/aws-codepipeline-api.Artifact
outputArtifactName

Inherited from @aws-cdk/aws-codebuild.CommonPipelineBuildActionProps

The name of the build’s output artifact.

Type:string (optional)
Default:an auto-generated name will be used
actionName

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The physical, human-readable name of the Action.

Not that Action names must be unique within a single Stage.

Type:string
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

Type:number (optional)
Default:1

PipelineProject

class @aws-cdk/aws-codebuild.PipelineProject(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.PipelineProject;
const { PipelineProject } = require('@aws-cdk/aws-codebuild');
import { PipelineProject } from '@aws-cdk/aws-codebuild';

A convenience class for CodeBuild Projects that are used in CodePipeline.

Extends:

Project

Parameters:
addSecondaryArtifact(secondaryArtifact) → any

Inherited from @aws-cdk/aws-codebuild.Project

Adds a secondary artifact to the Project.

Parameters:secondaryArtifact (BuildArtifacts) – the artifact to add as a secondary artifact
Return type:any
addSecondarySource(secondarySource)

Inherited from @aws-cdk/aws-codebuild.Project

Adds a secondary source to the Project.

Parameters:secondarySource (BuildSource) – the source to add as a secondary source
addToRolePolicy(statement)

Inherited from @aws-cdk/aws-codebuild.Project

Add a permission only if there’s a policy attached.

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) – The permissions statement to add
export() → @aws-cdk/aws-codebuild.ProjectImportProps

Inherited from @aws-cdk/aws-codebuild.Project

Export this Project. Allows referencing this Project in a different CDK Stack.

Return type:ProjectImportProps
validate() → string[]

Inherited from @aws-cdk/aws-codebuild.Project

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Return type:string[]
projectArn

Inherited from @aws-cdk/aws-codebuild.Project

The ARN of the project.

Type:string (readonly)
projectName

Inherited from @aws-cdk/aws-codebuild.Project

The name of the project.

Type:string (readonly)
role

Inherited from @aws-cdk/aws-codebuild.Project

The IAM role for this project.

Type:@aws-cdk/aws-iam.IRole (optional) (readonly)
asEventRuleTarget(_ruleArn, _ruleId) → @aws-cdk/aws-events.EventRuleTargetProps

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Allows using build projects as event rule targets.

Parameters:
  • _ruleArn (string) –
  • _ruleId (string) –
Return type:

@aws-cdk/aws-events.EventRuleTargetProps

metric(metricName, props) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Parameters:
Returns:

a CloudWatch metric associated with this build project.

Return type:

@aws-cdk/aws-cloudwatch.Metric

metricBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Measures the number of builds triggered.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricDuration([props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Measures the duration of all builds over time.

Units: Seconds

Valid CloudWatch statistics: Average (recommended), Maximum, Minimum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricFailedBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Measures the number of builds that failed because of client error or

because of a timeout.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricSucceededBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Measures the number of successful builds.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
onBuildFailed(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines an event rule which triggers when a build fails.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onBuildStarted(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines an event rule which triggers when a build starts.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onBuildSucceeded(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines an event rule which triggers when a build completes successfully.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onPhaseChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines a CloudWatch event rule that triggers upon phase change of this

build project.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines a CloudWatch event rule triggered when the build project state

changes. You can filter specific build status events using an event

pattern filter on the build-status detail field:

const rule = project.onStateChange(‘OnBuildStarted’, target);

rule.addEventPattern({

detail: {

‘build-status’: [

“IN_PROGRESS”,

“SUCCEEDED”,

“FAILED”,

“STOPPED”

]

}

});

You can also use the methods onBuildFailed and onBuildSucceeded to define rules for

these specific state changes.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

toCodePipelineBuildAction(props) → @aws-cdk/aws-codebuild.PipelineBuildAction

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Convenience method for creating a new {@link PipelineBuildAction CodeBuild build Action}.

Parameters:props (CommonPipelineBuildActionProps) –
Return type:PipelineBuildAction
toCodePipelineTestAction(props) → @aws-cdk/aws-codebuild.PipelineTestAction

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Convenience method for creating a new {@link PipelineTestAction CodeBuild test Action}.

Parameters:props (CommonPipelineTestActionProps) –
Return type:PipelineTestAction
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

PipelineProjectProps (interface)

class @aws-cdk/aws-codebuild.PipelineProjectProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.PipelineProjectProps;
// PipelineProjectProps is an interface
import { PipelineProjectProps } from '@aws-cdk/aws-codebuild';
Extends:CommonProjectProps
badge

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Indicates whether AWS CodeBuild generates a publicly accessible URL for

your project’s build badge. For more information, see Build Badges Sample

in the AWS CodeBuild User Guide.

Type:boolean (optional)
buildScriptAsset

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Run a script from an asset as build script

If supplied together with buildSpec, the asset script will be run

_after_ the existing commands in buildspec.

This feature can also be used without a source, to simply run an

arbitrary script in a serverless way.

Type:@aws-cdk/assets.Asset (optional)
Default:No asset build script
buildScriptAssetEntrypoint

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

The script in the asset to run.

Type:string (optional)
Default:build.sh
buildSpec

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Filename or contents of buildspec in JSON format.

Type:any (optional)
cacheBucket

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Bucket to store cached source artifacts

If not specified, source artifacts will not be cached.

Type:@aws-cdk/aws-s3.IBucket (optional)
cacheDir

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Subdirectory to store cached artifacts

Type:string (optional)
description

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

A description of the project. Use the description to identify the purpose

of the project.

Type:string (optional)
encryptionKey

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Encryption key to use to read and write artifacts

If not specified, a role will be created.

Type:@aws-cdk/aws-kms.IEncryptionKey (optional)
environment

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Build environment to use for the build.

Type:BuildEnvironment (optional)
environmentVariables

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Additional environment variables to add to the build environment.

Type:string => BuildEnvironmentVariable (optional)
projectName

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

The physical, human-readable name of the CodeBuild Project.

Type:string (optional)
role

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Service Role to assume while running the build.

If not specified, a role will be created.

Type:@aws-cdk/aws-iam.IRole (optional)
timeout

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

The number of minutes after which AWS CodeBuild stops the build if it’s

not complete. For valid values, see the timeoutInMinutes field in the AWS

CodeBuild User Guide.

Type:number (optional)

PipelineTestAction

class @aws-cdk/aws-codebuild.PipelineTestAction(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.PipelineTestAction;
const { PipelineTestAction } = require('@aws-cdk/aws-codebuild');
import { PipelineTestAction } from '@aws-cdk/aws-codebuild';
Extends:@aws-cdk/aws-codepipeline-api.TestAction
Parameters:props (PipelineTestActionProps) –
additionalOutputArtifact(name) → @aws-cdk/aws-codepipeline-api.Artifact

Returns the additional output artifact with the given name,

or throws an exception if an artifact with that name was not found

in the additonal output artifacts.

The names are defined by the {@link CommonCodeBuildActionProps#additionalOutputArtifactNames}

property.

Parameters:name (string) – the name of the artifact to find
Returns:the artifact with the given name
Return type:@aws-cdk/aws-codepipeline-api.Artifact
additionalOutputArtifacts() → @aws-cdk/aws-codepipeline-api.Artifact[]

Returns the additional output artifacts defined for this Action.

Their names will be taken from the {@link CommonCodeBuildActionProps#additionalOutputArtifactNames}

property.

Returns:all additional output artifacts defined for this Action
Return type:@aws-cdk/aws-codepipeline-api.Artifact[]
bind(stage, _scope)

Implements @aws-cdk/aws-codepipeline-api.Action.bind()

The method called when an Action is attached to a Pipeline.

This method is guaranteed to be called only once for each Action instance.

Protected method

Parameters:
addInputArtifact(artifact) → @aws-cdk/aws-codepipeline-api.Action

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Parameters:artifact (@aws-cdk/aws-codepipeline-api.Artifact) –
Return type:@aws-cdk/aws-codepipeline-api.Action
addOutputArtifact(name) → @aws-cdk/aws-codepipeline-api.Artifact

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Parameters:name (string) –
Return type:@aws-cdk/aws-codepipeline-api.Artifact
onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codepipeline-api.Action

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

validate() → string[]

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Return type:string[]
actionName

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
category

Inherited from @aws-cdk/aws-codepipeline-api.Action

The category of the action.

The category defines which action type the owner

(the entity that performs the action) performs.

Type:@aws-cdk/aws-codepipeline-api.ActionCategory (readonly)
owner

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
provider

Inherited from @aws-cdk/aws-codepipeline-api.Action

The service provider that the action calls.

Type:string (readonly)
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.Action

The order in which AWS CodePipeline runs this action.

For more information, see the AWS CodePipeline User Guide.

https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#action-requirements

Type:number (readonly)
scope

Inherited from @aws-cdk/aws-codepipeline-api.Action

Retrieves the Construct scope of this Action.

Only available after the Action has been added to a Stage,

and that Stage to a Pipeline.

Protected property

Type:@aws-cdk/cdk.Construct (readonly)
version

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
configuration

Inherited from @aws-cdk/aws-codepipeline-api.Action

The action’s configuration. These are key-value pairs that specify input values for an action.

For more information, see the AWS CodePipeline User Guide.

http://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#action-requirements

Type:any (optional) (readonly)
region

Inherited from @aws-cdk/aws-codepipeline-api.Action

The AWS region the given Action resides in.

Note that a cross-region Pipeline requires replication buckets to function correctly.

You can provide their names with the {@link PipelineProps#crossRegionReplicationBuckets} property.

If you don’t, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets,

that you will need to cdk deploy before deploying the main, Pipeline-containing Stack.

Type:string (optional) (readonly)
Default:the Action resides in the same region as the Pipeline
role

Inherited from @aws-cdk/aws-codepipeline-api.Action

The service role that is assumed during execution of action.

This role is not mandatory, however more advanced configuration

may require specifying it.

Type:@aws-cdk/aws-iam.IRole (optional) (readonly)
outputArtifact

Inherited from @aws-cdk/aws-codepipeline-api.TestAction

Type:@aws-cdk/aws-codepipeline-api.Artifact (optional) (readonly)

PipelineTestActionProps (interface)

class @aws-cdk/aws-codebuild.PipelineTestActionProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.PipelineTestActionProps;
// PipelineTestActionProps is an interface
import { PipelineTestActionProps } from '@aws-cdk/aws-codebuild';

Construction properties of the {@link PipelineTestAction CodeBuild test CodePipeline Action}.

Extends:CommonPipelineTestActionProps
project

The build Project.

Type:IProject
additionalInputArtifacts

Inherited from @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

The list of additional input Artifacts for this Action.

Type:@aws-cdk/aws-codepipeline-api.Artifact[] (optional)
additionalOutputArtifactNames

Inherited from @aws-cdk/aws-codebuild.CommonCodeBuildActionProps

The list of names for additional output Artifacts for this Action.

The resulting output artifacts can be accessed with the additionalOutputArtifacts

method of the Action.

Type:string[] (optional)
inputArtifact

Inherited from @aws-cdk/aws-codebuild.CommonPipelineTestActionProps

The source to use as input for this test.

Type:@aws-cdk/aws-codepipeline-api.Artifact
outputArtifactName

Inherited from @aws-cdk/aws-codebuild.CommonPipelineTestActionProps

The optional name of the primary output artifact.

If you provide a value here,

then the outputArtifact property of your Action will be non-null.

If you don’t, outputArtifact will be null.

Type:string (optional)
Default:the Action will not have an output artifact
actionName

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The physical, human-readable name of the Action.

Not that Action names must be unique within a single Stage.

Type:string
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

Type:number (optional)
Default:1

Project

class @aws-cdk/aws-codebuild.Project(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.Project;
const { Project } = require('@aws-cdk/aws-codebuild');
import { Project } from '@aws-cdk/aws-codebuild';

A representation of a CodeBuild Project.

Extends:

ProjectBase

Parameters:
static import(scope, id, props) → @aws-cdk/aws-codebuild.IProject

Import a Project defined either outside the CDK,

or in a different CDK Stack

(and exported using the {@link export} method).

Parameters:
Returns:

a reference to the existing Project

Return type:

IProject

addSecondaryArtifact(secondaryArtifact) → any

Adds a secondary artifact to the Project.

Parameters:secondaryArtifact (BuildArtifacts) – the artifact to add as a secondary artifact
Return type:any
addSecondarySource(secondarySource)

Adds a secondary source to the Project.

Parameters:secondarySource (BuildSource) – the source to add as a secondary source
addToRolePolicy(statement)

Add a permission only if there’s a policy attached.

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) – The permissions statement to add
export() → @aws-cdk/aws-codebuild.ProjectImportProps

Implements @aws-cdk/aws-codebuild.ProjectBase.export()

Export this Project. Allows referencing this Project in a different CDK Stack.

Return type:ProjectImportProps
validate() → string[]

Overrides @aws-cdk/cdk.Construct.validate()

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Return type:string[]
projectArn

Implements @aws-cdk/aws-codebuild.ProjectBase.projectArn()

The ARN of the project.

Type:string (readonly)
projectName

Implements @aws-cdk/aws-codebuild.ProjectBase.projectName()

The name of the project.

Type:string (readonly)
role

Implements @aws-cdk/aws-codebuild.ProjectBase.role()

The IAM role for this project.

Type:@aws-cdk/aws-iam.IRole (optional) (readonly)
asEventRuleTarget(_ruleArn, _ruleId) → @aws-cdk/aws-events.EventRuleTargetProps

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Allows using build projects as event rule targets.

Parameters:
  • _ruleArn (string) –
  • _ruleId (string) –
Return type:

@aws-cdk/aws-events.EventRuleTargetProps

metric(metricName, props) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Parameters:
Returns:

a CloudWatch metric associated with this build project.

Return type:

@aws-cdk/aws-cloudwatch.Metric

metricBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Measures the number of builds triggered.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricDuration([props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Measures the duration of all builds over time.

Units: Seconds

Valid CloudWatch statistics: Average (recommended), Maximum, Minimum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricFailedBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Measures the number of builds that failed because of client error or

because of a timeout.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricSucceededBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Measures the number of successful builds.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
onBuildFailed(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines an event rule which triggers when a build fails.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onBuildStarted(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines an event rule which triggers when a build starts.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onBuildSucceeded(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines an event rule which triggers when a build completes successfully.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onPhaseChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines a CloudWatch event rule that triggers upon phase change of this

build project.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Defines a CloudWatch event rule triggered when the build project state

changes. You can filter specific build status events using an event

pattern filter on the build-status detail field:

const rule = project.onStateChange(‘OnBuildStarted’, target);

rule.addEventPattern({

detail: {

‘build-status’: [

“IN_PROGRESS”,

“SUCCEEDED”,

“FAILED”,

“STOPPED”

]

}

});

You can also use the methods onBuildFailed and onBuildSucceeded to define rules for

these specific state changes.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

toCodePipelineBuildAction(props) → @aws-cdk/aws-codebuild.PipelineBuildAction

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Convenience method for creating a new {@link PipelineBuildAction CodeBuild build Action}.

Parameters:props (CommonPipelineBuildActionProps) –
Return type:PipelineBuildAction
toCodePipelineTestAction(props) → @aws-cdk/aws-codebuild.PipelineTestAction

Inherited from @aws-cdk/aws-codebuild.ProjectBase

Convenience method for creating a new {@link PipelineTestAction CodeBuild test Action}.

Parameters:props (CommonPipelineTestActionProps) –
Return type:PipelineTestAction
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

ProjectBase

class @aws-cdk/aws-codebuild.ProjectBase(scope, id)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.ProjectBase;
const { ProjectBase } = require('@aws-cdk/aws-codebuild');
import { ProjectBase } from '@aws-cdk/aws-codebuild';

Represents a reference to a CodeBuild Project.

If you’re managing the Project alongside the rest of your CDK resources,

use the {@link Project} class.

If you want to reference an already existing Project

(or one defined in a different CDK Stack),

use the {@link import} method.

Extends:

@aws-cdk/cdk.Construct

Implements:

IProject

Abstract:

Yes

Parameters:
  • scope (@aws-cdk/cdk.Construct) – The scope in which to define this construct
  • id (string) – The scoped construct ID. Must be unique amongst siblings. If the ID includes a path separator (/), then it will be replaced by double dash .
asEventRuleTarget(_ruleArn, _ruleId) → @aws-cdk/aws-events.EventRuleTargetProps

Implements @aws-cdk/aws-events.IEventRuleTarget.asEventRuleTarget()

Allows using build projects as event rule targets.

Parameters:
  • _ruleArn (string) –
  • _ruleId (string) –
Return type:

@aws-cdk/aws-events.EventRuleTargetProps

export() → @aws-cdk/aws-codebuild.ProjectImportProps

Implements @aws-cdk/aws-codebuild.IProject.export()

Export this Project. Allows referencing this Project in a different CDK Stack.

Return type:ProjectImportProps
Abstract:Yes
metric(metricName, props) → @aws-cdk/aws-cloudwatch.Metric

Implements @aws-cdk/aws-codebuild.IProject.metric()

Parameters:
Returns:

a CloudWatch metric associated with this build project.

Return type:

@aws-cdk/aws-cloudwatch.Metric

metricBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Implements @aws-cdk/aws-codebuild.IProject.metricBuilds()

Measures the number of builds triggered.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricDuration([props]) → @aws-cdk/aws-cloudwatch.Metric

Implements @aws-cdk/aws-codebuild.IProject.metricDuration()

Measures the duration of all builds over time.

Units: Seconds

Valid CloudWatch statistics: Average (recommended), Maximum, Minimum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricFailedBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Implements @aws-cdk/aws-codebuild.IProject.metricFailedBuilds()

Measures the number of builds that failed because of client error or

because of a timeout.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricSucceededBuilds([props]) → @aws-cdk/aws-cloudwatch.Metric

Implements @aws-cdk/aws-codebuild.IProject.metricSucceededBuilds()

Measures the number of successful builds.

Units: Count

Valid CloudWatch statistics: Sum

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
onBuildFailed(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codebuild.IProject.onBuildFailed()

Defines an event rule which triggers when a build fails.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onBuildStarted(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codebuild.IProject.onBuildStarted()

Defines an event rule which triggers when a build starts.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onBuildSucceeded(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codebuild.IProject.onBuildSucceeded()

Defines an event rule which triggers when a build completes successfully.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onPhaseChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codebuild.IProject.onPhaseChange()

Defines a CloudWatch event rule that triggers upon phase change of this

build project.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codebuild.IProject.onStateChange()

Defines a CloudWatch event rule triggered when the build project state

changes. You can filter specific build status events using an event

pattern filter on the build-status detail field:

const rule = project.onStateChange(‘OnBuildStarted’, target);

rule.addEventPattern({

detail: {

‘build-status’: [

“IN_PROGRESS”,

“SUCCEEDED”,

“FAILED”,

“STOPPED”

]

}

});

You can also use the methods onBuildFailed and onBuildSucceeded to define rules for

these specific state changes.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

toCodePipelineBuildAction(props) → @aws-cdk/aws-codebuild.PipelineBuildAction

Implements @aws-cdk/aws-codebuild.IProject.toCodePipelineBuildAction()

Convenience method for creating a new {@link PipelineBuildAction CodeBuild build Action}.

Parameters:props (CommonPipelineBuildActionProps) –
Return type:PipelineBuildAction
toCodePipelineTestAction(props) → @aws-cdk/aws-codebuild.PipelineTestAction

Implements @aws-cdk/aws-codebuild.IProject.toCodePipelineTestAction()

Convenience method for creating a new {@link PipelineTestAction CodeBuild test Action}.

Parameters:props (CommonPipelineTestActionProps) –
Return type:PipelineTestAction
projectArn

Implements @aws-cdk/aws-codebuild.IProject.projectArn()

The ARN of this Project.

Type:string (readonly) (abstract)
projectName

Implements @aws-cdk/aws-codebuild.IProject.projectName()

The human-visible name of this Project.

Type:string (readonly) (abstract)
role

Implements @aws-cdk/aws-codebuild.IProject.role()

The IAM service Role of this Project. Undefined for imported Projects.

Type:@aws-cdk/aws-iam.IRole (optional) (readonly) (abstract)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

ProjectImportProps (interface)

class @aws-cdk/aws-codebuild.ProjectImportProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.ProjectImportProps;
// ProjectImportProps is an interface
import { ProjectImportProps } from '@aws-cdk/aws-codebuild';

Properties of a reference to a CodeBuild Project.

projectName

The human-readable name of the CodeBuild Project we’re referencing.

The Project must be in the same account and region as the root Stack.

Type:string

ProjectProps (interface)

class @aws-cdk/aws-codebuild.ProjectProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.ProjectProps;
// ProjectProps is an interface
import { ProjectProps } from '@aws-cdk/aws-codebuild';
Extends:CommonProjectProps
artifacts

Defines where build artifacts will be stored.

Could be: PipelineBuildArtifacts, NoBuildArtifacts and S3BucketBuildArtifacts.

Type:BuildArtifacts (optional)
Default:NoBuildArtifacts
secondaryArtifacts

The secondary artifacts for the Project.

Can also be added after the Project has been created by using the {@link Project#addSecondaryArtifact} method.

Type:BuildArtifacts[] (optional)
Default:[]
secondarySources

The secondary sources for the Project.

Can be also added after the Project has been created by using the {@link Project#addSecondarySource} method.

Type:BuildSource[] (optional)
Default:[]
source

The source of the build.

Note: if {@link NoSource} is given as the source,

then you need to provide an explicit buildSpec.

Type:BuildSource (optional)
Default:NoSource
badge

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Indicates whether AWS CodeBuild generates a publicly accessible URL for

your project’s build badge. For more information, see Build Badges Sample

in the AWS CodeBuild User Guide.

Type:boolean (optional)
buildScriptAsset

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Run a script from an asset as build script

If supplied together with buildSpec, the asset script will be run

_after_ the existing commands in buildspec.

This feature can also be used without a source, to simply run an

arbitrary script in a serverless way.

Type:@aws-cdk/assets.Asset (optional)
Default:No asset build script
buildScriptAssetEntrypoint

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

The script in the asset to run.

Type:string (optional)
Default:build.sh
buildSpec

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Filename or contents of buildspec in JSON format.

Type:any (optional)
cacheBucket

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Bucket to store cached source artifacts

If not specified, source artifacts will not be cached.

Type:@aws-cdk/aws-s3.IBucket (optional)
cacheDir

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Subdirectory to store cached artifacts

Type:string (optional)
description

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

A description of the project. Use the description to identify the purpose

of the project.

Type:string (optional)
encryptionKey

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Encryption key to use to read and write artifacts

If not specified, a role will be created.

Type:@aws-cdk/aws-kms.IEncryptionKey (optional)
environment

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Build environment to use for the build.

Type:BuildEnvironment (optional)
environmentVariables

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Additional environment variables to add to the build environment.

Type:string => BuildEnvironmentVariable (optional)
projectName

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

The physical, human-readable name of the CodeBuild Project.

Type:string (optional)
role

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

Service Role to assume while running the build.

If not specified, a role will be created.

Type:@aws-cdk/aws-iam.IRole (optional)
timeout

Inherited from @aws-cdk/aws-codebuild.CommonProjectProps

The number of minutes after which AWS CodeBuild stops the build if it’s

not complete. For valid values, see the timeoutInMinutes field in the AWS

CodeBuild User Guide.

Type:number (optional)

S3BucketBuildArtifacts

class @aws-cdk/aws-codebuild.S3BucketBuildArtifacts(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.S3BucketBuildArtifacts;
const { S3BucketBuildArtifacts } = require('@aws-cdk/aws-codebuild');
import { S3BucketBuildArtifacts } from '@aws-cdk/aws-codebuild';

S3 Artifact definition for a CodeBuild Project.

Extends:BuildArtifacts
Parameters:props (S3BucketBuildArtifactsProps) –
toArtifactsProperty() → any

Overrides @aws-cdk/aws-codebuild.BuildArtifacts.toArtifactsProperty()

Protected method

Return type:any
props
Type:S3BucketBuildArtifactsProps (readonly)
type

Implements @aws-cdk/aws-codebuild.BuildArtifacts.type()

Protected property

Type:string (readonly)
toArtifactsJSON() → @aws-cdk/aws-codebuild.CfnProject.ArtifactsProperty

Inherited from @aws-cdk/aws-codebuild.BuildArtifacts

Return type:ArtifactsProperty
identifier

Inherited from @aws-cdk/aws-codebuild.BuildArtifacts

Type:string (optional) (readonly)

S3BucketBuildArtifactsProps (interface)

class @aws-cdk/aws-codebuild.S3BucketBuildArtifactsProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.S3BucketBuildArtifactsProps;
// S3BucketBuildArtifactsProps is an interface
import { S3BucketBuildArtifactsProps } from '@aws-cdk/aws-codebuild';

Construction properties for {@link S3BucketBuildArtifacts}.

Extends:BuildArtifactsProps
bucket

The name of the output bucket.

Type:@aws-cdk/aws-s3.IBucket
name

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.

Type:string
includeBuildId

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>”.

Type:boolean (optional)
Default:true
packageZip

If this is true, all build output will be packaged into a single .zip file.

Otherwise, all files will be uploaded to <path>/<name>

Type:boolean (optional)
Default:true - files will be archived
path

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).

Type:string (optional)
identifier

Inherited from @aws-cdk/aws-codebuild.BuildArtifactsProps

The artifact identifier.

This property is required on secondary artifacts.

Type:string (optional)

S3BucketSource

class @aws-cdk/aws-codebuild.S3BucketSource(props)

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.S3BucketSource;
const { S3BucketSource } = require('@aws-cdk/aws-codebuild');
import { S3BucketSource } from '@aws-cdk/aws-codebuild';

S3 bucket definition for a CodeBuild project.

Extends:BuildSource
Parameters:props (S3BucketSourceProps) –
toSourceProperty() → any

Overrides @aws-cdk/aws-codebuild.BuildSource.toSourceProperty()

Protected method

Return type:any
type

Implements @aws-cdk/aws-codebuild.BuildSource.type()

Type:SourceType (readonly)
buildTriggers() → @aws-cdk/aws-codebuild.CfnProject.ProjectTriggersProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:ProjectTriggersProperty (optional)
toSourceJSON() → @aws-cdk/aws-codebuild.CfnProject.SourceProperty

Inherited from @aws-cdk/aws-codebuild.BuildSource

Return type:SourceProperty
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSource

Type:string (optional) (readonly)

S3BucketSourceProps (interface)

class @aws-cdk/aws-codebuild.S3BucketSourceProps

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.S3BucketSourceProps;
// S3BucketSourceProps is an interface
import { S3BucketSourceProps } from '@aws-cdk/aws-codebuild';

Construction properties for {@link S3BucketSource}.

Extends:BuildSourceProps
bucket
Type:@aws-cdk/aws-s3.IBucket
path
Type:string
identifier

Inherited from @aws-cdk/aws-codebuild.BuildSourceProps

The source identifier.

This property is required on secondary sources.

Type:string (optional)

SourceType (enum)

class @aws-cdk/aws-codebuild.SourceType

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.SourceType;
const { SourceType } = require('@aws-cdk/aws-codebuild');
import { SourceType } from '@aws-cdk/aws-codebuild';

Source types for CodeBuild Project

None
CodeCommit
CodePipeline
GitHub
GitHubEnterprise
BitBucket
S3

WindowsBuildImage

class @aws-cdk/aws-codebuild.WindowsBuildImage

Language-specific names:

using Amazon.CDK.AWS.CodeBuild;
import software.amazon.awscdk.services.codebuild.WindowsBuildImage;
const { WindowsBuildImage } = require('@aws-cdk/aws-codebuild');
import { WindowsBuildImage } from '@aws-cdk/aws-codebuild';

A CodeBuild image running Windows.

This class has a bunch of public constants that represent the most popular images.

You can also specify a custom image using one of the static methods:

  • WindowsBuildImage.fromDockerHub(image)
  • WindowsBuildImage.fromEcrRepository(repo[, tag])
  • WindowsBuildImage.fromAsset(parent, id, props)
Implements:IBuildImage
static fromAsset(scope, id, props) → @aws-cdk/aws-codebuild.WindowsBuildImage

Uses an Docker image asset as a Windows build image.

Parameters:
Return type:

WindowsBuildImage

static fromDockerHub(name) → @aws-cdk/aws-codebuild.WindowsBuildImage
Parameters:name (string) –
Returns:a Windows build image from a Docker Hub image.
Return type:WindowsBuildImage
static fromEcrRepository(repository[, tag]) → @aws-cdk/aws-codebuild.WindowsBuildImage
Parameters:
Returns:

A Linux build image 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.

Return type:

WindowsBuildImage

runScriptBuildspec(entrypoint) → any

Implements @aws-cdk/aws-codebuild.IBuildImage.runScriptBuildspec()

Make a buildspec to run the indicated script

Parameters:entrypoint (string) –
Return type:any
validate(buildEnvironment) → string[]

Implements @aws-cdk/aws-codebuild.IBuildImage.validate()

Allows the image a chance to validate whether the passed configuration is correct.

Parameters:buildEnvironment (BuildEnvironment) –
Return type:string[]
WIN_SERVER_CORE_2016_BASE
Type:WindowsBuildImage (readonly) (static)
defaultComputeType

Implements @aws-cdk/aws-codebuild.IBuildImage.defaultComputeType()

The default {@link ComputeType} to use with this image,

if one was not specified in {@link BuildEnvironment#computeType} explicitly.

Type:ComputeType (readonly)
imageId

Implements @aws-cdk/aws-codebuild.IBuildImage.imageId()

Type:string (readonly)
type

Implements @aws-cdk/aws-codebuild.IBuildImage.type()

The type of build environment.

Type:string (readonly)