Class: AWSCDK::Lambda::CodeConfig
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Lambda::CodeConfig
- Defined in:
- lambda/code_config.rb
Overview
Result of binding Code into a Function.
Instance Attribute Summary collapse
-
#image ⇒ AWSCDK::Lambda::CodeImageConfig?
readonly
Docker image configuration (mutually exclusive with
s3LocationandinlineCode). -
#inline_code ⇒ String?
readonly
Inline code (mutually exclusive with
s3Locationandimage). -
#s3_location ⇒ AWSCDK::S3::Location?
readonly
The location of the code in S3 (mutually exclusive with
inlineCodeandimage). -
#source_kms_key_arn ⇒ String?
readonly
The ARN of the KMS key used to encrypt the handler code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(image: nil, inline_code: nil, s3_location: nil, source_kms_key_arn: nil) ⇒ CodeConfig
constructor
A new instance of CodeConfig.
- #to_jsii ⇒ Object
Constructor Details
#initialize(image: nil, inline_code: nil, s3_location: nil, source_kms_key_arn: nil) ⇒ CodeConfig
Returns a new instance of CodeConfig.
11 12 13 14 15 16 17 18 19 20 |
# File 'lambda/code_config.rb', line 11 def initialize(image: nil, inline_code: nil, s3_location: nil, source_kms_key_arn: nil) @image = image.is_a?(Hash) ? ::AWSCDK::Lambda::CodeImageConfig.new(**image.transform_keys(&:to_sym)) : image Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkNvZGVJbWFnZUNvbmZpZyJ9")), "image") unless @image.nil? @inline_code = inline_code Jsii::Type.check_type(@inline_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "inlineCode") unless @inline_code.nil? @s3_location = s3_location.is_a?(Hash) ? ::AWSCDK::S3::Location.new(**s3_location.transform_keys(&:to_sym)) : s3_location Jsii::Type.check_type(@s3_location, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuTG9jYXRpb24ifQ==")), "s3Location") unless @s3_location.nil? @source_kms_key_arn = source_kms_key_arn Jsii::Type.check_type(@source_kms_key_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceKMSKeyArn") unless @source_kms_key_arn.nil? end |
Instance Attribute Details
#image ⇒ AWSCDK::Lambda::CodeImageConfig? (readonly)
Default: - code is not an ECR container image
Docker image configuration (mutually exclusive with s3Location and inlineCode).
26 27 28 |
# File 'lambda/code_config.rb', line 26 def image @image end |
#inline_code ⇒ String? (readonly)
Default: - code is not inline code
Inline code (mutually exclusive with s3Location and image).
31 32 33 |
# File 'lambda/code_config.rb', line 31 def inline_code @inline_code end |
#s3_location ⇒ AWSCDK::S3::Location? (readonly)
Default: - code is not an s3 location
The location of the code in S3 (mutually exclusive with inlineCode and image).
36 37 38 |
# File 'lambda/code_config.rb', line 36 def s3_location @s3_location end |
#source_kms_key_arn ⇒ String? (readonly)
Default: - the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.
The ARN of the KMS key used to encrypt the handler code.
41 42 43 |
# File 'lambda/code_config.rb', line 41 def source_kms_key_arn @source_kms_key_arn end |
Class Method Details
.jsii_properties ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lambda/code_config.rb', line 43 def self.jsii_properties { :image => "image", :inline_code => "inlineCode", :s3_location => "s3Location", :source_kms_key_arn => "sourceKMSKeyArn", } end |
Instance Method Details
#to_jsii ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lambda/code_config.rb', line 52 def to_jsii result = {} result.merge!({ "image" => @image, "inlineCode" => @inline_code, "s3Location" => @s3_location, "sourceKMSKeyArn" => @source_kms_key_arn, }) result.compact end |