- Newest
- Most votes
- Most comments
There are a couple of issues with your CloudFormation template that are causing the "Internal Failure" error:
-
The resource type
AWS::EC2::Snapshotdoes not exist in CloudFormation. This is why you're not seeing it in the CloudFormation Template Reference guide or schema.json. CloudFormation doesn't have a direct resource type for creating EBS snapshots. -
There's also a typo in your template:
DependsOn: EBSSnapshotRetentionVolumis missing the final 'e' (should beEBSSnapshotRetentionVolume). -
You have an additional test resource that's also trying to use the non-existent
AWS::EC2::Snapshottype without any properties.
To create snapshots in CloudFormation, you have a few alternatives:
- Use AWS::ImageBuilder::Image if you need to create an AMI
- Use a custom resource with Lambda to create snapshots
- Use AWS Systems Manager Automation or AWS Backup to manage snapshots
For testing snapshot deletion logic, you might consider creating snapshots manually through the AWS Console or CLI, or using a custom resource in your CloudFormation template that calls the EC2 CreateSnapshot API.
EBS snapshot failures can occur due to various reasons including transient issues, service limits, or permissions problems. If you're implementing snapshot deletion logic, you should also consider handling potential failure scenarios.
Sources
Cloudformation template - unrecognised resource type | AWS re:Post
Automatic Recovery for Failed EBS Snapshot | AWS re:Post
DeleteSnapshotReturnCode - Amazon Elastic Compute Cloud
