Request a certificate in ACM for Elastic Beanstalk backend

喜你入骨 提交于 2020-12-07 05:00:12

问题


I've just started using AWS a week ago. I deployed my NodeJS backend in a Docker container via Elastic Beanstalk. And a front-end Angular5 app in an S3 via CloudFront.

I bought a domain name on GoDaddy and configured it to point to my CloudFront Angular5 app. I also generated an SSL certificate for that domain (used for the front-end). However, all requests from the frontend app are getting blocked due to the backend insecurity.

So, as I understand, the next step would be to configure HTTPS for the ElasticBeanstalk NodeJS backend.

I found a variety of articles on that topic. But all of them assume I already have a certificate issued.

The problem is that when I tried to request a certificate via ACM for the URL that Elastic Beanstalk gives me (my-website.eu-west-2.elasticbeanstalk.com), the request got rejected with the following Error:

Request failed The status of this certificate request is "Failed". Additional verification required to request certificates for one or more domain names in this request.

What can I do in that case? And is it even possible to use aws-provided URLs (like the one provided by elastic beanstalk) to request SSL certificates?

Apologies if my terminology is not very correct. I'm quite new to all this stuff.


回答1:


You cannot register SSL certificates for Amazon domains (amazonaws.com, elasticbeanstalk.com, etc.)

If you want to use HTTPS for your Elastic Beanstalk application (internal or external), you must use your own domain.

  1. Register a domain with a DNS registrar.
  2. Request an SSL certificate via ACM for that domain.
  3. Assign that ACM certificate to your Elastic Beanstalk application.
  4. Point your domain to the Elastic Beanstalk application, CNAME for external DNS, CNAME or ALIAS for Route 53.
  5. Access the EB application via your domain name, and NOT the elasticbeanstalk-assigned address.



回答2:


Yeah, as Matt Houser mentioned, it’s not possible. I was just wondering whether I should get another domain name.

What I did eventually is quite simple. I used route53 to create another Alias record with url api.my-website.com that points to my Elastic Beanstalk backend.

Then with ACM I issued two separate SSL certificates both for api.my-website.com and for (www.)my-website.com to enable HTTPS both on frontend and backend and attached them to ElasticBeanstalk and CloudFront accordingly. It appeared to be very simple with the services AWS provides.

Here’s the result: https://my-next-movie.com

I’ll just leave it here in case someone is as new as me to all that.



来源:https://stackoverflow.com/questions/49118138/request-a-certificate-in-acm-for-elastic-beanstalk-backend

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!