Class: AWSCDK::CloudAssemblySchema::ContainerImageAssetMetadataEntry

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_assembly_schema/container_image_asset_metadata_entry.rb

Overview

Metadata Entry spec for container images.

Examples:

entry = {
    packaging: "container-image",
    repository_name: "repository-name",
    image_tag: "tag",
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • id (String)

    Logical identifier for the asset.

  • packaging (String)

    Type of asset.

  • path (String)

    Path on disk to the asset.

  • source_hash (String)

    The hash of the asset source.

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

    Build args to pass to the docker build command.

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

    Build contexts to pass to the docker build command.

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

    Build secrets to pass to the docker build command.

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

    SSH agent socket or keys to pass to the docker build command.

  • cache_disabled (Boolean, nil) (defaults to: nil)

    Disable the cache and pass --no-cache to the docker build command.

  • cache_from (Array<AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption>, nil) (defaults to: nil)

    Cache from options to pass to the docker build command.

  • cache_to (AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption, nil) (defaults to: nil)

    Cache to options to pass to the docker build command.

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

    Path to the Dockerfile (relative to the directory).

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

    The docker image tag to use for tagging pushed images.

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

    Networking mode for the RUN commands during build.

  • outputs (Array<String>, nil) (defaults to: nil)

    Outputs to pass to the docker build command.

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

    Platform to build for.

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

    ECR repository name, if omitted a default name based on the asset's ID is used instead.

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

    Docker target to build to.



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_argsHash{String => String}? (readonly)

Note:

Default: no build args are passed

Build args to pass to the docker build command.

Returns:

  • (Hash{String => String}, nil)


91
92
93
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 91

def build_args
  @build_args
end

#build_contextsHash{String => String}? (readonly)

Note:

Default: no build contexts are passed

Build contexts to pass to the docker build command.

Returns:

  • (Hash{String => String}, nil)


96
97
98
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 96

def build_contexts
  @build_contexts
end

#build_secretsHash{String => String}? (readonly)

Note:

Default: no build secrets are passed

Build secrets to pass to the docker build command.

Returns:

  • (Hash{String => String}, nil)


101
102
103
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 101

def build_secrets
  @build_secrets
end

#build_sshString? (readonly)

Note:

Default: no ssh arg is passed

SSH agent socket or keys to pass to the docker build command.

Returns:

  • (String, nil)


106
107
108
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 106

def build_ssh
  @build_ssh
end

#cache_disabledBoolean? (readonly)

Note:

Default: - cache is used

Disable the cache and pass --no-cache to the docker build command.

Returns:

  • (Boolean, nil)


111
112
113
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 111

def cache_disabled
  @cache_disabled
end

#cache_fromArray<AWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption>? (readonly)

Note:

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_toAWSCDK::CloudAssemblySchema::ContainerImageAssetCacheOption? (readonly)

Note:

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

#fileString? (readonly)

Note:

Default: - no file is passed

Path to the Dockerfile (relative to the directory).

Returns:

  • (String, nil)


128
129
130
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 128

def file
  @file
end

#idString (readonly)

Logical identifier for the asset.

Returns:

  • (String)


74
75
76
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 74

def id
  @id
end

#image_tagString? (readonly)

Note:

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).

Returns:

  • (String, nil)


137
138
139
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 137

def image_tag
  @image_tag
end

#network_modeString? (readonly)

Note:

Default: - no networking mode specified

Networking mode for the RUN commands during build.

Returns:

  • (String, nil)


142
143
144
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 142

def network_mode
  @network_mode
end

#outputsArray<String>? (readonly)

Note:

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

#packagingString (readonly)

Type of asset.

Returns:

  • (String)


78
79
80
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 78

def packaging
  @packaging
end

#pathString (readonly)

Path on disk to the asset.

Returns:

  • (String)


82
83
84
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 82

def path
  @path
end

#platformString? (readonly)

Note:

Default: - current machine platform

Platform to build for.

Requires Docker Buildx.

Returns:

  • (String, nil)


155
156
157
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 155

def platform
  @platform
end

#repository_nameString? (readonly)

Note:

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.

Returns:

  • (String, nil)


164
165
166
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 164

def repository_name
  @repository_name
end

#source_hashString (readonly)

The hash of the asset source.

Returns:

  • (String)


86
87
88
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 86

def source_hash
  @source_hash
end

#targetString? (readonly)

Note:

Default: no build target

Docker target to build to.

Returns:

  • (String, nil)


169
170
171
# File 'cloud_assembly_schema/container_image_asset_metadata_entry.rb', line 169

def target
  @target
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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