I'm using AWS Cloudformation to create EC2 spot instance (with block duration). In order to do this in cloudformation I'm using a Launch Template where spot configuration is set. Then my cloudformation template create an EC2 resource which use the Launch Template.
It work fine except when AWS refuse to create a spot instance. In that case, the cloudformation stack is still running.
I'm wondering if there is a way to fail the stack when the spot request is refused ?