CloudFormation deleting nlb did not release public IP

0

I deleted my C/f stack which included an NLB but that hasn't released the public IPs associated with each subnet. To be clear, the NLB instances have been deleted but their public IPs are still marked as in use. I'm now unable to detach , or delete them - as they are marked as being in use by another service - the NLB that has successfully been deleted.

None of the troubleshooting articles (which are primarily related to EIPs) offer any material resolution. Even logging into the console as root, I get the error that I do not have permissions.

Any thoughts on what I'm missing?

1개 답변
0

Hi There

This is happening because the EIP is associated with the managed network interface of the load balancer. It takes some time for the deleted NLB to release the network interface. You cant delete the EIP until the network interface is gone, and unfortunately CloudFormation doesnt have any knowledge of this.

You can do any of the following:

  • Dont use an Elastic IP and just let AWS assign a public IP to the NLB. Example:
  loadBalancer:
    Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
    Properties:
      Type: network
      IpAddressType: ipv4
      Scheme: internet-facing
      Subnets: !Ref Subnets
  • Perform a delete-stack operation again, after verifying that any network interfaces(belonging to network load balancer) are deleted by elbv2 service itself and association id is removed from EIP.
  • Use DeletionPolicy/UpdateReplacePolicy attributes with AWS::EC2::EIP resource and set value to Retain to achieve single step stack deletion. Note that you will still need to delete the EIP manually.
profile pictureAWS
전문가
Matt-B
답변함 2년 전
profile pictureAWS
전문가
Toni_S
검토됨 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠