Class: AWSCDK::CloudAssemblySchema::ContainerImageAssetMetadataEntry
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudAssemblySchema::ContainerImageAssetMetadataEntry
- Defined in:
- cloud_assembly_schema/container_image_asset_metadata_entry.rb
Overview
Metadata Entry spec for container images.
Instance Attribute Summary collapse
-
#build_args ⇒ Hash{String => String}?
readonly
Build args to pass to the
docker buildcommand. -
#build_contexts ⇒ Hash{String => String}?
readonly
Build contexts to pass to the
docker buildcommand. -
#build_secrets ⇒ Hash{String => String}?
readonly
Build secrets to pass to the
docker buildcommand. -
#build_ssh ⇒ String?
readonly
SSH agent socket or keys to pass to the
docker buildcommand. -
#cache_disabled ⇒ Boolean?
readonly
Disable the cache and pass
--no-cacheto thedocker buildcommand. -
#cache_from ⇒ Array<AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption>?
readonly
Cache from options to pass to the
docker buildcommand. -
#cache_to ⇒ AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption?
readonly
Cache to options to pass to the
docker buildcommand. -
#file ⇒ String?
readonly
Path to the Dockerfile (relative to the directory).
-
#id ⇒ String
readonly
Logical identifier for the asset.
-
#image_tag ⇒ String?
readonly
The docker image tag to use for tagging pushed images.
-
#network_mode ⇒ String?
readonly
Networking mode for the RUN commands during build.
-
#outputs ⇒ Array<String>?
readonly
Outputs to pass to the
docker buildcommand. -
#packaging ⇒ String
readonly
Type of asset.
-
#path ⇒ String
readonly
Path on disk to the asset.
-
#platform ⇒ String?
readonly
Platform to build for.
-
#repository_name ⇒ String?
readonly
ECR repository name, if omitted a default name based on the asset's ID is used instead.
-
#source_hash ⇒ String
readonly
The hash of the asset source.
-
#target ⇒ String?
readonly
Docker target to build to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, packaging:, path:, source_hash:, build_args: nil, build_contexts: nil, build_secrets: nil, build_ssh: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, file: nil, image_tag: nil, network_mode: nil, outputs: nil, platform: nil, repository_name: nil, target: nil) ⇒ ContainerImageAssetMetadataEntry
constructor
A new instance of ContainerImageAssetMetadataEntry.
- #to_jsii ⇒ Object
Constructor Details
#initialize(id:, packaging:, path:, source_hash:, build_args: nil, build_contexts: nil, build_secrets: nil, build_ssh: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, file: nil, image_tag: nil, network_mode: nil, outputs: nil, platform: nil, repository_name: nil, target: nil) ⇒ ContainerImageAssetMetadataEntry
Returns a new instance of ContainerImageAssetMetadataEntry.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 32 def initialize(id:, packaging:, path:, source_hash:, build_args: nil, build_contexts: nil, build_secrets: nil, build_ssh: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, file: nil, image_tag: nil, network_mode: nil, outputs: nil, platform: nil, repository_name: nil, target: nil) @id = id Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") @packaging = packaging Jsii::Type.check_type(@packaging, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "packaging") @path = path Jsii::Type.check_type(@path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") @source_hash = source_hash Jsii::Type.check_type(@source_hash, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceHash") @build_args = build_args Jsii::Type.check_type(@build_args, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "buildArgs") unless @build_args.nil? @build_contexts = build_contexts Jsii::Type.check_type(@build_contexts, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "buildContexts") unless @build_contexts.nil? @build_secrets = build_secrets Jsii::Type.check_type(@build_secrets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "buildSecrets") unless @build_secrets.nil? @build_ssh = build_ssh Jsii::Type.check_type(@build_ssh, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "buildSsh") unless @build_ssh.nil? @cache_disabled = cache_disabled Jsii::Type.check_type(@cache_disabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "cacheDisabled") unless @cache_disabled.nil? @cache_from = cache_from.is_a?(Array) ? cache_from.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : cache_from Jsii::Type.check_type(@cache_from, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmNsb3VkX2Fzc2VtYmx5X3NjaGVtYS5Db250YWluZXJJbWFnZUFzc2V0Q2FjaGVPcHRpb24ifSwia2luZCI6ImFycmF5In19")), "cacheFrom") unless @cache_from.nil? @cache_to = cache_to.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption.new(**cache_to.transform_keys(&:to_sym)) : cache_to Jsii::Type.check_type(@cache_to, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuQ29udGFpbmVySW1hZ2VBc3NldENhY2hlT3B0aW9uIn0=")), "cacheTo") unless @cache_to.nil? @file = file Jsii::Type.check_type(@file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "file") unless @file.nil? @image_tag = image_tag Jsii::Type.check_type(@image_tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageTag") unless @image_tag.nil? @network_mode = network_mode Jsii::Type.check_type(@network_mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "networkMode") unless @network_mode.nil? @outputs = outputs Jsii::Type.check_type(@outputs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "outputs") unless @outputs.nil? @platform = platform Jsii::Type.check_type(@platform, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "platform") unless @platform.nil? @repository_name = repository_name Jsii::Type.check_type(@repository_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "repositoryName") unless @repository_name.nil? @target = target Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "target") unless @target.nil? end |
Instance Attribute Details
#build_args ⇒ Hash{String => String}? (readonly)
Default: no build args are passed
Build args to pass to the docker build command.
91 92 93 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 91 def build_args @build_args end |
#build_contexts ⇒ Hash{String => String}? (readonly)
Default: no build contexts are passed
Build contexts to pass to the docker build command.
96 97 98 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 96 def build_contexts @build_contexts end |
#build_secrets ⇒ Hash{String => String}? (readonly)
Default: no build secrets are passed
Build secrets to pass to the docker build command.
101 102 103 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 101 def build_secrets @build_secrets end |
#build_ssh ⇒ String? (readonly)
Default: no ssh arg is passed
SSH agent socket or keys to pass to the docker build command.
106 107 108 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 106 def build_ssh @build_ssh end |
#cache_disabled ⇒ Boolean? (readonly)
Default: - cache is used
Disable the cache and pass --no-cache to the docker build command.
111 112 113 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 111 def cache_disabled @cache_disabled end |
#cache_from ⇒ Array<AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption>? (readonly)
Default: - no cache from options are passed to the build command
Cache from options to pass to the docker build command.
117 118 119 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 117 def cache_from @cache_from end |
#cache_to ⇒ AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption? (readonly)
Default: - no cache to options are passed to the build command
Cache to options to pass to the docker build command.
123 124 125 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 123 def cache_to @cache_to end |
#file ⇒ String? (readonly)
Default: - no file is passed
Path to the Dockerfile (relative to the directory).
128 129 130 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 128 def file @file end |
#id ⇒ String (readonly)
Logical identifier for the asset.
74 75 76 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 74 def id @id end |
#image_tag ⇒ String? (readonly)
Default: - this parameter is REQUIRED after 1.21.0
The docker image tag to use for tagging pushed images.
This field is
required if image_parameter_name is ommited (otherwise, the app won't be
able to find the image).
137 138 139 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 137 def image_tag @image_tag end |
#network_mode ⇒ String? (readonly)
Default: - no networking mode specified
Networking mode for the RUN commands during build.
142 143 144 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 142 def network_mode @network_mode end |
#outputs ⇒ Array<String>? (readonly)
Default: - no outputs are passed to the build command (default outputs are used)
Outputs to pass to the docker build command.
148 149 150 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 148 def outputs @outputs end |
#packaging ⇒ String (readonly)
Type of asset.
78 79 80 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 78 def packaging @packaging end |
#path ⇒ String (readonly)
Path on disk to the asset.
82 83 84 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 82 def path @path end |
#platform ⇒ String? (readonly)
Default: - current machine platform
Platform to build for.
Requires Docker Buildx.
155 156 157 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 155 def platform @platform end |
#repository_name ⇒ String? (readonly)
Default: - this parameter is REQUIRED after 1.21.0
ECR repository name, if omitted a default name based on the asset's ID is used instead.
Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts.
164 165 166 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 164 def repository_name @repository_name end |
#source_hash ⇒ String (readonly)
The hash of the asset source.
86 87 88 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 86 def source_hash @source_hash end |
#target ⇒ String? (readonly)
Default: no build target
Docker target to build to.
169 170 171 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 169 def target @target end |
Class Method Details
.jsii_properties ⇒ Object
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 171 def self.jsii_properties { :id => "id", :packaging => "packaging", :path => "path", :source_hash => "sourceHash", :build_args => "buildArgs", :build_contexts => "buildContexts", :build_secrets => "buildSecrets", :build_ssh => "buildSsh", :cache_disabled => "cacheDisabled", :cache_from => "cacheFrom", :cache_to => "cacheTo", :file => "file", :image_tag => "imageTag", :network_mode => "networkMode", :outputs => "outputs", :platform => "platform", :repository_name => "repositoryName", :target => "target", } end |
Instance Method Details
#to_jsii ⇒ Object
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 194 def to_jsii result = {} result.merge!({ "id" => @id, "packaging" => @packaging, "path" => @path, "sourceHash" => @source_hash, "buildArgs" => @build_args, "buildContexts" => @build_contexts, "buildSecrets" => @build_secrets, "buildSsh" => @build_ssh, "cacheDisabled" => @cache_disabled, "cacheFrom" => @cache_from, "cacheTo" => @cache_to, "file" => @file, "imageTag" => @image_tag, "networkMode" => @network_mode, "outputs" => @outputs, "platform" => @platform, "repositoryName" => @repository_name, "target" => @target, }) result.compact end |