最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

amazon web services - How to allow re-creation of parent stack resources during deployment? - Stack Overflow

programmeradmin2浏览0评论

When deploying a stack (child) which references resources within another stack (parent), it seems that sometimes a resource in the parent stack needs to be re-created, but this is not possible because the child stack is referencing that resource and therefore it cannot be deleted.

The stacks are being deployed at the same time via CloudFormation (CDK). Contrived example:

const { someParentResource } = new ParentStack(...);

new ChildStack(..., someParentResource);

Since the child stack depends on someParentResource, if that resource needs to be created then the deployment will fail with an error:

Cannot delete export parent-stack:ExportsOutput...4c48840d... as it is in use by child-stack.

Given, again, that the stacks are being deployed together via a single call to cdk deploy, is there any way to tell AWS that it's okay to re-create resources with dependencies? Otherwise, the solution is to ... tear down the entire child stack ... ?

When deploying a stack (child) which references resources within another stack (parent), it seems that sometimes a resource in the parent stack needs to be re-created, but this is not possible because the child stack is referencing that resource and therefore it cannot be deleted.

The stacks are being deployed at the same time via CloudFormation (CDK). Contrived example:

const { someParentResource } = new ParentStack(...);

new ChildStack(..., someParentResource);

Since the child stack depends on someParentResource, if that resource needs to be created then the deployment will fail with an error:

Cannot delete export parent-stack:ExportsOutput...4c48840d... as it is in use by child-stack.

Given, again, that the stacks are being deployed together via a single call to cdk deploy, is there any way to tell AWS that it's okay to re-create resources with dependencies? Otherwise, the solution is to ... tear down the entire child stack ... ?

Share Improve this question asked Feb 6 at 21:44 Josh M.Josh M. 27.8k27 gold badges129 silver badges219 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can try with -e parameter:

cdk deploy -e parentStack

-e:

--exclusively, -e BOOLEAN Only deploy requested stacks and don't include dependencies.

发布评论

评论列表(0)

  1. 暂无评论