Class: AWSCDK::Lambda::ECRImageCodeProps

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

Overview

Properties to initialize a new EcrImageCode.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd: nil, entrypoint: nil, tag: nil, tag_or_digest: nil, working_directory: nil) ⇒ ECRImageCodeProps

Returns a new instance of ECRImageCodeProps.

Parameters:

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

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

    The image tag to use when pulling the image from ECR.

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

    The image tag or digest to use when pulling the image from ECR (digests must start with sha256:).

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

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



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lambda/ecr_image_code_props.rb', line 12

def initialize(cmd: nil, entrypoint: nil, tag: nil, tag_or_digest: nil, working_directory: nil)
  @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?
  @tag = tag
  Jsii::Type.check_type(@tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tag") unless @tag.nil?
  @tag_or_digest = tag_or_digest
  Jsii::Type.check_type(@tag_or_digest, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tagOrDigest") unless @tag_or_digest.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:



32
33
34
# File 'lambda/ecr_image_code_props.rb', line 32

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:



41
42
43
# File 'lambda/ecr_image_code_props.rb', line 41

def entrypoint
  @entrypoint
end

#tagString? (readonly)

Deprecated.

use tagOrDigest

Note:

Default: 'latest'

The image tag to use when pulling the image from ECR.

Returns:

  • (String, nil)


47
48
49
# File 'lambda/ecr_image_code_props.rb', line 47

def tag
  @tag
end

#tag_or_digestString? (readonly)

Note:

Default: 'latest'

The image tag or digest to use when pulling the image from ECR (digests must start with sha256:).

Returns:

  • (String, nil)


52
53
54
# File 'lambda/ecr_image_code_props.rb', line 52

def tag_or_digest
  @tag_or_digest
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.



60
61
62
# File 'lambda/ecr_image_code_props.rb', line 60

def working_directory
  @working_directory
end

Class Method Details

.jsii_propertiesObject



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

def self.jsii_properties
  {
    :cmd => "cmd",
    :entrypoint => "entrypoint",
    :tag => "tag",
    :tag_or_digest => "tagOrDigest",
    :working_directory => "workingDirectory",
  }
end

Instance Method Details

#to_jsiiObject



72
73
74
75
76
77
78
79
80
81
82
# File 'lambda/ecr_image_code_props.rb', line 72

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