@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)",
date="2023-03-22T19:35:48.158Z")
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(java.lang.String path)
Uses a local asset as the deployment source.
|
static ISource |
asset(java.lang.String path,
AssetOptions options)
Uses a local asset as the deployment source.
|
static ISource |
bucket(IBucket bucket,
java.lang.String zipObjectKey)
Uses a .zip file stored in an S3 bucket as the source for the destination bucket contents.
|
static ISource |
data(java.lang.String objectKey,
java.lang.String data)
Deploys an object with the specified string contents into the bucket.
|
static ISource |
jsonData(java.lang.String objectKey,
java.lang.Object obj)
Deploys an object with the specified JSON object into the bucket.
|
protected Source(software.amazon.jsii.JsiiObjectRef objRef)
protected Source(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static ISource asset(java.lang.String path, 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
- public static ISource asset(java.lang.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.public static ISource bucket(IBucket bucket, java.lang.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.public static ISource data(java.lang.String objectKey, java.lang.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.public static ISource jsonData(java.lang.String objectKey, java.lang.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.