删除导出变量并帮助消除循环依赖 [英] Delete export variable and help removing circular dependency

查看:59
本文介绍了删除导出变量并帮助消除循环依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Cloudformation堆栈,我们导出由堆栈创建的ARN并将其导入同一堆栈内。当我们尝试删除堆栈时,它将首先尝试删除输出并意识到输出正在使用中,而不删除堆栈。

We have a Cloudformation stack, we export a ARN which is created by the stack and import it inside the same stack. When we try to delete the stack, It tries to delete the output first and realizes the output is in use and does not delete the stack.

我们正在寻找有关如何重新部署堆栈或编辑堆栈,以便我们可以删除依赖项。

We are looking for guidance on how to redeploy the stack or edit the stack so we can remove the dependency.

我们尝试在配置编辑器中编辑堆栈,但更改未保存并仍然得到尝试删除堆栈时出现相同的错误。

We tried editing the stack in config editor, but the changes not being saved and still get the same error when trying to delete the stack.

"UserPoolArn":{  
     "Description":"The ARN for Cognito User Pool",
     "Value":{  
        "Fn::GetAtt":[  
           "userPool",
           "Arn"
        ]
     },
     "Export":{  
        "Name":"organization:XX:UsersPoolArn"
     }

Import within the same cf stack
        "Environment":{  
           "Variables":{  

              "USER_POOL":{  
                 "Fn::ImportValue":"organization:XX:UsersPoolArn"
              }
           }
        }
     }

如何删除有问题的输出键/值?

how we can remove the offending output key/value?

推荐答案

我的第一个尝试是将ImportValue行替换为任何值。由于您的目标是删除堆栈,因此我并不真正在乎对值进行硬编码。使用该硬编码来更新堆栈,并且一旦堆栈达到更新完成状态,您就应该能够删除该堆栈,因为已删除了循环依赖性。

My first try would be to replace the ImportValue line with whatever the value would be. Since your goal is to delete the stack, I'm not really concerned about hardcoding a value. Update the stack with that hard coded and once the stack gets to an update complete status, you should be able to delete the stack since the circular dependency has been removed.

在单个堆栈中,Ref比ImportValue更好。我非常确定无法使用此配置创建堆栈,因为在启动之前验证堆栈时导入的值将不存在,所以我猜这是有人在更新堆栈后所做的事情已创建。

Within a single stack, Ref is a far better choice than ImportValue. I'm pretty sure the stack couldn't be created with this configuration since the imported value won't be present when it validates the stack before launching so I'm guessing it was something that someone did in an update to the stack after it was created.

这篇关于删除导出变量并帮助消除循环依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆