aws-cloudformation / cloudformation-guard

Guard offers a policy-as-code domain-specific language (DSL) to write rules and validate JSON- and YAML-formatted data such as CloudFormation Templates, K8s configurations, and Terraform JSON plans/configurations against those rules. Take this survey to provide feedback about cfn-guard: https://amazonmr.au1.qualtrics.com/jfe/form/SV_bpyzpfoYGGuuUl0
Apache License 2.0
1.3k stars 180 forks source link

Reference variables inside custom error messages #579

Open atheiman opened 1 month ago

atheiman commented 1 month ago

Need the ability to reference variables in custom error messages. It makes the guard code cleaner when you can check for a value, then raise a custom error for that value missing. Im trying to use this for Config rule evaluation annotations, and the Config docs show this is not supported.

Note: Currently, Guard doesn't support referencing variables inside custom error messages.

https://docs.aws.amazon.com/cfn-guard/latest/ug/variables.html

joshfried-aws commented 3 days ago

Hi @atheiman thanks for the enhancement idea.

This is definitely something we will consider moving forward. We will update this ticket on this matter as necessary.

Thanks,