Class: AWSCDK::FileAssetSource
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::FileAssetSource
- Defined in:
- file_asset_source.rb
Overview
Represents the source for a file asset.
Instance Attribute Summary collapse
-
#deploy_time ⇒ Boolean?
readonly
Whether or not the asset needs to exist beyond deployment time;.
-
#display_name ⇒ String?
readonly
A display name for this asset.
-
#executable ⇒ Array<String>?
readonly
An external command that will produce the packaged asset.
-
#file_name ⇒ String?
readonly
The path, relative to the root of the cloud assembly, in which this asset source resides.
-
#packaging ⇒ AWSCDK::FileAssetPackaging?
readonly
Which type of packaging to perform.
-
#source_hash ⇒ String
readonly
A hash on the content source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source_hash:, deploy_time: nil, display_name: nil, executable: nil, file_name: nil, packaging: nil) ⇒ FileAssetSource
constructor
A new instance of FileAssetSource.
- #to_jsii ⇒ Object
Constructor Details
#initialize(source_hash:, deploy_time: nil, display_name: nil, executable: nil, file_name: nil, packaging: nil) ⇒ FileAssetSource
Returns a new instance of FileAssetSource.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'file_asset_source.rb', line 13 def initialize(source_hash:, deploy_time: nil, display_name: nil, executable: nil, file_name: nil, packaging: nil) @source_hash = source_hash Jsii::Type.check_type(@source_hash, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceHash") @deploy_time = deploy_time Jsii::Type.check_type(@deploy_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "deployTime") unless @deploy_time.nil? @display_name = display_name Jsii::Type.check_type(@display_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "displayName") unless @display_name.nil? @executable = executable Jsii::Type.check_type(@executable, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "executable") unless @executable.nil? @file_name = file_name Jsii::Type.check_type(@file_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fileName") unless @file_name.nil? @packaging = packaging Jsii::Type.check_type(@packaging, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5GaWxlQXNzZXRQYWNrYWdpbmcifQ==")), "packaging") unless @packaging.nil? end |
Instance Attribute Details
#deploy_time ⇒ Boolean? (readonly)
Default: false
Whether or not the asset needs to exist beyond deployment time;
i.e. are copied over to a different location and not needed afterwards. Setting this property to true has an impact on the lifecycle of the asset, because we will assume that it is safe to delete after the CloudFormation deployment succeeds.
For example, Lambda Function assets are copied over to Lambda during deployment. Therefore, it is not necessary to store the asset in S3, so we consider those deployTime assets.
50 51 52 |
# File 'file_asset_source.rb', line 50 def deploy_time @deploy_time end |
#display_name ⇒ String? (readonly)
Default: - The asset hash is used to display the asset
A display name for this asset.
If supplied, the display name will be used in locations where the asset identifier is printed, like in the CLI progress information.
58 59 60 |
# File 'file_asset_source.rb', line 58 def display_name @display_name end |
#executable ⇒ Array<String>? (readonly)
Default: - Exactly one of fileName and executable is required
An external command that will produce the packaged asset.
The command should produce the location of a ZIP file on stdout.
65 66 67 |
# File 'file_asset_source.rb', line 65 def executable @executable end |
#file_name ⇒ String? (readonly)
Default: - Exactly one of fileName and executable is required
The path, relative to the root of the cloud assembly, in which this asset source resides.
This can be a path to a file or a directory, depending on the packaging type.
73 74 75 |
# File 'file_asset_source.rb', line 73 def file_name @file_name end |
#packaging ⇒ AWSCDK::FileAssetPackaging? (readonly)
Default: - Required if fileName is specified.
Which type of packaging to perform.
78 79 80 |
# File 'file_asset_source.rb', line 78 def packaging @packaging end |
#source_hash ⇒ String (readonly)
A hash on the content source.
This hash is used to uniquely identify this asset throughout the system. If this value doesn't change, the asset will not be rebuilt or republished.
35 36 37 |
# File 'file_asset_source.rb', line 35 def source_hash @source_hash end |
Class Method Details
.jsii_properties ⇒ Object
80 81 82 83 84 85 86 87 88 89 |
# File 'file_asset_source.rb', line 80 def self.jsii_properties { :source_hash => "sourceHash", :deploy_time => "deployTime", :display_name => "displayName", :executable => "executable", :file_name => "fileName", :packaging => "packaging", } end |
Instance Method Details
#to_jsii ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'file_asset_source.rb', line 91 def to_jsii result = {} result.merge!({ "sourceHash" => @source_hash, "deployTime" => @deploy_time, "displayName" => @display_name, "executable" => @executable, "fileName" => @file_name, "packaging" => @packaging, }) result.compact end |