Reputation: 170
What is the best approach to enable https on ec2 public dns? I just have single instance running so i don't think adding load balancer is good approach and I don't have any domain name to point to my instance. I want to enable https on instance public DNS.
Upvotes: 5
Views: 7253
Reputation: 61
You can zeroSSL to give your ec2 public dns HTTPS. There are some steps you need to complete to verify you 'own' the domain (even though you dont). i.e http upload
Upvotes: 0
Reputation: 275
If you already have a domain, you can create a subdomain from that so don't need to buy new domain. Once you create sub-domain you can generate ssl and enable https and point it to your ec2 public DNS.
Upvotes: 0
Reputation: 238497
What is the best approach to enable https on ec2 public dns?
You can't do this, as the public DNS provided by AWS does not belong to you. The DNS belongs to AWS and only AWS can have a valid SSL certificate for it.
To have a valid public SSL certificate for HTTPS you need your own domain that you control. Then you have to use a third party service (ACM can't be used on EC2 instances, unless in enclave) to get a SSL cert for your domain. A popular choice is https://letsencrypt.org/ with certbot
which provides free SSL certificates. By the way, StackOverlow is using letsencrypt as its SSL cert provider. Having the SSL cert you can setup nginx to server your application using HTTPs, or itegrate SSL certificates directly with your application.
If you don't want to do the above, you have to front your instance with load balancer, CloudFront or API Gateway. Having load balancer allows you to use ACM and easily get and provision SSL certificates You still need your own domain of course. Using load balancer is the easiest to setup. With CloudFront and API Gateway there are more things to consider.
Upvotes: 14