2 Answers
- Newest
- Most votes
- Most comments
4
Hello,
To copy AMI:
- In the EC2 console, go to Images > AMIs.
- Select the AMI that was created during the restore.
- Click on Actions > Copy AMI.
- Specify the name (EX. Restored-Instance-AMI) and description.
- Choose the destination region if necessary and click Copy AMI.
Update CloudFormation Template
To Edit your CloudFormation template to include the new AMI ID example.
Resources:
MyEC2Instance:
Type: "AWS::EC2::Instance"
Properties:
InstanceType: t2.micro
ImageId: ami-0abcd1234efgh5678 # Replace with your copied AMI ID
KeyName: my-key-pair
# ... other properties ...
Perform Stack Update:
- In the CloudFormation console, select your stack and choose Update Stack.
- Upload the updated template with the new AMI ID or edit the template inline.
- Review and confirm the update.
3
HELLO....!
Create a new AMI after restoring the EC2 instance.
This is the thing you solve simply your issue:
- Restore EC2 instance: Use AWS Backup to restore the desired instance.
- Create new AMI: Once the instance is restored and running, create a new AMI from it.
- Update CloudFormation stack: Modify the stack template to use the newly created AMI.
- Update stack: Deploy the updated stack to incorporate the new AMI.
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago