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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I use DomainName and DistributionDomainName values in serverless.yml? #377

Open
FergusMcGlynn opened this issue Aug 21, 2020 · 1 comment
Labels

Comments

@FergusMcGlynn
Copy link

FergusMcGlynn commented Aug 21, 2020

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Support Question

Question

serverless-domain-manager provides Cloudformation outputs DomainName and DistributionDomainName - is there any way to make use of these values within serverless.yml?

I am not using Route 53 for domain management, and I'm setting createRoute53Record to false, so I need to create my own DNS CNAME entry that points my domain name to the behind-the-scenes CloudFront distribution. This is fine - my organisation has a custom Cloudformation task for doing this. The only issue is that I need the value of CloudFront distribution domain name to use as an input to this custom task, and I can't work out how to get it. The Serverless application returns this value as a Cloudformation output called DistributionDomainName, so I'd have thought it should be possible to reference it in serverless.yml somehow. Is there a way?

I was hoping to be able to append some Cloudformation to serverless.yml like this:

resources:
  Resources:
    MyCNAME:
      Type: Custom::CNAME   # custom Cloudformation resource for creating ad-hoc CNAME entries
      Properties:
        Source: "my.domain.com."
        Target: ??? CloudFront URL here ???

but as I say I can't work out how, or if it's possible, to reference the CloudFront URL in this way. I suppose I could create a separate Cloudformation stack and reference the DistributionDomainName output from the Serverless application stack in this new stack, but I'd prefer to do everything in one stack if possible.

Command Run
sls deploy

Domain Manager Configuration

custom:
  customDomain:
    domainName: my.example.com
    basePath: ''
    stage: dev
    createRoute53Record: false
    autoDomain: true

Versions

  • Domain Manager version(s): 4.2.0
  • Node/npm version: Node 12, NPM 6.9.0
  • Serverless Version: 1.78.1
  • Lambda Code: Javascript
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

2 participants