Class: AWSCDK::CloudAssemblySchema::DockerCacheOption

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

Overview

Options for configuring the Docker cache backend.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, params: nil) ⇒ DockerCacheOption

Returns a new instance of DockerCacheOption.

Parameters:

  • type (String)

    The type of cache to use.

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

    Any parameters to pass into the docker cache backend configuration.



9
10
11
12
13
14
# File 'cloud_assembly_schema/docker_cache_option.rb', line 9

def initialize(type:, params: nil)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @params = params
  Jsii::Type.check_type(@params, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "params") unless @params.nil?
end

Instance Attribute Details

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

Note:

Default: {} No options provided

Any parameters to pass into the docker cache backend configuration.

Refer to https://docs.docker.com/build/cache/backends/ for cache backend configuration.

Examples:

branch = nil

params = {
    ref: "12345678.dkr.ecr.us-west-2.amazonaws.com/cache:#{branch}",
    mode: "max",
}

Returns:

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


39
40
41
# File 'cloud_assembly_schema/docker_cache_option.rb', line 39

def params
  @params
end

#typeString (readonly)

Note:

Default: - unspecified

The type of cache to use.

Refer to https://docs.docker.com/build/cache/backends/ for full list of backends.

Examples:

"registry"

Returns:

  • (String)


24
25
26
# File 'cloud_assembly_schema/docker_cache_option.rb', line 24

def type
  @type
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
# File 'cloud_assembly_schema/docker_cache_option.rb', line 41

def self.jsii_properties
  {
    :type => "type",
    :params => "params",
  }
end

Instance Method Details

#to_jsiiObject



48
49
50
51
52
53
54
55
# File 'cloud_assembly_schema/docker_cache_option.rb', line 48

def to_jsii
  result = {}
  result.merge!({
    "type" => @type,
    "params" => @params,
  })
  result.compact
end