java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.codebuild.Cache
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:54.868Z") @Stability(Stable) public abstract class Cache extends software.amazon.jsii.JsiiObject
Cache options for CodeBuild Project.

A cache can store reusable pieces of your build environment and use them across multiple builds.

Example:

 Bucket myCachingBucket;
 Project.Builder.create(this, "Project")
         .source(Source.bitBucket(BitBucketSourceProps.builder()
                 .owner("awslabs")
                 .repo("aws-cdk")
                 .build()))
         .cache(Cache.bucket(myCachingBucket))
         // BuildSpec with a 'cache' section necessary for S3 caching. This can
         // also come from 'buildspec.yml' in your source.
         .buildSpec(BuildSpec.fromObject(Map.of(
                 "version", "0.2",
                 "phases", Map.of(
                         "build", Map.of(
                                 "commands", List.of("..."))),
                 "cache", Map.of(
                         "paths", List.of("/root/cachedir/**/*")))))
         .build();
 

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    Cache(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Cache(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Cache
    bucket(IBucket bucket)
    Create an S3 caching strategy.
    static Cache
    bucket(IBucket bucket, BucketCacheOptions options)
    Create an S3 caching strategy.
    static Cache
    local(@NotNull LocalCacheMode... modes)
    Create a local caching strategy.
    static Cache
     

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • Cache

      protected Cache(software.amazon.jsii.JsiiObjectRef objRef)
    • Cache

      protected Cache(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Cache

      @Stability(Stable) protected Cache()
  • Method Details

    • bucket

      @Stability(Stable) @NotNull public static Cache bucket(@NotNull IBucket bucket, @Nullable BucketCacheOptions options)
      Create an S3 caching strategy.

      Parameters:
      bucket - the S3 bucket to use for caching. This parameter is required.
      options - additional options to pass to the S3 caching.
    • bucket

      @Stability(Stable) @NotNull public static Cache bucket(@NotNull IBucket bucket)
      Create an S3 caching strategy.

      Parameters:
      bucket - the S3 bucket to use for caching. This parameter is required.
    • local

      @Stability(Stable) @NotNull public static Cache local(@NotNull @NotNull LocalCacheMode... modes)
      Create a local caching strategy.

      Parameters:
      modes - the mode(s) to enable for local caching. This parameter is required.
    • none

      @Stability(Stable) @NotNull public static Cache none()