Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request for dynamic evaluation of conditions. #132

Open
reidca opened this issue Aug 1, 2023 · 0 comments
Open

Feature request for dynamic evaluation of conditions. #132

reidca opened this issue Aug 1, 2023 · 0 comments

Comments

@reidca
Copy link

reidca commented Aug 1, 2023

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Tell us about your request

What do you want us to build?
The ability for conditions to work using a dynamic element within the template.

Tell us about the problem you are trying to solve. What are you trying to do, and why is it hard?

I was writing a template where I needed to decide whether to create a resource based on whether there was an existing resource already in the account with the same name. In this case it was an IAM role however it could be anything.

Whilst conditions can be used to determine whether to create a resource, these can only be influenced by parameter values which are static for the template. When operating at scale using Stack Sets across many accounts it is impractical to alter the parameter value for each individual account.

I know CloudFormation does not have the ability to determine whether something exists, (that in itself could be another feature request), however it does have the ability to use Custom Resources that can do this check for you. However, a custom resource with a bool value indicating whether something exists or not cannot be used to influence the evaluation of a Condition. This is because conditions currently do not allow inputs from the Resources section.

Are you currently working around this issue?

I create a horrible hack where I would check to see whether something existed using a custom resource then would return an alternative name if it did and then use this name for the resource so as to not clash with the existing resource. This results in a useless resource being created.

What is the expected behavior with this new feature

Conditions that can be influenced by the output from a resource, or some other way of dynamically determining whether something should be created or not.

Additional context

Everyone who I talk to about this problem says use Terraform however this is not the answer when you already have a large deployment of CloudFormation and wish to have the server side state advantages and integration that CloudFormation brings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant