aws-cdk-lib.aws_codebuild.LocalCacheMode

enum LocalCacheMode

LanguageType name
.NETAmazon.CDK.AWS.CodeBuild.LocalCacheMode
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#LocalCacheMode
Javasoftware.amazon.awscdk.services.codebuild.LocalCacheMode
Pythonaws_cdk.aws_codebuild.LocalCacheMode
TypeScript (source)aws-cdk-lib » aws_codebuild » LocalCacheMode

Local cache modes to enable for the CodeBuild Project.

Example

new codebuild.Project(this, 'Project', {
  source: codebuild.Source.gitHubEnterprise({
    httpsCloneUrl: 'https://my-github-enterprise.com/owner/repo',
  }),

  // Enable Docker AND custom caching
  cache: codebuild.Cache.local(codebuild.LocalCacheMode.DOCKER_LAYER, codebuild.LocalCacheMode.CUSTOM),

  // BuildSpec with a 'cache' section necessary for 'CUSTOM' caching. This can
  // also come from 'buildspec.yml' in your source.
  buildSpec: codebuild.BuildSpec.fromObject({
    version: '0.2',
    phases: {
      build: {
        commands: ['...'],
      },
    },
    cache: {
      paths: [
        // The '**/*' is required to indicate all files in this directory
        '/root/cachedir/**/*',
      ],
    },
  }),
});

Members

NameDescription
SOURCECaches Git metadata for primary and secondary sources.
DOCKER_LAYERCaches existing Docker layers.
CUSTOMCaches directories you specify in the buildspec file.

SOURCE

Caches Git metadata for primary and secondary sources.


DOCKER_LAYER

Caches existing Docker layers.


CUSTOM

Caches directories you specify in the buildspec file.