Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serverless-domain-manager #110

Closed
ColeTMNZ opened this issue Mar 15, 2018 · 3 comments
Closed

serverless-domain-manager #110

ColeTMNZ opened this issue Mar 15, 2018 · 3 comments
Labels
Milestone

Comments

@ColeTMNZ
Copy link

Is domain manager supported?

Have tried getting alias plugin running in existing stack, but not getting far.

The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayDeployment1521079052823] in the Resources block of the template

#66 looks similar, where the suggestion is to locate unsupported resources. Im wondering if its the basepath mapping resource that's causing issues.

@HyperBrain
Copy link
Member

As far as I know domain manager is not yet supported. It's quite likely the base path mapping resource, because that's dependent on the Deployment resource.

But the deployment resource is moved to the alias stack - and the mapping resource is not. So the dependency is not valid anymore and will error.

An implementation for the feature might move the base mapping resource to the alias stack besides the Deployment resource, and the dependency is ok again.

The basepath mapping resource:

{
  "Type" : "AWS::ApiGateway::BasePathMapping",
  "Properties" : {
    "BasePath" : String,
    "DomainName" : String,
    "RestApiId" : String,
    "Stage" : String
  }
}

So the plugin would move it and set the Stage property to the current alias stage ref (Ref: aliasStage).

However, it has to be checked, if the outcome of that solution is, what we'd expect to happen for deployments into multiple parallel aliases - by testing an implementation of the feature.
Imo it would work that way, and even allow mutliple aliases be integrated into one base mapping domain seamlessly.

@aleksdikanski
Copy link

aleksdikanski commented Mar 21, 2018

Hi,
I created a PR for this feature according to your description @HyperBrain, as I also am in need for this. I currently have to way to test this on an example project, as my private AWS account is limited regarding setting up certificates for domain names. I tested my implementation on a company project and it worked well. Except for some limitation on the domain manager plugin, which apparently only supports certificates from us-east-1 region.

@ColeTMNZ would you be able to test my implementation on an example project. Use my branch for testing https://github.com/aleksdikanski/serverless-aws-alias.git#domain-name-plugin-support

@alexb-uk
Copy link

alexb-uk commented Mar 21, 2018

I believe the restriction to certs in us-east-1 is for Edge optimised Endpoint Configuration, Regional can use any cert in the matching region. This is a restriction / limitation of AWS API Gateway and not of serverless-domain-manager.

I have a setup with a Regional on eu-west-2 Endpoint and happy to give this a test when I get a few minutes spare.

In my tests of serverless-domain-manager I've always had the Endpoint created ahead and just used Serverless to configure the Base Path Mapping but can probably do a full end-to-end test without effecting users too much.

For reference this is the serverless-domain-manager config I used before switching to serverless-aws-alias:

  stage: ${opt:stage, self:provider.stage}

  domains:
    prod: api.xyz.uk
    dev: api-dev.xyz.uk

  customDomain:
    certificateName: '*.xyz.uk'
    domainName: ${self:custom.domains.${self:custom.stage}}
    basePath: 'Todo-API'
    stage: ${self:provider.stage}
    createRoute53Record: false

@HyperBrain HyperBrain added this to the 1.7.0 milestone Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants