不可删除的ENI网络接口

查看网络接口的信息

aws ec2 describe-network-interfaces --network-interface-ids eni-XXX

尝试分离网络接口

aws ec2 detach-network-interface --attachment-id ela-attach-XXX

 出现以下报错:

An error occurred (OperationNotPermitted) when calling the DetachNetworkInterface operation: You are not allowed to manage 'ela-attach' attachments.

尝试删除网络接口

aws ec2 delete-network-interface --network-interface-id eni-XXX

出现以下报错: 

An error occurred (InvalidParameterValue) when calling the DeleteNetworkInterface operation: Network interface 'eni-XXX' is currently in use.

解决方法:

1、通过 ENI ID 配合搜索 CloudTrail 日志,确认到目标 ENI 是通过 Amazon Managed Prometheus 建置。

2、 尝试通过 AWS CLI 搜索相关资源可以看到确实有 Scrapers 残余:

aws amp list-scrapers
{
  "Scrapers": [
    {
      "Alias": "XXXXXX",
        ...
      "ScraperId": "s-XXX", # 残余资源相应的 ID。
      "Source": {
        "EksConfiguration": {
          "ClusterArn": "arn:aws:eks:XXXXX:XXX:cluster/XXX"# <--------- 可以看到这是与 Amazon EKS 资源相关联。推测是误操作而建立。
           ...
        }
      },
      "Status": {
        "StatusCode": "ACTIVE"
      },
     ...
    }
  ]
}

3、由于目标是清除所有 VPC 资源。使用如下命令:

aws amp delete-scraper --scraper-id "s-XXX"

4、确认 Scrapers 资源呈现 DELETING 状态:

aws amp list-scrapers
{
	"Scrapers": [{
		...
		"ScraperId": "s-XXX",
		...
		"Status": {
			"StatusCode": "DELETING"
		},
		...
	}]
}

5、最后,目标 VPC 顺利清除。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值