Class: AWSCDK::Lambda::CodeImageConfig

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lambda/code_image_config.rb

Overview

Result of the bind when an ECR image is used.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image_uri:, cmd: nil, entrypoint: nil, working_directory: nil) ⇒ CodeImageConfig

Returns a new instance of CodeImageConfig.

Parameters:

  • image_uri (String)

    URI to the Docker image.

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

    Specify or override the CMD on the specified Docker image or Dockerfile.

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

    Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile.

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

    Specify or override the WORKDIR on the specified Docker image or Dockerfile.



11
12
13
14
15
16
17
18
19
20
# File 'lambda/code_image_config.rb', line 11

def initialize(image_uri:, cmd: nil, entrypoint: nil, working_directory: nil)
  @image_uri = image_uri
  Jsii::Type.check_type(@image_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageUri")
  @cmd = cmd
  Jsii::Type.check_type(@cmd, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "cmd") unless @cmd.nil?
  @entrypoint = entrypoint
  Jsii::Type.check_type(@entrypoint, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "entrypoint") unless @entrypoint.nil?
  @working_directory = working_directory
  Jsii::Type.check_type(@working_directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "workingDirectory") unless @working_directory.nil?
end

Instance Attribute Details

#cmdArray<String>? (readonly)

Note:

Default: - use the CMD specified in the docker image or Dockerfile.

Specify or override the CMD on the specified Docker image or Dockerfile.

This needs to be in the 'exec form', viz., [ 'executable', 'param1', 'param2' ].

Returns:

  • (Array<String>, nil)

See Also:



33
34
35
# File 'lambda/code_image_config.rb', line 33

def cmd
  @cmd
end

#entrypointArray<String>? (readonly)

Note:

Default: - use the ENTRYPOINT in the docker image or Dockerfile.

Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile.

An ENTRYPOINT allows you to configure a container that will run as an executable. This needs to be in the 'exec form', viz., [ 'executable', 'param1', 'param2' ].

Returns:

  • (Array<String>, nil)

See Also:



42
43
44
# File 'lambda/code_image_config.rb', line 42

def entrypoint
  @entrypoint
end

#image_uriString (readonly)

URI to the Docker image.

Returns:

  • (String)


25
26
27
# File 'lambda/code_image_config.rb', line 25

def image_uri
  @image_uri
end

#working_directoryString? (readonly)

Note:

Default: - use the WORKDIR in the docker image or Dockerfile.

Specify or override the WORKDIR on the specified Docker image or Dockerfile.

A WORKDIR allows you to configure the working directory the container will use.



50
51
52
# File 'lambda/code_image_config.rb', line 50

def working_directory
  @working_directory
end

Class Method Details

.jsii_propertiesObject



52
53
54
55
56
57
58
59
# File 'lambda/code_image_config.rb', line 52

def self.jsii_properties
  {
    :image_uri => "imageUri",
    :cmd => "cmd",
    :entrypoint => "entrypoint",
    :working_directory => "workingDirectory",
  }
end

Instance Method Details

#to_jsiiObject



61
62
63
64
65
66
67
68
69
70
# File 'lambda/code_image_config.rb', line 61

def to_jsii
  result = {}
  result.merge!({
    "imageUri" => @image_uri,
    "cmd" => @cmd,
    "entrypoint" => @entrypoint,
    "workingDirectory" => @working_directory,
  })
  result.compact
end