Class: AWSCDK::AssetStagingProps
- Inherits:
-
FingerprintOptions
- Object
- FingerprintOptions
- AWSCDK::AssetStagingProps
- Defined in:
- asset_staging_props.rb
Overview
Initialization properties for AssetStaging.
Instance Attribute Summary collapse
-
#asset_hash ⇒ String?
readonly
Specify a custom hash for this asset.
-
#asset_hash_type ⇒ AWSCDK::AssetHashType?
readonly
Specifies the type of hash to calculate for this asset.
-
#bundling ⇒ AWSCDK::BundlingOptions?
readonly
Bundle the asset by executing a command in a Docker container or a custom bundling provider.
-
#exclude ⇒ Array<String>?
readonly
File paths matching the patterns will be excluded.
-
#extra_hash ⇒ String?
readonly
Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
-
#follow ⇒ AWSCDK::SymlinkFollowMode?
readonly
A strategy for how to handle symlinks.
-
#ignore_mode ⇒ AWSCDK::IgnoreMode?
readonly
The ignore behavior to use for
excludepatterns. -
#source_path ⇒ String
readonly
The source file or directory to copy from.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(exclude: nil, follow: nil, ignore_mode: nil, extra_hash: nil, asset_hash: nil, asset_hash_type: nil, bundling: nil, source_path:) ⇒ AssetStagingProps
constructor
A new instance of AssetStagingProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(exclude: nil, follow: nil, ignore_mode: nil, extra_hash: nil, asset_hash: nil, asset_hash_type: nil, bundling: nil, source_path:) ⇒ AssetStagingProps
Returns a new instance of AssetStagingProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'asset_staging_props.rb', line 16 def initialize(exclude: nil, follow: nil, ignore_mode: nil, extra_hash: nil, asset_hash: nil, asset_hash_type: nil, bundling: nil, source_path:) @exclude = exclude Jsii::Type.check_type(@exclude, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "exclude") unless @exclude.nil? @follow = follow Jsii::Type.check_type(@follow, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TeW1saW5rRm9sbG93TW9kZSJ9")), "follow") unless @follow.nil? @ignore_mode = ignore_mode Jsii::Type.check_type(@ignore_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JZ25vcmVNb2RlIn0=")), "ignoreMode") unless @ignore_mode.nil? @extra_hash = extra_hash Jsii::Type.check_type(@extra_hash, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "extraHash") unless @extra_hash.nil? @asset_hash = asset_hash Jsii::Type.check_type(@asset_hash, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assetHash") unless @asset_hash.nil? @asset_hash_type = asset_hash_type Jsii::Type.check_type(@asset_hash_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bc3NldEhhc2hUeXBlIn0=")), "assetHashType") unless @asset_hash_type.nil? @bundling = bundling.is_a?(Hash) ? ::AWSCDK::BundlingOptions.new(**bundling.transform_keys(&:to_sym)) : bundling Jsii::Type.check_type(@bundling, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5CdW5kbGluZ09wdGlvbnMifQ==")), "bundling") unless @bundling.nil? @source_path = source_path Jsii::Type.check_type(@source_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourcePath") end |
Instance Attribute Details
#asset_hash ⇒ String? (readonly)
Default: - based on assetHashType
Specify a custom hash for this asset.
If asset_hash_type is set it must
be set to AssetHashType.CUSTOM. For consistency, this custom hash will
be SHA256 hashed and encoded as hex. The resulting hash will be the asset
hash.
NOTE: the hash is used in order to identify a specific revision of the asset, and used for optimizing and caching deployment activities related to this asset such as packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will need to make sure it is updated every time the asset changes, or otherwise it is possible that some deployments will not be invalidated.
73 74 75 |
# File 'asset_staging_props.rb', line 73 def asset_hash @asset_hash end |
#asset_hash_type ⇒ AWSCDK::AssetHashType? (readonly)
Default: - the default is AssetHashType.SOURCE, but if assetHash is explicitly specified this value defaults to AssetHashType.CUSTOM.
Specifies the type of hash to calculate for this asset.
If asset_hash is configured, this option must be undefined or
AssetHashType.CUSTOM.
81 82 83 |
# File 'asset_staging_props.rb', line 81 def asset_hash_type @asset_hash_type end |
#bundling ⇒ AWSCDK::BundlingOptions? (readonly)
Default: - uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwise
Bundle the asset by executing a command in a Docker container or a custom bundling provider.
The asset path will be mounted at /asset-input. The Docker
container is responsible for putting content at /asset-output.
The content at /asset-output will be zipped and used as the
final asset.
91 92 93 |
# File 'asset_staging_props.rb', line 91 def bundling @bundling end |
#exclude ⇒ Array<String>? (readonly)
Default: - nothing is excluded
File paths matching the patterns will be excluded.
See ignore_mode to set the matching behavior.
Has no effect on Assets bundled using the bundling property.
42 43 44 |
# File 'asset_staging_props.rb', line 42 def exclude @exclude end |
#extra_hash ⇒ String? (readonly)
Default: - hash is only based on source content
Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
57 58 59 |
# File 'asset_staging_props.rb', line 57 def extra_hash @extra_hash end |
#follow ⇒ AWSCDK::SymlinkFollowMode? (readonly)
Default: SymlinkFollowMode.NEVER
A strategy for how to handle symlinks.
47 48 49 |
# File 'asset_staging_props.rb', line 47 def follow @follow end |
#ignore_mode ⇒ AWSCDK::IgnoreMode? (readonly)
Default: IgnoreMode.GLOB
The ignore behavior to use for exclude patterns.
52 53 54 |
# File 'asset_staging_props.rb', line 52 def ignore_mode @ignore_mode end |
#source_path ⇒ String (readonly)
The source file or directory to copy from.
95 96 97 |
# File 'asset_staging_props.rb', line 95 def source_path @source_path end |
Class Method Details
.jsii_properties ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'asset_staging_props.rb', line 97 def self.jsii_properties { :exclude => "exclude", :follow => "follow", :ignore_mode => "ignoreMode", :extra_hash => "extraHash", :asset_hash => "assetHash", :asset_hash_type => "assetHashType", :bundling => "bundling", :source_path => "sourcePath", } end |
Instance Method Details
#to_jsii ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'asset_staging_props.rb', line 110 def to_jsii result = {} result.merge!(super) result.merge!({ "exclude" => @exclude, "follow" => @follow, "ignoreMode" => @ignore_mode, "extraHash" => @extra_hash, "assetHash" => @asset_hash, "assetHashType" => @asset_hash_type, "bundling" => @bundling, "sourcePath" => @source_path, }) result.compact end |