On two occasions I have been asked [by members of Parliament], ‘Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?’ I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
I’m updating an older stack in CDK and is my custom I’m writing tests. When writing tests for an existing stack, I’ll incorporate the output from the deployed Cloudformation templates. This ensures that the test is realistic and works toward my main goal, which is to minimize disruption to the infrastructure when updating the code. A good example is security groups–changing the description is enough to require replacement. If you have a multi-stack deployment with ingress/egress relationships between security groups, that will cause problems. Testing for that upfront saves time.
When working with a CDK application, you can have code in three places: