Class: Jets::Cfn::TemplateBuilders::ApiGatewayDeploymentBuilder
- Inherits:
-
Object
- Object
- Jets::Cfn::TemplateBuilders::ApiGatewayDeploymentBuilder
- Includes:
- AwsServices, Interface
- Defined in:
- lib/jets/cfn/template_builders/api_gateway_deployment_builder.rb
Instance Method Summary collapse
-
#compose ⇒ Object
compose is an interface method.
-
#initialize(options = {}) ⇒ ApiGatewayDeploymentBuilder
constructor
A new instance of ApiGatewayDeploymentBuilder.
-
#template_path ⇒ Object
template_path is an interface method.
-
#write ⇒ Object
do not bother writing a template if routes are empty.
Methods included from AwsServices
#cfn, #lambda, #s3, #s3_resource, #stack_exists?, #stack_in_progress?, #sts
Methods included from Interface
#add_output, #add_parameter, #add_resource, #build, #post_process_template, #template, #text
Constructor Details
#initialize(options = {}) ⇒ ApiGatewayDeploymentBuilder
Returns a new instance of ApiGatewayDeploymentBuilder.
6 7 8 9 |
# File 'lib/jets/cfn/template_builders/api_gateway_deployment_builder.rb', line 6 def initialize(={}) @options = @template = ActiveSupport::HashWithIndifferentAccess.new(Resources: {}) end |
Instance Method Details
#compose ⇒ Object
compose is an interface method
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jets/cfn/template_builders/api_gateway_deployment_builder.rb', line 12 def compose return if @options[:stack_type] == :minimal puts "Building API Gateway Deployment template." add_parameter("RestApi", Description: "RestApi") map = Jets::Cfn::TemplateMappers::ApiGatewayDeploymentMapper.new(path=nil,s3_bucket=nil) add_resource(map.logical_id, "AWS::ApiGateway::Deployment", Description: "Version #{map.} deployed by jets", RestApiId: "!Ref RestApi", StageName: map.stage_name, ) add_output("RestApiUrl", Value: "!Sub 'https://${RestApi}.execute-api.${AWS::Region}.amazonaws.com/#{map.stage_name}/'") end |
#template_path ⇒ Object
template_path is an interface method
29 30 31 |
# File 'lib/jets/cfn/template_builders/api_gateway_deployment_builder.rb', line 29 def template_path Jets::Naming.api_gateway_deployment_template_path end |