Class: AWSCDK::CloudFront::FunctionProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFront::FunctionProps
- Defined in:
- cloud_front/function_props.rb
Overview
Properties for creating a CloudFront Function.
Instance Attribute Summary collapse
-
#auto_publish ⇒ Boolean?
readonly
A flag that determines whether to automatically publish the function to the LIVE stage when it’s created.
-
#code ⇒ AWSCDK::CloudFront::FunctionCode
readonly
The source code of the function.
-
#comment ⇒ String?
readonly
A comment to describe the function.
-
#function_name ⇒ String?
readonly
A name to identify the function.
-
#key_value_store ⇒ AWSCDK::Interfaces::AWSCloudfront::IKeyValueStoreRef?
readonly
The Key Value Store to associate with this function.
-
#runtime ⇒ AWSCDK::CloudFront::FunctionRuntime?
readonly
The runtime environment for the function.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code:, auto_publish: nil, comment: nil, function_name: nil, key_value_store: nil, runtime: nil) ⇒ FunctionProps
constructor
A new instance of FunctionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(code:, auto_publish: nil, comment: nil, function_name: nil, key_value_store: nil, runtime: nil) ⇒ FunctionProps
Returns a new instance of FunctionProps.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'cloud_front/function_props.rb', line 13 def initialize(code:, auto_publish: nil, comment: nil, function_name: nil, key_value_store: nil, runtime: nil) @code = code Jsii::Type.check_type(@code, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5GdW5jdGlvbkNvZGUifQ==")), "code") @auto_publish = auto_publish Jsii::Type.check_type(@auto_publish, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "autoPublish") unless @auto_publish.nil? @comment = comment Jsii::Type.check_type(@comment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comment") unless @comment.nil? @function_name = function_name Jsii::Type.check_type(@function_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "functionName") unless @function_name.nil? @key_value_store = key_value_store Jsii::Type.check_type(@key_value_store, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jbG91ZGZyb250LklLZXlWYWx1ZVN0b3JlUmVmIn0=")), "keyValueStore") unless @key_value_store.nil? @runtime = runtime Jsii::Type.check_type(@runtime, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5GdW5jdGlvblJ1bnRpbWUifQ==")), "runtime") unless @runtime.nil? end |
Instance Attribute Details
#auto_publish ⇒ Boolean? (readonly)
Default: - true
A flag that determines whether to automatically publish the function to the LIVE stage when it’s created.
36 37 38 |
# File 'cloud_front/function_props.rb', line 36 def auto_publish @auto_publish end |
#code ⇒ AWSCDK::CloudFront::FunctionCode (readonly)
The source code of the function.
31 32 33 |
# File 'cloud_front/function_props.rb', line 31 def code @code end |
#comment ⇒ String? (readonly)
Default: - same as functionName
A comment to describe the function.
41 42 43 |
# File 'cloud_front/function_props.rb', line 41 def comment @comment end |
#function_name ⇒ String? (readonly)
Default: - generated from the id
A name to identify the function.
46 47 48 |
# File 'cloud_front/function_props.rb', line 46 def function_name @function_name end |
#key_value_store ⇒ AWSCDK::Interfaces::AWSCloudfront::IKeyValueStoreRef? (readonly)
Default: - no key value store is associated
The Key Value Store to associate with this function.
In order to associate a Key Value Store, the runtime must be
cloudfront-js-2.0 or newer.
54 55 56 |
# File 'cloud_front/function_props.rb', line 54 def key_value_store @key_value_store end |
#runtime ⇒ AWSCDK::CloudFront::FunctionRuntime? (readonly)
Default: FunctionRuntime.JS_1_0 (unless keyValueStore is specified, then FunctionRuntime.JS_2_0)
The runtime environment for the function.
59 60 61 |
# File 'cloud_front/function_props.rb', line 59 def runtime @runtime end |
Class Method Details
.jsii_properties ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'cloud_front/function_props.rb', line 61 def self.jsii_properties { :code => "code", :auto_publish => "autoPublish", :comment => "comment", :function_name => "functionName", :key_value_store => "keyValueStore", :runtime => "runtime", } end |
Instance Method Details
#to_jsii ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'cloud_front/function_props.rb', line 72 def to_jsii result = {} result.merge!({ "code" => @code, "autoPublish" => @auto_publish, "comment" => @comment, "functionName" => @function_name, "keyValueStore" => @key_value_store, "runtime" => @runtime, }) result.compact end |