Select Language:
If you’re working with a CloudFormation Launch Template to create a Restore Testing Plan for a customer, you might run into some issues during testing. Here’s a simple guide to help you troubleshoot and resolve a common problem: the “Restore Metadata in invalid” error when testing your EC2 instance.
When you first launch your template, everything may seem fine, but problems can occur during the restore testing phase. Specifically, the error often points to an issue with the restore metadata configuration.
In your script, you might have a section like this:
- RestoreMetadataOverrides:
- subnetId: “[subnet id]”
- securityGroupIds: “[sg id]”
- instanceType: “t2.micro”
- iamInstanceProfileName: “”
- requireImdsV2: “true”
It’s understandable that you’re not including sensitive details like subnet IDs or security group IDs, which is a good practice. However, the way these are configured can still cause issues.
One common mistake is leaving certain fields empty or not properly formatted. For example, setting the iamInstanceProfileName to an empty string might cause problems if the metadata requires this field to be correctly specified or omitted altogether.
To fix this, double-check whether your template expects the iamInstanceProfileName to be present or if it can be left out. If you’re not assigning an IAM profile, try removing that line from your script entirely rather than leaving it blank.
Similarly, verify if the requireImdsV2 setting is supported and correctly formatted in your CloudFormation template. If unsure, consult the latest AWS documentation; sometimes, setting this to “true” might require additional configuration elsewhere.
Additionally, ensure that the subnet ID and security group IDs are correctly referenced when deploying. Even if you omit actual IDs for security, make sure your template is configured to accept placeholders or parameters, and that they are supplied during deployment.
In summary, check these points:
- Remove or properly set the
iamInstanceProfileName. - Confirm that all required fields are correctly formatted and supported.
- Make sure your subnet ID and security group IDs are correctly referenced via parameters.
- Review AWS documentation to ensure you’re using the correct syntax and supported options for your CloudFormation version.
By carefully reviewing these configuration details, you should be able to resolve the “Restore Metadata in invalid” error and successfully run your restore tests. If issues persist, consider reaching out to AWS support or reviewing logs for more detailed error insights.





