Class: Jets::Cfn::Builder::Api::Deployment
- Defined in:
- lib/jets/cfn/builder/api/deployment.rb
Instance Method Summary collapse
-
#add_base_path_mapping ⇒ Object
Because Jets generates a new timestamped logical id for the API Deployment resource it also creates a new root base path mapping and fails.
-
#compose ⇒ Object
interface method.
-
#template_path ⇒ Object
interface method.
-
#write ⇒ Object
do not write a template if routes are empty.
Methods inherited from Base
Methods included from AwsServices
#apigateway, #aws_lambda, #aws_options, #cfn, #dynamodb, #logs, #s3, #s3_resource, #sns, #sqs, #sts
Methods included from AwsServices::StackStatus
#lookup, #stack_exists?, #stack_in_progress?
Methods included from AwsServices::GlobalMemoist
Methods included from Interface
#add_description, #add_output, #add_outputs, #add_parameter, #add_parameters, #add_resource, #add_resources, #add_template_resource, #build, #build?, #template, #text
Methods included from Util::Camelize
Constructor Details
This class inherits a constructor from Jets::Cfn::Builder::Api::Base
Instance Method Details
#add_base_path_mapping ⇒ Object
Because Jets generates a new timestamped logical id for the API Deployment resource it also creates a new root base path mapping and fails. Additionally, the base path mapping depends on the API Deploy for the stage name.
We resolve this by using a custom resource that does an in-place update.
Note, also tried to change the domain name of to something like demo-dev-.mydomain.com but that does not work because the domain name has to match the route53 record exactly.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jets/cfn/builder/api/deployment.rb', line 20 def add_base_path_mapping return unless Jets.custom_domain? function = Jets::Cfn::Resource::ApiGateway::BasePath::Function.new add_resource(function) add_outputs(function.outputs) mapping = Jets::Cfn::Resource::ApiGateway::BasePath::Mapping.new add_resource(mapping) add_outputs(mapping.outputs) iam_role = Jets::Cfn::Resource::ApiGateway::BasePath::Role.new add_resource(iam_role) add_outputs(iam_role.outputs) end |
#compose ⇒ Object
interface method
4 5 6 7 8 9 |
# File 'lib/jets/cfn/builder/api/deployment.rb', line 4 def compose deployment = Jets::Cfn::Resource::ApiGateway::Deployment.new add_resource(deployment) add_parameters(deployment.parameters) add_outputs(deployment.outputs) end |
#template_path ⇒ Object
interface method
37 38 39 |
# File 'lib/jets/cfn/builder/api/deployment.rb', line 37 def template_path Jets::Names.api_deployment_template_path end |
#write ⇒ Object
do not write a template if routes are empty
42 43 44 |
# File 'lib/jets/cfn/builder/api/deployment.rb', line 42 def write super unless Jets::Router.no_routes? end |