Class: Bauble::Resources::RubyFunction
- Defined in:
- lib/bauble/resources/ruby_function.rb
Overview
a ruby lambda function
Instance Attribute Summary collapse
-
#env_vars ⇒ Object
Returns the value of attribute env_vars.
-
#function_url ⇒ Object
Returns the value of attribute function_url.
-
#handler ⇒ Object
Returns the value of attribute handler.
-
#image_uri ⇒ Object
Returns the value of attribute image_uri.
-
#layers ⇒ Object
Returns the value of attribute layers.
-
#memory_size ⇒ Object
Returns the value of attribute memory_size.
-
#name ⇒ Object
Returns the value of attribute name.
-
#reserved_concurrent_executions ⇒ Object
Returns the value of attribute reserved_concurrent_executions.
-
#role ⇒ Object
Returns the value of attribute role.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#vpc_config ⇒ Object
Returns the value of attribute vpc_config.
Attributes inherited from Resource
Instance Method Summary collapse
- #bundle ⇒ Object
-
#initialize(app, **kwargs) ⇒ RubyFunction
constructor
A new instance of RubyFunction.
- #synthesize ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(app, **kwargs) ⇒ RubyFunction
Returns a new instance of RubyFunction.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bauble/resources/ruby_function.rb', line 13 def initialize(app, **kwargs) super(app) @name = kwargs[:name] @handler = kwargs[:handler] @role = kwargs[:role] @layers = kwargs.fetch(:layers, []) @image_uri = kwargs.fetch(:image_uri, nil) @function_url = kwargs.fetch(:function_url, false) @env_vars = kwargs.fetch(:env_vars, {}) @timeout = kwargs.fetch(:timeout, 30) # default to 30 seconds @memory_size = kwargs.fetch(:memory_size, 128) # default to 128 MB @reserved_concurrent_executions = kwargs.fetch(:reserved_concurrent_executions, nil) # no limit by default @vpc_config = kwargs.fetch(:vpc_config, nil) # VPC config is optional end |
Instance Attribute Details
#env_vars ⇒ Object
Returns the value of attribute env_vars.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def env_vars @env_vars end |
#function_url ⇒ Object
Returns the value of attribute function_url.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def function_url @function_url end |
#handler ⇒ Object
Returns the value of attribute handler.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def handler @handler end |
#image_uri ⇒ Object
Returns the value of attribute image_uri.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def image_uri @image_uri end |
#layers ⇒ Object
Returns the value of attribute layers.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def layers @layers end |
#memory_size ⇒ Object
Returns the value of attribute memory_size.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def memory_size @memory_size end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def name @name end |
#reserved_concurrent_executions ⇒ Object
Returns the value of attribute reserved_concurrent_executions.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def reserved_concurrent_executions @reserved_concurrent_executions end |
#role ⇒ Object
Returns the value of attribute role.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def role @role end |
#timeout ⇒ Object
Returns the value of attribute timeout.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def timeout @timeout end |
#vpc_config ⇒ Object
Returns the value of attribute vpc_config.
10 11 12 |
# File 'lib/bauble/resources/ruby_function.rb', line 10 def vpc_config @vpc_config end |
Instance Method Details
#bundle ⇒ Object
28 29 30 |
# File 'lib/bauble/resources/ruby_function.rb', line 28 def bundle true end |
#synthesize ⇒ Object
32 33 34 35 36 37 |
# File 'lib/bauble/resources/ruby_function.rb', line 32 def synthesize template = function_hash template[@name]['properties'].merge!(code_hash) template.merge!(function_url_template_addon) if @function_url template end |