AwsCodebuild

Service-level AWS CodeBuild component.

Remarks

This is the primary public component for CodeBuild project orchestration. It enforces repository naming and validation conventions while exposing the full provider-level project surface needed for common build workloads.

Naming:

  • Root: type ${namespace}:aws:AwsCodebuild; capability codebuild; identity is the raw args.name; target ${env}-${projectHash}-codebuild-${sanitiseNamePart(args.name)}. The identity must retain an ASCII alphanumeric character after sanitisation.
  • aws:codebuild/project:Project has parent AwsCodebuild, tuple [args.name], and target ${env}-${projectHash}-${sanitiseNamePart(args.name)}.
  • AWS provider name: Project name (source args.name) uses stackAndPurpose ${env}-${projectHash}-${purpose} through buildAwsNameFromCamelCasePurpose(...).

Example

CODE
const codebuildLogGroup = new AwsCloudwatch({
  logGroup: {
    name: 'dockerBuildLogs',
  },
});

const awsCodebuild = new AwsCodebuild({
  name: 'dockerBuild',
  serviceRole: 'jcag_project_codebuild_dockerBuildResourcePermissions',
  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/project-docker-build:2026-02-05',
    type: 'LINUX_CONTAINER',
    imagePullCredentialsType: 'SERVICE_ROLE',
    privilegedMode: true,
  },
  source: {
    buildspecFilePath: './buildspecs/docker-build.yml',
  },
  logsConfig: {
    cloudwatchLogs: {
      logGroup: codebuildLogGroup,
    },
  },
  buildTimeout: 45,
  concurrentBuildLimit: 35,
});

Constructors

new AwsCodebuild( args: AwsCodebuildArgs, options?: ComponentResourceOptions, ): AwsCodebuild

Parameters

  • args (AwsCodebuildArgs) — Service-level CodeBuild project inputs. args.name is the single logical identity input and must be a synchronous plain string. It drives Pulumi logical identity (component and child project logical names) and, separately, the AWS provider project name using stackAndPurpose ${environmentCode}-${projectHash}-${purpose}. These are distinct naming domains, and changing args.name changes both identities.
  • options (ComponentResourceOptions, optional) — Optional settings controlling resource behaviour.

Returns

AwsCodebuild

Hierarchy

  • ComponentResource
  • AwsCodebuild

Properties

arn: Output<string>

readonly

CodeBuild project ARN.

badgeUrl: Output<string>

readonly

Optional public badge URL when enabled.

project: Project

readonly

The underlying AWS CodeBuild project resource.

projectName: Output<string>

readonly

Effective generated AWS CodeBuild project name.

urn: Output<string>

readonly

Inherited from urn

The stable logical URN used to distinctly address a resource, both before and after deployments.

Methods

getData(): Promise<any>

protectedasync

Inherited from getData

Retrieves the data produces by initialize. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.

Returns

  • Promise<any>

getProvider(moduleMember: string): ProviderResource | undefined

Inherited from getProvider

Returns the provider for the given module member, if one exists.

Parameters

  • moduleMember (string)

Returns

  • ProviderResource | undefined

initialize( args: Inputs, opts?: ComponentResourceOptions, name?: string, type?: string, ): Promise<any>

protectedasync

Inherited from initialize

Can be overridden by a subclass to asynchronously initialize data for this component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use getData.

Parameters

  • args (Inputs)
  • opts (ComponentResourceOptions, optional)
  • name (string, optional)
  • type (string, optional)

Returns

  • Promise<any>

registerOutputs( outputs?: Inputs | Promise<Inputs> | Output<Inputs>, ): void

protected

Inherited from registerOutputs

Registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

Component resources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.

Parameters

  • outputs (Inputs | Promise<Inputs> | Output<Inputs>, optional)

Returns

  • void

Static Methods

isInstance(obj: any): obj is ComponentResource<any>

static

Inherited from isInstance

Returns true if the given object is a CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

Parameters

  • obj (any)

Returns

  • obj is ComponentResource<any>