Class: AWSCDK::CloudAssemblySchema::FileDestination

Inherits:
AWSDestination
  • Object
show all
Defined in:
cloud_assembly_schema/file_destination.rb

Overview

Where in S3 a file asset needs to be published.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(assume_role_additional_options: nil, assume_role_arn: nil, assume_role_external_id: nil, region: nil, bucket_name:, object_key:) ⇒ FileDestination

Returns a new instance of FileDestination.

Parameters:

  • assume_role_additional_options (Hash{String => Object}, nil) (defaults to: nil)

    Additional options to pass to STS when assuming the role.

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

    The role that needs to be assumed while publishing this asset.

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

    The ExternalId that needs to be supplied while assuming this role.

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

    The region where this asset will need to be published.

  • bucket_name (String)

    The name of the bucket.

  • object_key (String)

    The destination object key.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'cloud_assembly_schema/file_destination.rb', line 13

def initialize(assume_role_additional_options: nil, assume_role_arn: nil, assume_role_external_id: nil, region: nil, bucket_name:, object_key:)
  @assume_role_additional_options = assume_role_additional_options
  Jsii::Type.check_type(@assume_role_additional_options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "assumeRoleAdditionalOptions") unless @assume_role_additional_options.nil?
  @assume_role_arn = assume_role_arn
  Jsii::Type.check_type(@assume_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assumeRoleArn") unless @assume_role_arn.nil?
  @assume_role_external_id = assume_role_external_id
  Jsii::Type.check_type(@assume_role_external_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assumeRoleExternalId") unless @assume_role_external_id.nil?
  @region = region
  Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil?
  @bucket_name = bucket_name
  Jsii::Type.check_type(@bucket_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketName")
  @object_key = object_key
  Jsii::Type.check_type(@object_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectKey")
end

Instance Attribute Details

#assume_role_additional_optionsHash{String => Object}? (readonly)

Note:

Default: - No additional options.

Additional options to pass to STS when assuming the role.

  • RoleArn should not be used. Use the dedicated assume_role_arn property instead.
  • ExternalId should not be used. Use the dedicated assume_role_external_id instead.


36
37
38
# File 'cloud_assembly_schema/file_destination.rb', line 36

def assume_role_additional_options
  @assume_role_additional_options
end

#assume_role_arnString? (readonly)

Note:

Default: - No role will be assumed

The role that needs to be assumed while publishing this asset.

Returns:

  • (String, nil)


41
42
43
# File 'cloud_assembly_schema/file_destination.rb', line 41

def assume_role_arn
  @assume_role_arn
end

#assume_role_external_idString? (readonly)

Note:

Default: - No ExternalId will be supplied

The ExternalId that needs to be supplied while assuming this role.

Returns:

  • (String, nil)


46
47
48
# File 'cloud_assembly_schema/file_destination.rb', line 46

def assume_role_external_id
  @assume_role_external_id
end

#bucket_nameString (readonly)

The name of the bucket.

Returns:

  • (String)


55
56
57
# File 'cloud_assembly_schema/file_destination.rb', line 55

def bucket_name
  @bucket_name
end

#object_keyString (readonly)

The destination object key.

Returns:

  • (String)


59
60
61
# File 'cloud_assembly_schema/file_destination.rb', line 59

def object_key
  @object_key
end

#regionString? (readonly)

Note:

Default: - Current region

The region where this asset will need to be published.

Returns:

  • (String, nil)


51
52
53
# File 'cloud_assembly_schema/file_destination.rb', line 51

def region
  @region
end

Class Method Details

.jsii_propertiesObject



61
62
63
64
65
66
67
68
69
70
# File 'cloud_assembly_schema/file_destination.rb', line 61

def self.jsii_properties
  {
    :assume_role_additional_options => "assumeRoleAdditionalOptions",
    :assume_role_arn => "assumeRoleArn",
    :assume_role_external_id => "assumeRoleExternalId",
    :region => "region",
    :bucket_name => "bucketName",
    :object_key => "objectKey",
  }
end

Instance Method Details

#to_jsiiObject



72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'cloud_assembly_schema/file_destination.rb', line 72

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "assumeRoleAdditionalOptions" => @assume_role_additional_options,
    "assumeRoleArn" => @assume_role_arn,
    "assumeRoleExternalId" => @assume_role_external_id,
    "region" => @region,
    "bucketName" => @bucket_name,
    "objectKey" => @object_key,
  })
  result.compact
end