Class: AWSCDK::AssetManifestFileDestination

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
asset_manifest_file_destination.rb

Overview

The destination for a file asset, when it is given to the AssetManifestBuilder.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bucket_name:, bucket_prefix: nil, role: nil) ⇒ AssetManifestFileDestination

Returns a new instance of AssetManifestFileDestination.

Parameters:

  • bucket_name (String)

    Bucket name where the file asset should be written.

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

    Prefix to prepend to the asset hash.

  • role (AWSCDK::RoleOptions, nil) (defaults to: nil)

    Role to use for uploading.



10
11
12
13
14
15
16
17
# File 'asset_manifest_file_destination.rb', line 10

def initialize(bucket_name:, bucket_prefix: nil, role: nil)
  @bucket_name = bucket_name
  Jsii::Type.check_type(@bucket_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketName")
  @bucket_prefix = bucket_prefix
  Jsii::Type.check_type(@bucket_prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketPrefix") unless @bucket_prefix.nil?
  @role = role.is_a?(Hash) ? ::AWSCDK::RoleOptions.new(**role.transform_keys(&:to_sym)) : role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Sb2xlT3B0aW9ucyJ9")), "role") unless @role.nil?
end

Instance Attribute Details

#bucket_nameString (readonly)

Bucket name where the file asset should be written.

Returns:

  • (String)


22
23
24
# File 'asset_manifest_file_destination.rb', line 22

def bucket_name
  @bucket_name
end

#bucket_prefixString? (readonly)

Note:

Default: ''

Prefix to prepend to the asset hash.

Returns:

  • (String, nil)


27
28
29
# File 'asset_manifest_file_destination.rb', line 27

def bucket_prefix
  @bucket_prefix
end

#roleAWSCDK::RoleOptions? (readonly)

Note:

Default: - current role

Role to use for uploading.

Returns:



32
33
34
# File 'asset_manifest_file_destination.rb', line 32

def role
  @role
end

Class Method Details

.jsii_propertiesObject



34
35
36
37
38
39
40
# File 'asset_manifest_file_destination.rb', line 34

def self.jsii_properties
  {
    :bucket_name => "bucketName",
    :bucket_prefix => "bucketPrefix",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



42
43
44
45
46
47
48
49
50
# File 'asset_manifest_file_destination.rb', line 42

def to_jsii
  result = {}
  result.merge!({
    "bucketName" => @bucket_name,
    "bucketPrefix" => @bucket_prefix,
    "role" => @role,
  })
  result.compact
end