Skip to content

AWS Lightsail container service certificates

0

Hi, I have a question about AWS Lightsail CONTAINER service certificates. I´m new to this stuff so please bear with me. I successfully created a container service. I now want to attach a custom domain. Lets say abc.com. I bought this domain at some registrar (not AWS). In AWS lightsail I generated a certificate for both abc.com and www.abc.com. I then configured the DNS records at my registrar account. This certificate is then successfully verified. When I try to attach this certificate, it fails with error "Duplicated domains provided for service". So it is not possible to attach a certificate for both abc.com and www.abc.com. I also can´t create two separate certificate, as in Lighsail you can attach only one certificate. When I try to create the certificate for only abc.com and attach it, this works, and the url is also trusted. But when I enter www.abc.com it naturaly fails (meaning its considered to be a dangerous website) because the certificate is missing. I also tried to configure my DNS records to redirect everything from www.abc.com to abc.com, but this also results in a untrusted web. My ultimate question is, how do I attach a certificate in AWS Lightsail for abc.com and www.abc.com or what other method I have to use so that both URLs are trusted. Thank you.

asked a year ago228 views

2 Answers
1

I understand your confusion regarding SSL/TLS certificates for AWS Lightsail container services. Let me clarify the process and provide a solution for your situation.

First, it's important to note that you can indeed create a single SSL/TLS certificate in Lightsail that covers both your apex domain (abc.com) and its www subdomain (www.abc.com). This is actually the recommended approach.

When creating the certificate, you should add both domains to it. In the certificate creation process, you can specify up to 10 domains or subdomains. So, you would enter abc.com as the primary domain, and then add www.abc.com as an additional domain.

After creating the certificate, you need to validate it. Lightsail will attempt to do this automatically, but if it fails, you'll need to add CNAME records to your domain's DNS at your registrar. The exact records to add can be found in the "Validation details" section of your certificate in the Lightsail console.

Once the certificate is validated and shows as "Valid" in Lightsail, you can then enable custom domains for your container service. Here's how:

  1. Go to your container service in the Lightsail console.
  2. Navigate to the "Custom domains" tab.
  3. Click on "Enable custom domains".
  4. Select the certificate you created that includes both abc.com and www.abc.com.
  5. Choose both domains from the certificate to use with your service.

By following these steps, you should be able to use both abc.com and www.abc.com with your container service, and both will be covered by the same SSL/TLS certificate.

If you're still encountering the "Duplicated domains provided for service" error, it's possible there's a conflict with existing settings. In this case, you may need to disable custom domains first (if they were previously enabled), then re-enable them following the steps above.

Remember, your certificates are valid for 13 months, after which Lightsail will attempt to automatically revalidate them. It's important to keep the CNAME records you added for validation in your domain's DNS, as they're needed for this revalidation process.

By implementing this solution, both abc.com and www.abc.com should be accessible via HTTPS and show as trusted in web browsers.
Sources
Create SSL/TLS certificates for secure Lightsail container service domains - Amazon Lightsail
View SSL/TLS certificates for Lightsail container services - Amazon Lightsail
Enable secure web access with custom domains in Lightsail - Amazon Lightsail
Validate SSL/TLS certificates for Lightsail container services - Amazon Lightsail

answered a year ago

EXPERT

reviewed a year ago

0

I´m sorry, I followed the steps, I have a valid certificate for both my domain with "www" and without. The issue is that its not possible to attach it to the container service. Whatever I do, I always end up with error "Duplicated domains provided for service". Is there any other possible workaround?

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.