热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

DependencyviolationwhendeletingaSubnet:ENIstillattachedtoELB

Thisissuewasoriginallyopenedby-nashashicorp/terraform#6318.Itwasmigrated

This issue was originally opened by -n as hashicorp/terraform#6318. It was migrated here as part of the provider split. The original body of the issue is below.

Hi,

I'm currently seeing terraform tries to destroy a subnet that was used in ELB and fails. I think its because ENI interface that belongs to the subnet is still attached to ELB. The subnet itself is removed from ELB correctly via ASG routine.

Terraform Version

v0.6.14

Actual Behavior

When I remove a subnet from vars, terraform correctly removes it from ASG/ELB. But it hangs at the subnet destroying step.

Workaround is to manually detach ENI(s) that belong to subnet and delete it.

1
2
3
4
5
6
7
aws_autoscaling_group.wp_asg: Refreshing state... (ID: wp-staging-qmlts6tb7fb3va6r3xe5glsie4-asg)

aws_subnet.blog_subnets.2: Refreshing state... (ID: subnet-c21543ff)

aws_subnet.blog_subnets.2: Destroying...



aws_subnet.blog_subnets.2: Destruction complete



Apply complete! Resources: 0 added, 0 changed, 1 destroyed.


Steps to Reproduce

Create an ELB with ASG that uses few subnets. Remove 1 subnet.
Watch ASG/ELB gets updated properly, but terraform hangs on subnet termination. If I try to delete subnet manually in aws interface - it complaines about attached ENI.

1
2
3
4
resource "aws_elb" "wp_elb" {

name = foo

subnets = ["${split(",", join(",", aws_subnet.app_subnets.*.id))}"]

}

Could be related to hashicorp/terraform#934

该提问来源于开源项目:hashicorp/terraform-provider-aws

I managed to reliably reproduce this using the following config:
https://gist.github.com/radeksimko/4132453a6cf6edc3ccb61c8bbe31e076



As mentioned already this is triggered by deletion of a subnet which is associated with an LB.

Sadly though there doesn't seem to be anything we can realistically do from Terraform's perspective. Even if we got the ordering of operations right and managed to disassociate the subnet from LB before attempting to delete it, Amazon wouldn't let us detach these ENIs as they hold them until the LB is fully destroyed. You will get the following error when attempting to do so:



An error occurred (AuthFailure) when calling the DetachNetworkInterface operation: You do not have permission to access the specified resource.

I am not sure if this is by design. Perhaps we could get some explanation from the LB/EC2 teams?


   



推荐阅读
  • 本文讨论了在使用Git进行版本控制时,如何提供类似CVS中自动增加版本号的功能。作者介绍了Git中的其他版本表示方式,如git describe命令,并提供了使用这些表示方式来确定文件更新情况的示例。此外,文章还介绍了启用$Id:$功能的方法,并讨论了一些开发者在使用Git时的需求和使用场景。 ... [详细]
  • java drools5_Java Drools5.1 规则流基础【示例】(中)
    五、规则文件及规则流EduInfoRule.drl:packagemyrules;importsample.Employ;ruleBachelorruleflow-group ... [详细]
  • 域名解析系统DNS
    文章目录前言一、域名系统概述二、因特网的域名结构三、域名服务器1.根域名服务器2.顶级域名服务器(TLD,top-leveldomain)3.权威(Authoritative)域名 ... [详细]
  • Apple iPad:过渡设备还是平板电脑?
    I’vebeenagonizingoverwhethertopostaniPadarticle.Applecertainlydon’tneedmorepublicityandthe ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 展开全部下面的代码是创建一个立方体Thisexamplescreatesanddisplaysasimplebox.#Thefirstlineloadstheinit_disp ... [详细]
  • MyBatis多表查询与动态SQL使用
    本文介绍了MyBatis多表查询与动态SQL的使用方法,包括一对一查询和一对多查询。同时还介绍了动态SQL的使用,包括if标签、trim标签、where标签、set标签和foreach标签的用法。文章还提供了相关的配置信息和示例代码。 ... [详细]
  • 深度学习中的Vision Transformer (ViT)详解
    本文详细介绍了深度学习中的Vision Transformer (ViT)方法。首先介绍了相关工作和ViT的基本原理,包括图像块嵌入、可学习的嵌入、位置嵌入和Transformer编码器等。接着讨论了ViT的张量维度变化、归纳偏置与混合架构、微调及更高分辨率等方面。最后给出了实验结果和相关代码的链接。本文的研究表明,对于CV任务,直接应用纯Transformer架构于图像块序列是可行的,无需依赖于卷积网络。 ... [详细]
  • HashMap的相关问题及其底层数据结构和操作流程
    本文介绍了关于HashMap的相关问题,包括其底层数据结构、JDK1.7和JDK1.8的差异、红黑树的使用、扩容和树化的条件、退化为链表的情况、索引的计算方法、hashcode和hash()方法的作用、数组容量的选择、Put方法的流程以及并发问题下的操作。文章还提到了扩容死链和数据错乱的问题,并探讨了key的设计要求。对于对Java面试中的HashMap问题感兴趣的读者,本文将为您提供一些有用的技术和经验。 ... [详细]
  • HashMap的扩容知识详解
    本文详细介绍了HashMap的扩容知识,包括扩容的概述、扩容条件以及1.7版本中的扩容方法。通过学习本文,读者可以全面了解HashMap的扩容机制,提升对HashMap的理解和应用能力。 ... [详细]
  • 动态多点××× 单云双HUB
    动态多点是一个高扩展的IPSEC解决方案传统的ipsecS2S有如下劣势1.中心站点配置量大,无论是采用经典ipsec***还是采用greoveripsec多一个分支 ... [详细]
  • css div中文字位置_超赞的 CSS 阴影技巧与细节
    本文的题目是CSS阴影技巧与细节。CSS阴影,却不一定是box-shadow与filter:drop-shadow,为啥?因为使用其他属性 ... [详细]
  • Spring MVC定制用户登录注销实现示例
    这篇文章描述了如何实现对SpringMVCWeb应用程序的自定义用户访问(登录注销)。作为前提,建议读者阅读这篇文章,其中介 ... [详细]
  • Spring 源码阅读 74:事务管理的原理BeanFactoryTransactionAttributeSourceAdvisor 分析
    本文通过对BeanFactoryTransactionAttributeSourceAdvisor类的分析,了解了Spring是如何通过AOP来完成事务的管理的&#x ... [详细]
author-avatar
sl51866
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有