You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using a Condition in the DeletionPolicy of a resource is deemed invalid. #3825
During production, I would like to retain AutoScalingGroups rather than delete them (on staging, I want them deleted). To achieve that I am attempting to use the following:
This seems to be a known limitation in cloudformation, based on this forum post. Basically it only accepts a raw string, no references or functions. Their suggestion is to have two copies of the object and use the Condition to control which one you send.
Reacted by Pat Myron
Reacted by gghez, Carlos Juega, Tomek Klas, Tommy Back, Amir Chatrbahr, Edvin Močibob, Aura Herrera Solis, blainehilton and Mark Harris
Reacted by Dominic Dambrogia, Steffen Opel, Claire Martinez, altifuse, bdrx312, George Jenkins, Mihai Todor, Antonio, julian-saunders, Adham Abu Dari and 22 more
So the drawback to the above is that you have to wholesale copy things over, which is annoying. What you could to to make that slightly less painful is use a yaml anchor to copy over the properties and just overwrite what you need, like so:
The catch is that cloudformation doesn't support anchors, so you would need to pre-process them away. We could probably update the package command to support doing that since it's not entirely trivial due to needing to support the special tags that cloudformation provides.
Reacted by Dominic Dambrogia, Steffen Opel, Lutsius Alex, Pat Myron and Ticiano Herrera
Reacted by Pat Myron, Adrien Becchis, Michael Vosseller, Will Dimmit, Kai Xia(夏恺), Vadim Zenin, Tommy Back, Edvin Močibob, Malik, David Ramos and 2 more
This has a high level of user experience, automation, cost and security implications. This was first raised in 2014 and we, as paying customers, still have no way to set DeletionPolicy dynamically.
Reacted by Yurii Timofeev, Ohad Benita, Matthew Rowles, aleksanderEE, Ali Baharev, Maxime Lebastard, flei1998, Csaba Szilveszter, Rafael Viotti, small4all and 9 more
Is there any update on this? This is a real important issue as mentioned above.
Reacted by small4all, Ben Owen, orest-gulman, Craig Shepherd, Tomek Klas, Tommy Back, Matt Hotstone, Ben Bernays, Karl von Randow, Salem Qemlas and 4 more
Hi all, the CloudFormation Team is prioritizing this issue. We have recently published a github repo dedicated to collecting feedback on the CloudFormation template language. It includes an RFC which proposes to support certain intrinsic functions and pseudo parameters in DeletionPolicies and UpdateReplacePolicies. You're welcome to add feedback here:
@MalikAtalla-AWS Thanks for the response and, although it was 3 years later on GH and 8 years later in total, I do appreciate that things change, people move, priorities shift etc. In particular with this one, it is sounding like it was out of your hands for the most part and possibly pained you as much as it does us (from a security POV).
However, I don't think closing it HERE is okay. I think leaving by leaving it open here, we as customers can hold the teams accountable. I don't mean this in a mean spirited way, rather, I just want to help ensure that we get this over the line. I fear that it's been forgotten about too many times for far too long.
Hey @mrowles, I can understand your frustration. I'm a CFN user myself and would love to be able use this feature in my own infrastructure.
I suspect the issue was closed here because it was tracked in a more appropriate repo. This week we have moved it to the cfn-language-discussion repo which is the right place for it. We are aware that many customers are asking for this and are using upvotes (among other things) for prioritization. So, we invite you to comment or +1 any of the issues you see in that repo.
Hi all, really appreciate all the feedback and I'm happy to share that intrinsic functions such as Fn::If are supported now with the launch of AWS::LanguageExtensions transform. Please feel free to try it out and leave your feedback in the cfn-language-discussion repo.
Reacted by Matthew Rowles, M Gallagher, Mark Harris and Svend Vanderveken
Activity
JordonPhillips commentedon Jan 3, 2019
This seems to be a known limitation in cloudformation, based on this forum post. Basically it only accepts a raw string, no references or functions. Their suggestion is to have two copies of the object and use the
Conditionto control which one you send.dambrogia commentedon Jan 3, 2019
@JordonPhillips Not the answer I wanted, but an answer none the less. Thanks!
JordonPhillips commentedon Jan 3, 2019
So the drawback to the above is that you have to wholesale copy things over, which is annoying. What you could to to make that slightly less painful is use a yaml anchor to copy over the properties and just overwrite what you need, like so:
The catch is that cloudformation doesn't support anchors, so you would need to pre-process them away. We could probably update the package command to support doing that since it's not entirely trivial due to needing to support the special tags that cloudformation provides.
jthomerson commentedon Sep 6, 2019
I requested this on the CloudFormation roadmap: https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/162
mrowles commentedon May 1, 2020
This has a high level of user experience, automation, cost and security implications. This was first raised in 2014 and we, as paying customers, still have no way to set DeletionPolicy dynamically.
ohadbenita commentedon Jun 4, 2020
Is there any update on this? This is a real important issue as mentioned above.
MalikAtalla-AWS commentedon May 12, 2022
Hi all, the CloudFormation Team is prioritizing this issue. We have recently published a github repo dedicated to collecting feedback on the CloudFormation template language. It includes an RFC which proposes to support certain intrinsic functions and pseudo parameters in DeletionPolicies and UpdateReplacePolicies. You're welcome to add feedback here:
RFC: https://github.com/aws-cloudformation/cfn-language-discussion/pull/21/files
Tracking Issue: aws-cloudformation/cfn-language-discussion#11
Customer-created issue: aws-cloudformation/cfn-language-discussion#58
mrowles commentedon May 13, 2022
@MalikAtalla-AWS Thanks for the response and, although it was 3 years later on GH and 8 years later in total, I do appreciate that things change, people move, priorities shift etc. In particular with this one, it is sounding like it was out of your hands for the most part and possibly pained you as much as it does us (from a security POV).
However, I don't think closing it HERE is okay. I think leaving by leaving it open here, we as customers can hold the teams accountable. I don't mean this in a mean spirited way, rather, I just want to help ensure that we get this over the line. I fear that it's been forgotten about too many times for far too long.
MalikAtalla-AWS commentedon May 13, 2022
Hey @mrowles, I can understand your frustration. I'm a CFN user myself and would love to be able use this feature in my own infrastructure.
I suspect the issue was closed here because it was tracked in a more appropriate repo. This week we have moved it to the cfn-language-discussion repo which is the right place for it. We are aware that many customers are asking for this and are using upvotes (among other things) for prioritization. So, we invite you to comment or +1 any of the issues you see in that repo.
MalikAtalla-AWS commentedon Aug 30, 2022
Hi all, really appreciate all the feedback and I'm happy to share that intrinsic functions such as Fn::If are supported now with the launch of AWS::LanguageExtensions transform. Please feel free to try it out and leave your feedback in the cfn-language-discussion repo.
mrowles commentedon Aug 30, 2022
Thanks mate @MalikAtalla-AWS