@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.297Z") @Stability(value=Stable) public abstract class Cache extends software.amazon.jsii.JsiiObject
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();
| Modifier | Constructor and Description |
|---|---|
protected |
Cache() |
protected |
Cache(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Cache(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and 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(LocalCacheMode... modes)
Create a local caching strategy.
|
static Cache |
none() |
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Cache(software.amazon.jsii.JsiiObjectRef objRef)
protected Cache(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) protected Cache()
@Stability(value=Stable) @NotNull public static Cache bucket(@NotNull IBucket bucket, @Nullable BucketCacheOptions options)
bucket - the S3 bucket to use for caching. This parameter is required.options - additional options to pass to the S3 caching.@Stability(value=Stable) @NotNull public static Cache bucket(@NotNull IBucket bucket)
bucket - the S3 bucket to use for caching. This parameter is required.@Stability(value=Stable) @NotNull public static Cache local(@NotNull LocalCacheMode... modes)
modes - the mode(s) to enable for local caching. This parameter is required.@Stability(value=Stable) @NotNull public static Cache none()
Copyright © 2022. All rights reserved.