Deletion of CloudFront Distribution I can't see that has a Custom Domain

1

I have a cloudfront distribution that is listed in the associated resources of one of my certificates. However, this distribution does not show up in the cloudfront distribution console, nor when I try to get it's config using AWS CLI: Enter image description here This distribution is causing issues in that when I update my website, it redirects traffic to previous versions of the website. I'd like to have this distribution deleted, but as I can't see it in the console, nor access it via the CLI, I have no way to do this. Is there another way to delete this distribution?

1 Answer
1

Not sure if it applies here but note that when you use an API Gateway edge-optimised API it creates a CloudFront distribution managed by API GW that's in an AWS-managed account, not in your account even though it's using your ACM certificate.

CLI command "aws apigateway get-domain-names" can be used to see the distribution domain names; it would be worth a look in case this is the issue.

EXPERT
answered a year ago
  • Bingo. A key giveaway here is if the account ID in the "associated resource" arn happens to be 250044486744; see https://aws.amazon.com/premiumsupport/knowledge-center/acm-certificate-resources/ for details.

  • @QuinnyPig Thanks for your response and suggestions.

    So, I had used the details in https://aws.amazon.com/premiumsupport/knowledge-center/acm-certificate-resources/ for a similar problem and whilst it worked before it didn't work here. :-(

    I tried the deletion of the domain name by "aws apigateway delete-domain-name --domain-name 'mydomainnamehere'" as suggested in the article, but I receive the message "An error occurred (NotFoundException) when calling the DeleteDomainName operation: Invalid domain name identifier specified" I got the same result when I removed the speech marks (I just tried the steps again, just to be sure, but same result).

    I'm not sure why you've mentioned the account id of 250044486744. The cloud front (i.e. the associated resource) has an arn of my own account id. Interestingly enough, when I googled 'arn account id 250044486744' the first result was the knowledge centre page you suggested, but I can't find '250044486744' on that page! The next few results were links to deletion of certificate problems, with just about all coloured purple as I've visited them already. I'm going to have a look at those which I haven't yet visited just in case there's something there. Is there a particular thing about account 250044486744?

  • @skinsman Thanks for your response. I tried out the get domain names command and didn't see the domain name that I am trying to delete - I did see two others that I am using quite happily. I also tried using the region flag of us-east-1 to check if they were hiding elsewhere, that returned zero results. However, one thing that I have done that might be causing an issue is that I created the certificate in certificate manager via cft templates as well as creating another CloudFront distribution to associate with this certificate (of course, this association doesn't work as the domain name is already associated with a CloudFront Distribution). I'm going to delete this distribution and certificate and see if that clears things up at all.

    UPDATE - deleted the distribution and the certificate but didn't see any change in the either the console displaying the missing distribution, nor in the CLI being able to delete the domain. I've had to recreate a distribution for my website to run...

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.

Guidelines for Answering Questions