I’m a big fan of the AWS CDK and I’ve been using it a lot over the last few month while building out projects. One challenge I recently encountered was creating a volume based on some deploy-time parameter in AWS CloudFormation. The idea was to create a volume given a snapshot ID. If the snapshot ID was default I’d create the volume from scratch (i.e. a new volume).
TLDR? This solution highlights how you would use a CfnCondition to conditionally create an AWS EBS volume from a snapshot or from scratch.
19 August 2022 • Reading Time: ~ 9 mins
https://www.jforte.me/posts/create-ebs-volume-snapshot-condtions-aws-cdk/
Jason Forte