amplify-hosting
amplify-hosting copied to clipboard
Wildcard subdomains in AWS Amplify
So we recently decided to remove server side rendering from our react app to use Amplify, since it provides us all that we need (serverless, high availabilty, speed and no need to test in two environments).
However now I have a question regarding how to configure AWS Amplify to have a wildcard CNAME record. I want that any subdomain can reach my app, not just the ones I manually select in the Amplify Console.
I have a wildcard CNAME in Route 53 pointing to the cloudfront, and the subdomains I added manually in the console are working, but the ones that are not (due to the nature of the wildcard CNAME), just get a 403 from cloudfront.
Is there support for wildcard subdomains in Amplify?
How does one configure it? Assuming there is no support for this.
Is there an API I can use to create the Amplify subdomains for me rather than doing it manually everytime a client purchases access?
@cjimenezber you should be able to create domain associations via the AWS CLI: https://docs.aws.amazon.com/cli/latest/reference/amplify/create-domain-association.html
We have a feature request for domain patterns in our backlog. Thanks hope this helps.
I have another question, to finalize this. We will be either adding them manually or using a cron job that invokes a CLI method with the new customers. When doing manual changes to the subdomains I noticed that all subdomains slow down greatly while the domain gets reverified and everything gets added to cloudfront.
Will this happen for all domains/sub-domains every time I update the list of subdomains?
First of all, we have a limit on total number of subdomains you can add to each customer domain (50). Secondly, any update to the subdomains(including add and remove) it will require us to update the cloudfront behind, which takes about 10-15mins.
Alright, will there be any notification of when the wildcard subdomain feature is finished?
Any update on wildcard subdomains?
Any updates? I am in need of this feature.
+1 to this feature request, or the next best solution for wildcard subdomains
The feature is most definitely required
+1
+1
+1
+1
+1
+1
+1 Please update on this, We are getting delay in our production launch. Please answer yes/No
I have created this js function as workaround. It's not a wildcard, but at least I can create on demand subdomains, programmatically:
https://gist.github.com/dtelaroli/ffbebd858f5089bfb7532ff3d96fb7ea
@anuj-bluebash, We currently don't support wildcards as a subdomain prefix. We have a feature request in our backlog to address this, and will let you know once it's rolled out. Thanks for your patience.
Would anyone be aware whether this would be possible to achieve through the Cloudfront and S3 hosting option? I see that the docs support it, but not aware of the limitations or if there are any issues with using this solution.
https://aws.amazon.com/about-aws/whats-new/2013/09/18/amazon-cloudfront-announces-wildcard-cname-support/#:~:text=We're%20excited%20to%20let,distribution%20to%20include%20each%20subdomain.
@swaminator @abhi7cr is there any workaround for wildcards to work? I don't see CloudFront for application deployed using Amplify in my AWS Console, so I assume it's internal. Maybe there is way for me to create own CloudFront and setup DNS manually? It would be wonderful if I could keep CI pipeline and setup CloudFront on my own.
Would anyone be aware whether this would be possible to achieve through the Cloudfront and S3 hosting option? I see that the docs support it, but not aware of the limitations or if there are any issues with using this solution.
https://aws.amazon.com/about-aws/whats-new/2013/09/18/amazon-cloudfront-announces-wildcard-cname-support/#:~:text=We're%20excited%20to%20let,distribution%20to%20include%20each%20subdomain.
I ended up going for this option, we have a production app using S3 + Cloudfront with Wildcard CNAME record.
+1
First of all, we have a limit on total number of subdomains you can add to each customer domain (50). Secondly, any update to the subdomains(including add and remove) it will require us to update the cloudfront behind, which takes about 10-15mins.
Can the limit be increased? We are using it so that each account have their own subdomain.
I have tried and after two weeks I received no as answer
This issue was closed so we missed this. Reopened it to let you know that we launched a feature for automatic subdomains that match a pattern. Please let us know if this will work for you: https://aws.amazon.com/blogs/mobile/automatically-create-and-delete-custom-sub-domains-for-your-branch-deployments-with-amplify-console/
This issue was closed so we missed this. Reopened it to let you know that we launched a feature for automatic subdomains that match a pattern. Please let us know if this will work for you: https://aws.amazon.com/blogs/mobile/automatically-create-and-delete-custom-sub-domains-for-your-branch-deployments-with-amplify-console/
Can the subdomain limit be increased? We are using it so that each account have their own subdomain.
The short answer is NO
The short answer is NO
What’s gonna be the workaround for that? Are wildcards possible?
No, you can use wildcards configuring it directly at route53, cloudfront and acm, but amplify does not support yet. We are waiting for aws team to solve this issue. I also need this feature, but following the time that AWS takes to solve some issues (near to 3 years), I will move my project from amplify to an own configuration at cloudfront ou cloudflare when I would have 50 customers.
The short answer is NO
@dtelaroli that isn't really going to help us prioritize the issue. Can I understand a bit more in detail why the subdomain autodetection will not work for you? Again, apologies that this issue slipped under the rug as it was closed. But given I reopened it, I'd like to understand the usecase a bit more.
@niknokseyer not currently but we will enable limit increases soon.