Class: Bauble::Resources::ApiGatewayV2
- Defined in:
- lib/bauble/resources/api_gateway_v2.rb
Overview
AWS API Gateway v2
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#name ⇒ Object
Returns the value of attribute name.
-
#routes ⇒ Object
Returns the value of attribute routes.
Instance Method Summary collapse
- #add_route(route_key:, function:) ⇒ Object
- #bundle ⇒ Object
-
#initialize(app, name:) ⇒ ApiGatewayV2
constructor
A new instance of ApiGatewayV2.
- #synthesize ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(app, name:) ⇒ ApiGatewayV2
Returns a new instance of ApiGatewayV2.
12 13 14 15 16 17 |
# File 'lib/bauble/resources/api_gateway_v2.rb', line 12 def initialize(app, name:) super(app) @app = app @name = name @routes = [] end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
10 11 12 |
# File 'lib/bauble/resources/api_gateway_v2.rb', line 10 def app @app end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/bauble/resources/api_gateway_v2.rb', line 10 def name @name end |
#routes ⇒ Object
Returns the value of attribute routes.
10 11 12 |
# File 'lib/bauble/resources/api_gateway_v2.rb', line 10 def routes @routes end |
Instance Method Details
#add_route(route_key:, function:) ⇒ Object
27 28 29 |
# File 'lib/bauble/resources/api_gateway_v2.rb', line 27 def add_route(route_key:, function:) routes << { route_key: route_key, target_lambda_arn: "${#{function.name}.arn}", function_name: function.name } end |
#bundle ⇒ Object
31 32 33 |
# File 'lib/bauble/resources/api_gateway_v2.rb', line 31 def bundle true end |
#synthesize ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/bauble/resources/api_gateway_v2.rb', line 19 def synthesize base_hash = api_hash base_hash.merge!(routes_hash) base_hash.merge!(deploymeny_hash) base_hash.merge!() base_hash end |