cloudformation-guard icon indicating copy to clipboard operation
cloudformation-guard copied to clipboard

[Enhancement] Ability to integrate with the AWS CDK validate phase

Open 0xjjoyy opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. I would like to validate my CloudFormation against my defined CloudFormation Guard checks before synthesizing when using the AWS CDK.

Describe the solution you'd like Ability for CloudFormation Guard to integrate into the AWS CDK validate phase in the lifecycle. Synth should halt if validation fails. The validation should return CloudFormation Guard's messages.

Describe alternatives you've considered

Additional context

0xjjoyy avatar Mar 11 '21 14:03 0xjjoyy

I've just been trying to run cfn-guard cli to test the cloudformation generated by CDK and it is failing so the integration between these tools is important.

smaud avatar Aug 10 '21 04:08 smaud

Now I use this way to check cdk.out/*template.json.

for i in `ls cdk.out/*template.json`;do cfn-guard validate  -r [some_rules].rules -o yaml --data $i ";done

more see this repo

neilkuan avatar Sep 23 '21 02:09 neilkuan

@neilkuan bit of a hack but yeah you could do that. Should somehow be integrated into CDK rather than ls cdk.out

smaud avatar Sep 23 '21 02:09 smaud

yes @smaud . you are right . Use this way, before cfn-guard native support it. lol

neilkuan avatar Sep 23 '21 02:09 neilkuan

There is https://aws.amazon.com/blogs/mt/accelerating-development-with-aws-cdk-plugin-cfnguardvalidator/ now, seems that it does the above.

alexpulver avatar Nov 04 '23 07:11 alexpulver

Hi @0xjjoyy I am going to close this out now since https://github.com/cdklabs/cdk-validator-cfnguard exists.

Feel free to reopen if necessary

joshfried-aws avatar Feb 14 '24 20:02 joshfried-aws