Sha256: d4b8f0018868b2f5e94e074fbb5292c2c3b9115e8c4d4b0c72b4a2aa62e53980
Contents?: true
Size: 1.5 KB
Versions: 15
Compression:
Stored size: 1.5 KB
Contents
module Jets::Cfn::Builder::Api class Deployment < Base # interface method def compose deployment = Jets::Cfn::Resource::ApiGateway::Deployment.new add_resource(deployment) add_parameters(deployment.parameters) add_outputs(deployment.outputs) end # 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-[random].mydomain.com # but that does not work because the domain name has to match the route53 record exactly. # 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 # interface method def template_path Jets::Names.api_deployment_template_path end # do not write a template if routes are empty def write super unless Jets::Router.no_routes? end end end
Version data entries
15 entries across 15 versions & 1 rubygems