@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:41.829Z") @Stability(value=Stable) public class Source extends software.amazon.jsii.JsiiObject
Usage:
Source.bucket(bucket, key)
Source.asset('/local/path/to/directory')
Source.asset('/local/path/to/a/file.zip')
Source.data('hello/world/file.txt', 'Hello, world!')
Source.data('config.json', { baz: topic.topicArn })
Example:
Bucket websiteBucket;
BucketDeployment deployment = BucketDeployment.Builder.create(this, "DeployWebsite")
.sources(List.of(Source.asset(join(__dirname, "my-website"))))
.destinationBucket(websiteBucket)
.build();
new ConstructThatReadsFromTheBucket(this, "Consumer", Map.of(
// Use 'deployment.deployedBucket' instead of 'websiteBucket' here
"bucket", deployment.getDeployedBucket()));
| Modifier | Constructor and Description |
|---|---|
protected |
Source(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Source(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static ISource |
asset(String path)
Uses a local asset as the deployment source.
|
static ISource |
asset(String path,
AssetOptions options)
Uses a local asset as the deployment source.
|
static ISource |
bucket(IBucket bucket,
String zipObjectKey)
Uses a .zip file stored in an S3 bucket as the source for the destination bucket contents.
|
static ISource |
data(String objectKey,
String data)
Deploys an object with the specified string contents into the bucket.
|
static ISource |
jsonData(String objectKey,
Object obj)
Deploys an object with the specified JSON object into the bucket.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Source(software.amazon.jsii.JsiiObjectRef objRef)
protected Source(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) @NotNull public static ISource asset(@NotNull String path, @Nullable AssetOptions options)
If the local asset is a .zip archive, make sure you trust the producer of the archive.
path - The path to a local .zip file or a directory. This parameter is required.options - @Stability(value=Stable) @NotNull public static ISource asset(@NotNull String path)
If the local asset is a .zip archive, make sure you trust the producer of the archive.
path - The path to a local .zip file or a directory. This parameter is required.@Stability(value=Stable) @NotNull public static ISource bucket(@NotNull IBucket bucket, @NotNull String zipObjectKey)
Make sure you trust the producer of the archive.
bucket - The S3 Bucket. This parameter is required.zipObjectKey - The S3 object key of the zip file with contents. This parameter is required.@Stability(value=Stable) @NotNull public static ISource data(@NotNull String objectKey, @NotNull String data)
The
content can include deploy-time values (such as snsTopic.topicArn) that
will get resolved only during deployment.
To store a JSON object use Source.jsonData().
objectKey - The destination S3 object key (relative to the root of the S3 deployment). This parameter is required.data - The data to be stored in the object. This parameter is required.@Stability(value=Stable) @NotNull public static ISource jsonData(@NotNull String objectKey, @NotNull Object obj)
The
object can include deploy-time values (such as snsTopic.topicArn) that
will get resolved only during deployment.
objectKey - The destination S3 object key (relative to the root of the S3 deployment). This parameter is required.obj - A JSON object. This parameter is required.Copyright © 2022. All rights reserved.