Interface BucketCacheOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
BucketCacheOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)",
date="2025-08-06T18:14:34.207Z")
@Stability(Stable)
public interface BucketCacheOptions
extends software.amazon.jsii.JsiiSerializable
Example:
Bucket sourceBucket; Bucket myCachingBucket; Project.Builder.create(this, "ProjectA") .source(Source.s3(S3SourceProps.builder() .bucket(sourceBucket) .path("path/to/source-a.zip") .build())) // configure the same bucket and path prefix .cache(Cache.bucket(myCachingBucket, BucketCacheOptions.builder() .prefix("cache") // use the same cache namespace .cacheNamespace("cache-namespace") .build())) .buildSpec(BuildSpec.fromObject(Map.of( "version", "0.2", "phases", Map.of( "build", Map.of( "commands", List.of("..."))), // specify the same cache key and paths "cache", Map.of( "key", "unique-key", "paths", List.of("/root/cachedir/**/*"))))) .build(); Project.Builder.create(this, "ProjectB") .source(Source.s3(S3SourceProps.builder() .bucket(sourceBucket) .path("path/to/source-b.zip") .build())) // configure the same bucket and path prefix .cache(Cache.bucket(myCachingBucket, BucketCacheOptions.builder() .prefix("cache") // use the same cache namespace .cacheNamespace("cache-namespace") .build())) .buildSpec(BuildSpec.fromObject(Map.of( "version", "0.2", "phases", Map.of( "build", Map.of( "commands", List.of("..."))), // specify the same cache key and paths "cache", Map.of( "key", "unique-key", "paths", List.of("/root/cachedir/**/*"))))) .build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
A builder forBucketCacheOptions
static final class
An implementation forBucketCacheOptions
-
Method Summary
Modifier and TypeMethodDescriptionstatic BucketCacheOptions.Builder
builder()
default String
Defines the scope of the cache.default String
The prefix to use to store the cache in the bucket.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCacheNamespace
Defines the scope of the cache.You can use this namespace to share a cache across multiple projects.
Default: undefined - No cache namespace, which means that the cache is not shared across multiple projects.
- See Also:
-
getPrefix
The prefix to use to store the cache in the bucket. -
builder
- Returns:
- a
BucketCacheOptions.Builder
ofBucketCacheOptions
-