Class: AWSCDK::Lambda::ECRImageCode

Inherits:
Code
  • Object
show all
Defined in:
lambda/ecr_image_code.rb

Overview

Represents a Docker image in ECR that can be bound as Lambda Code.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository, props = nil) ⇒ ECRImageCode

Returns a new instance of ECRImageCode.

Parameters:



10
11
12
13
14
15
# File 'lambda/ecr_image_code.rb', line 10

def initialize(repository, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::Lambda::ECRImageCodeProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(repository, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyLklSZXBvc2l0b3J5In0=")), "repository")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkVjckltYWdlQ29kZVByb3BzIn0=")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(repository, props)
end

Class Method Details

.jsii_overridable_methodsObject



17
18
19
20
21
22
23
# File 'lambda/ecr_image_code.rb', line 17

def self.jsii_overridable_methods
  {
    :is_inline => { kind: :property, name: "isInline", is_optional: false },
    :bind => { kind: :method, name: "bind", is_optional: false },
    :bind_to_resource => { kind: :method, name: "bindToResource", is_optional: false },
  }
end

Instance Method Details

#bind(_scope) ⇒ AWSCDK::Lambda::CodeConfig

Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun.

Parameters:

  • _scope (Constructs::Construct)

Returns:



36
37
38
39
# File 'lambda/ecr_image_code.rb', line 36

def bind(_scope)
  Jsii::Type.check_type(_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "_scope")
  jsii_call_method("bind", [_scope])
end

#bind_to_resource(_resource, _options = nil) ⇒ void

This method returns an undefined value.

Called after the CFN function resource has been created to allow the code class to bind to it.

Specifically it's required to allow assets to add metadata for tooling like SAM CLI to be able to find their origins.

Parameters:



49
50
51
52
53
54
# File 'lambda/ecr_image_code.rb', line 49

def bind_to_resource(_resource, _options = nil)
  Jsii::Type.check_type(_resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "_resource")
  _options = _options.is_a?(Hash) ? ::AWSCDK::Lambda::ResourceBindOptions.new(**_options.transform_keys(&:to_sym)) : _options
  Jsii::Type.check_type(_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLlJlc291cmNlQmluZE9wdGlvbnMifQ==")), "_options") unless _options.nil?
  jsii_call_method("bindToResource", [_resource, _options])
end

#is_inlineBoolean

Determines whether this Code is inline code or not.

Returns:

  • (Boolean)


28
29
30
# File 'lambda/ecr_image_code.rb', line 28

def is_inline()
  jsii_get_property("isInline")
end