Class: AWSCDK::EC2::S3DownloadOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/s3_download_options.rb

Overview

Options when downloading files from S3.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bucket:, bucket_key:, local_file: nil, region: nil) ⇒ S3DownloadOptions

Returns a new instance of S3DownloadOptions.

Parameters:

  • bucket (AWSCDK::Interfaces::AWSS3::IBucketRef)

    Name of the S3 bucket to download from.

  • bucket_key (String)

    The key of the file to download.

  • local_file (String, nil) (defaults to: nil)

    The name of the local file.

  • region (String, nil) (defaults to: nil)

    The region of the S3 Bucket (needed for access via VPC Gateway).



11
12
13
14
15
16
17
18
19
20
# File 'ec2/s3_download_options.rb', line 11

def initialize(bucket:, bucket_key:, local_file: nil, region: nil)
  @bucket = bucket
  Jsii::Type.check_type(@bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19zMy5JQnVja2V0UmVmIn0=")), "bucket")
  @bucket_key = bucket_key
  Jsii::Type.check_type(@bucket_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketKey")
  @local_file = local_file
  Jsii::Type.check_type(@local_file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "localFile") unless @local_file.nil?
  @region = region
  Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil?
end

Instance Attribute Details

#bucketAWSCDK::Interfaces::AWSS3::IBucketRef (readonly)

Name of the S3 bucket to download from.



25
26
27
# File 'ec2/s3_download_options.rb', line 25

def bucket
  @bucket
end

#bucket_keyString (readonly)

The key of the file to download.

Returns:

  • (String)


29
30
31
# File 'ec2/s3_download_options.rb', line 29

def bucket_key
  @bucket_key
end

#local_fileString? (readonly)

Note:

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

The name of the local file.

Returns:

  • (String, nil)


34
35
36
# File 'ec2/s3_download_options.rb', line 34

def local_file
  @local_file
end

#regionString? (readonly)

Note:

Default: none

The region of the S3 Bucket (needed for access via VPC Gateway).

Returns:

  • (String, nil)


39
40
41
# File 'ec2/s3_download_options.rb', line 39

def region
  @region
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
48
# File 'ec2/s3_download_options.rb', line 41

def self.jsii_properties
  {
    :bucket => "bucket",
    :bucket_key => "bucketKey",
    :local_file => "localFile",
    :region => "region",
  }
end

Instance Method Details

#to_jsiiObject



50
51
52
53
54
55
56
57
58
59
# File 'ec2/s3_download_options.rb', line 50

def to_jsii
  result = {}
  result.merge!({
    "bucket" => @bucket,
    "bucketKey" => @bucket_key,
    "localFile" => @local_file,
    "region" => @region,
  })
  result.compact
end