Interface BucketCacheOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
BucketCacheOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)",
date="2025-12-18T18:20:06.891Z")
@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 classA builder forBucketCacheOptionsstatic final classAn implementation forBucketCacheOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic BucketCacheOptions.Builderbuilder()default StringDefines the scope of the cache.default StringThe 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.BuilderofBucketCacheOptions
-