1👍
You will probably need some domain name, as you will probably have a hard time finding any official CA which will sign an IP address certificate for you. All public EC2 instances usually get a public DNS name, like ec2-12-34-56-78.us-east-1.compute.amazonaws.com
. If you can find a CA which will sign a certificate for this address for you, you could use that. However, you’d need to ensure this address won’t change over the lifetime of your server, for which you’d need to get an Elastic IP address at least. You also probably won’t be able to use free AWS ACM certificates, as you can’t use any of the validation mechanisms it offers, since you don’t control the domain.
The easiest option for you is probably to set up a CloudFront CDN in front of your server. That’ll give you a domain name like d111111abcdef8.cloudfront.net
, which already comes with its built-in certificate. The backend communication between CloudFront and your EC2 instance can be an unsecured HTTP connection. This’ll incur a slight overhead cost, but for low or even medium traffic sites, this is really insignificant. If you set it up well, it can also significantly increase the loading speed of at least static assets of your site, as CDNs do.