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

[Feature request] support CloudFront Alternate Domain Name #154

Open
tvaughan73 opened this issue Sep 3, 2021 · 2 comments
Open

[Feature request] support CloudFront Alternate Domain Name #154

tvaughan73 opened this issue Sep 3, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@tvaughan73
Copy link

I have an issue where the alternate domain name set in cloudfront is not being set and is being removed when the stack is updated.
Steps to reproduce:

  1. Deploy solution from this link and set an alternate domain name. No other option changed from default except alternate domain name. Not sure it matters but I am setting domain like portal.dev.example.com.
  2. After deploy is complete the alternate domain name is not set on cloudfront distribution. The domain name is set manually along with the ssl cert and everything works OK at this point.
  3. When the stack is updated, the alternate domain name and ssl cert previously set is removed from the cloudfront distribution. It did this when I changed the setting for HttpHeaders.
@ottokruse
Copy link
Collaborator

QQ, just to make sure, you don't actually use example.com right? There's special behavior for that domain name (it gets removed from the list of callbacks).

Just checking :)

@ottokruse
Copy link
Collaborator

ottokruse commented Sep 6, 2021

Had another look to remind me how this works. The AlternateDomainNames parameter is not passed through to the CloudFront Distribution. It is only used when setting redirect URIs in the User Pool Client.

You need to add it yourself (manually) to the CloudFront distribution. Which also requires you to provide a TLS cert.
Unfortunately if you update the Auth@Edge deployment after that, then that CloudFront config may end being being reverted, as you noticed.

So currently, if you want to use an Alias for your CloudFront distribution, it is best to create the distribution yourself, as explained here.

I'll treat it as a feature request to make Alias work with the included CloudFront distribution. It would require this field to be passed through to the CloudFront Distribution, as well as require a pointer to the TLS cert to be passed via parameters. If you're interested, you could take on a PR for this?

@ottokruse ottokruse changed the title CloudFront Alternate Domain Name Feature request: support CloudFront Alternate Domain Name Nov 22, 2021
@ottokruse ottokruse changed the title Feature request: support CloudFront Alternate Domain Name [Feature request] support CloudFront Alternate Domain Name Nov 22, 2021
@ottokruse ottokruse added the enhancement New feature or request label Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants