I had created a Lightsail instance "instance1" followed by creating a static IP address and a distribution + SSL certificate for this distribution. Then I used a domain name to point to the CNAME entries provided by this SSL certificate. This worked great and I was able to access this instance via the custom domain name.
I forgot the password of the app that was running on instance1, so I ended up deleting the instance and the distribution. I kept the static IP though.
I created another Lightsail instance "instance2" and followed the process above. I am able to access the app of this instance via the given cloudfront address with HTTPS protocol.
The problem I have is that whenever I try to enable the custom domain for this distribution I get the following error:
"AttachCertificateToDistribution[us-east-1]
Alternate Domain Names [x,y] have one or more parameter that is already associated with a different resource.
InvalidInputException"
so, I can access the instance with (for example) https://d827Of.cloudfront.net. When I try to access the https://customdomainname, it still points to the content from the previous instance1, which has since been deleted.
So, what do I need to do to enable custom domain with this Lightsail distribution?
Thank you,
A Perplexed user