【问题标题】:How force remove network interfaces? AWS - Error detaching network interface如何强制删除网络接口? AWS - 分离网络接口时出错
【发布时间】:2020-05-31 00:35:07
【问题描述】:

我使用嵌套堆栈创建了堆栈,有一些网络接口、VPC 等。 我尝试删除网络接口,但无法删除,因为出现错误

Error detaching network interface
eni-0d3be6d4c7869686a: You are not allowed to manage 'ela-attach' attachments.

你知道如何强制删除吗?

【问题讨论】:

    标签: amazon-web-services amazon-ec2 vpc


    【解决方案1】:

    我在使用多个 CF 堆栈时遇到了同样的问题。 当正在使用的 AWS 构造附加到 VPC 时,堆栈删除失败。对我有用的一种方法是使用以下脚本查找依赖项,然后在删除 VPC 之前手动删除它们。 (手动删除脚本中的所有依赖项,最后尝试删除网络接口)。完成后,然后尝试从 mgmt 控制台删除 CF 堆栈,没有任何问题。

    让我们知道这是否有效。

    #!/bin/bash
    vpc="vpc-xxxxxxxxxxxxx" 
    aws ec2 describe-internet-gateways --filters 'Name=attachment.vpc-id,Values='$vpc | grep InternetGatewayId
    aws ec2 describe-subnets --filters 'Name=vpc-id,Values='$vpc | grep SubnetId
    aws ec2 describe-route-tables --filters 'Name=vpc-id,Values='$vpc | grep RouteTableId
    aws ec2 describe-network-acls --filters 'Name=vpc-id,Values='$vpc | grep NetworkAclId
    aws ec2 describe-vpc-peering-connections --filters 'Name=requester-vpc-info.vpc-id,Values='$vpc | grep VpcPeeringConnectionId
    aws ec2 describe-vpc-endpoints --filters 'Name=vpc-id,Values='$vpc | grep VpcEndpointId
    aws ec2 describe-nat-gateways --filter 'Name=vpc-id,Values='$vpc | grep NatGatewayId
    aws ec2 describe-security-groups --filters 'Name=vpc-id,Values='$vpc | grep GroupId
    aws ec2 describe-instances --filters 'Name=vpc-id,Values='$vpc | grep InstanceId
    aws ec2 describe-vpn-connections --filters 'Name=vpc-id,Values='$vpc | grep VpnConnectionId
    aws ec2 describe-vpn-gateways --filters 'Name=attachment.vpc-id,Values='$vpc | grep VpnGatewayId
    aws ec2 describe-network-interfaces --filters 'Name=vpc-id,Values='$vpc | grep NetworkInterfaceId
    

    参考:https://aws.amazon.com/premiumsupport/knowledge-center/troubleshoot-dependency-error-delete-vpc/

    【讨论】:

      【解决方案2】:

      查找 ENI 附加到的资源。例如,它可以是 Lambda 函数或 ELB。该资源是在您的 CloudFormation 堆栈之外创建的吗?如果是这样,您将需要删除该资源。如果它是在 CloudFormation 堆栈中创建的,那么您可能只需要等待并重试(例如,如果一个暖 Lambda 函数正在占用 ENI)。

      更详细地描述了步骤here。其他想法here.

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-04-12
        • 2019-11-16
        • 2018-12-06
        • 2020-05-13
        • 1970-01-01
        • 2020-10-01
        • 2016-11-26
        相关资源
        最近更新 更多