Interface S3DownloadOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
S3DownloadOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-02T15:58:24.871Z") @Stability(Stable) public interface S3DownloadOptions extends software.amazon.jsii.JsiiSerializable
Options when downloading files from S3.

Example:

 import software.amazon.awscdk.services.s3.assets.Asset;
 Instance instance;
 Asset asset = Asset.Builder.create(this, "Asset")
         .path("./configure.sh")
         .build();
 String localPath = instance.userData.addS3DownloadCommand(S3DownloadOptions.builder()
         .bucket(asset.getBucket())
         .bucketKey(asset.getS3ObjectKey())
         .region("us-east-1")
         .build());
 instance.userData.addExecuteFileCommand(ExecuteFileOptions.builder()
         .filePath(localPath)
         .arguments("--verbose -y")
         .build());
 asset.grantRead(instance.getRole());
 
  • Method Details

    • getBucket

      @Stability(Stable) @NotNull IBucket getBucket()
      Name of the S3 bucket to download from.
    • getBucketKey

      @Stability(Stable) @NotNull String getBucketKey()
      The key of the file to download.
    • getLocalFile

      @Stability(Stable) @Nullable default String getLocalFile()
      The name of the local file.

      Default: Linux - /tmp/bucketKey Windows - %TEMP%/bucketKey

    • getRegion

      @Stability(Stable) @Nullable default String getRegion()
      The region of the S3 Bucket (needed for access via VPC Gateway).

      Default: none

    • builder

      @Stability(Stable) static S3DownloadOptions.Builder builder()
      Returns:
      a S3DownloadOptions.Builder of S3DownloadOptions