Eydwales
Eydwales

Reputation: 321

AWS "Certificate is in use" - How to disassociate certificate from ELB

I want to migrate a certificate *.mywebsite.com from region A to region B (my domain is hosted on Route 53).

To do so I deleted all resources bound to the certificate in region A (only API Gateway custom domain name). Then I tried to delete the certificate but a warning Certificate is in use tells me that the certificate is still associated with load balancers.

However, in EC2 > Load balancer, I have no load balancers left on the UI (nor security group, nor running instances). I have tried to remove the load balancer from the error message by using :

aws --region ap-southeast-1 elbv2 delete-load-balancer --load-balancer-arn arn:aws:elasticloadbalancing:ap-southeast-1:<account-id>:loadbalancer/<path-to-elb>/b22d537086da1807

That returns the error "must be in ARN format"

Any ideas on how I can remove these load balancers? Or how I can remove the certificate?

enter image description here

Upvotes: 7

Views: 6382

Answers (1)

Diego
Diego

Reputation: 558

When you deploy a regional API endpoint, API Gateway creates an application load balancer (ALB) on your behalf. The load balancer is owned by API Gateway and is not visible to you. The ALB is bound to the ACM Certificate that you used when deploying your API. To remove the binding and allow ACM to delete your certificate, you must remove the API Gateway custom domain that is associated with the certificate.

You can fin this information on AWS Docs https://docs.aws.amazon.com/acm/latest/userguide/troubleshoot-apigateway.html

Upvotes: 6

Related Questions