Class: AWSCDK::Lambda::S3Code
- Inherits:
-
Code
- Object
- Code
- AWSCDK::Lambda::S3Code
- Defined in:
- lambda/s3_code.rb
Overview
Lambda code from an S3 archive.
Class Method Summary collapse
Instance Method Summary collapse
-
#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.
-
#bind_to_resource(_resource, _options = nil) ⇒ void
Called after the CFN function resource has been created to allow the code class to bind to it.
-
#initialize(bucket, key, object_version = nil) ⇒ S3Code
constructor
A new instance of S3Code.
-
#is_inline ⇒ Boolean
Determines whether this Code is inline code or not.
Constructor Details
#initialize(bucket, key, object_version = nil) ⇒ S3Code
Returns a new instance of S3Code.
11 12 13 14 15 16 |
# File 'lambda/s3_code.rb', line 11 def initialize(bucket, key, object_version = nil) Jsii::Type.check_type(bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "bucket") Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key") Jsii::Type.check_type(object_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectVersion") unless object_version.nil? Jsii::Object.instance_method(:initialize).bind(self).call(bucket, key, object_version) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
18 19 20 21 22 23 24 |
# File 'lambda/s3_code.rb', line 18 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.
37 38 39 40 |
# File 'lambda/s3_code.rb', line 37 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.
50 51 52 53 54 55 |
# File 'lambda/s3_code.rb', line 50 def bind_to_resource(_resource, = nil) Jsii::Type.check_type(_resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "_resource") = .is_a?(Hash) ? ::AWSCDK::Lambda::ResourceBindOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLlJlc291cmNlQmluZE9wdGlvbnMifQ==")), "_options") unless .nil? jsii_call_method("bindToResource", [_resource, ]) end |
#is_inline ⇒ Boolean
Determines whether this Code is inline code or not.
29 30 31 |
# File 'lambda/s3_code.rb', line 29 def is_inline() jsii_get_property("isInline") end |