AwsCodebuildArgs
interface AwsCodebuildArgs extends Omit<aws.codebuild.ProjectArgs, 'artifacts' | 'encryptionKey' | 'environment' | 'name' | 'serviceRole' | 'source' | 'logsConfig' | 'tags' | 'vpcConfig'> {
artifacts?: Input<ProjectArtifacts>;
autoRetryLimit?: Input<number | undefined>;
badgeEnabled?: Input<boolean | undefined>;
buildBatchConfig?: Input<ProjectBuildBatchConfig | undefined>;
buildTimeout?: Input<number | undefined>;
cache?: Input<ProjectCache | undefined>;
concurrentBuildLimit?: Input<number | undefined>;
description?: Input<string | undefined>;
environment: Input<AwsCodebuildProjectEnvironmentDefaultsArgs>;
fileSystemLocations?: Input<Input<ProjectFileSystemLocation>[] | undefined>;
kmsKey?: AwsKmsKeyInput;
logsConfig: AwsCodebuildProjectLogsArgs;
name: string;
projectVisibility?: Input<string | undefined>;
queuedTimeout?: Input<number | undefined>;
region?: Input<string | undefined>;
resourceAccessRole?: Input<string | undefined>;
secondaryArtifacts?: Input<Input<ProjectSecondaryArtifact>[] | undefined>;
secondarySources?: Input<Input<ProjectSecondarySource>[] | undefined>;
secondarySourceVersions?: Input<Input<ProjectSecondarySourceVersion>[] | undefined>;
serviceRole: AwsCodebuildServiceRoleInput;
source: AwsCodebuildProjectSourceDefaultsArgs;
sourceVersion?: Input<string | undefined>;
tags?: Input<TagMap>;
vpcConfig?: AwsCodebuildProjectVpcConfigArgs;
}Input arguments for AwsCodebuild.
Remarks
name is the required purpose segment used to generate the effective AWS CodeBuild project name with naming style 2: ${env}-${projectHash}-${purpose}.
For buildspec handling:
- define
source.buildspecinline, or - define
source.buildspecFilePathfor local file-based input.
Applied defaults when omitted:
artifacts.type:NO_ARTIFACTScache.type:NO_CACHEsource.type:NO_SOURCEenvironment.type:LINUX_CONTAINERenvironment.computeType:BUILD_GENERAL1_SMALLenvironment.imagePullCredentialsType:SERVICE_ROLEenvironment.privilegedMode:falsebuildTimeout:60concurrentBuildLimit:15queuedTimeout:5badgeEnabled:falselogsConfig.cloudwatchLogs.status:ENABLEDlogsConfig.s3Logs.status:DISABLEDwhen no explicit S3 status is provided
When source.type resolves to NO_SOURCE, one buildspec input is required.
Example
const codebuildLogGroup = new AwsCloudwatch({
logGroup: {
name: 'dockerBuildLogs',
},
});
const args: AwsCodebuildArgs = {
name: 'dockerBuild',
serviceRole: 'arn:aws:iam::000000000000:role/codebuild-service-role',
description: 'Build Docker images and push to ECR',
artifacts: {
type: 'NO_ARTIFACTS',
},
environment: {
computeType: 'BUILD_GENERAL1_LARGE',
image: '000000000000.dkr.ecr.eu-west-1.amazonaws.com/codebuild/docker-build:2026-02-05',
type: 'LINUX_CONTAINER',
imagePullCredentialsType: 'SERVICE_ROLE',
privilegedMode: true,
environmentVariables: [
{ name: 'PROJECT', value: 'dummy' },
{ name: 'BRANCH', value: 'main' },
],
},
source: {
type: 'NO_SOURCE',
buildspec: `version: 0.2\nphases:\n build:\n commands:\n - echo build`,
},
logsConfig: {
cloudwatchLogs: {
logGroup: codebuildLogGroup,
},
},
};Hierarchy
ProjectArgs, "artifacts" | "encryptionKey" | "environment" | "name" | "serviceRole" | "source" | "logsConfig" | "tags" | "vpcConfig">AwsCodebuildArgs
Properties
artifacts: Input<ProjectArtifacts>
Build artifacts configuration. Defaults to NO_ARTIFACTS when omitted.
autoRetryLimit: Input<number | undefined>
Inherited from autoRetryLimit
Specify a maximum number of additional automatic retries after a failed build. The default is 0.
badgeEnabled: Input<boolean | undefined>
Inherited from badgeEnabled
Generates a publicly-accessible URL for the projects build badge. Available as badgeUrl attribute when enabled.
buildBatchConfig: Input<ProjectBuildBatchConfig | undefined>
Inherited from buildBatchConfig
Defines the batch build options for the project.
buildTimeout: Input<number | undefined>
Inherited from buildTimeout
Number of minutes, from 5 to 2160 (36 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes. The buildTimeout property is not available on the Lambda compute type.
cache: Input<ProjectCache | undefined>
Inherited from cache
Configuration block. Detailed below.
concurrentBuildLimit: Input<number | undefined>
Inherited from concurrentBuildLimit
Specify a maximum number of concurrent builds for the project. The value specified must be greater than 0 and less than the account concurrent running builds limit.
description: Input<string | undefined>
Inherited from description
Short description of the project.
environment: Input<AwsCodebuildProjectEnvironmentDefaultsArgs>
Build-environment configuration.
fileSystemLocations: Input<Input<ProjectFileSystemLocation>[] | undefined>
Inherited from fileSystemLocations
A set of file system locations to mount inside the build. File system locations are documented below.
kmsKey: AwsKmsKeyInput
Optional customer-managed KMS key used to encrypt build artefacts.
logsConfig: AwsCodebuildProjectLogsArgs
Required logging configuration. CloudWatch logging requires an AwsCloudwatch log-group reference and S3 defaults to DISABLED when its status is omitted.
name: string
Single logical identity input used to derive Pulumi logical names and the AWS project name.
Remarks
This value must be a synchronous plain string. It drives both naming domains:
- Pulumi logical identity for the component and child project resources.
- AWS provider project name using stackAndPurpose
${environmentCode}-${projectHash}-${purpose}.
These naming domains are distinct. Changing name changes Pulumi logical identity (which can trigger replacement) and the provider project name.
projectVisibility: Input<string | undefined>
Inherited from projectVisibility
Specifies the visibility of the project's builds. Possible values are: PUBLIC_READ and PRIVATE. Default value is PRIVATE.
queuedTimeout: Input<number | undefined>
Inherited from queuedTimeout
Number of minutes, from 5 to 480 (8 hours), a build is allowed to be queued before it times out. The default is 8 hours. The queuedTimeout property is not available on the Lambda compute type.
region: Input<string | undefined>
Inherited from region
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
resourceAccessRole: Input<string | undefined>
Inherited from resourceAccessRole
The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the project's builds in order to display them publicly. Only applicable if projectVisibility is PUBLIC_READ.
secondaryArtifacts: Input<Input<ProjectSecondaryArtifact>[] | undefined>
Inherited from secondaryArtifacts
Configuration block. Detailed below.
secondarySources: Input<Input<ProjectSecondarySource>[] | undefined>
Inherited from secondarySources
Configuration block. Detailed below.
secondarySourceVersions: Input<Input<ProjectSecondarySourceVersion>[] | undefined>
Inherited from secondarySourceVersions
Configuration block. Detailed below.
serviceRole: AwsCodebuildServiceRoleInput
Service role input for the CodeBuild project.
source: AwsCodebuildProjectSourceDefaultsArgs
Source configuration with optional inline or file-based buildspec input; defaults type to NO_SOURCE when omitted.
sourceVersion: Input<string | undefined>
Inherited from sourceVersion
Version of the build input to be built for this project. If not specified, the latest version is used.
tags: Input<TagMap>
Optional tags merged with runtime default project/environment tags.
vpcConfig: AwsCodebuildProjectVpcConfigArgs
Optional VPC configuration. When set, all VPC fields are required and list fields must be non-empty.