- Newest
- Most votes
- Most comments
When restoring an EC2 instance using AWS Backup via PowerShell, you can control the instance's startup behavior by specifying the appropriate metadata parameters in your Start-BAKRestoreJob command.
To restore an EC2 instance that remains in a stopped state, you need to include the "InstanceInitiatedShutdownBehavior" parameter with a value of "stop" in your restore job metadata. This tells AWS Backup how to handle the instance after restoration.
Here's how you would structure your PowerShell command:
Start-BAKRestoreJob -RecoveryPointArn "arn:aws:backup:REGION:ACCOUNT_ID:recovery-point:RECOVERY_POINT_ID" ` -Metadata @{ "RestoreTo" = "EC2Instance"; "InstanceType" = "t2.medium"; # Or your preferred instance type "InstanceInitiatedShutdownBehavior" = "stop"; # Other required parameters like VpcId, SubnetId, etc. } ` -IamRoleArn "IAM_ROLE_ARN" ` -ResourceType "VirtualMachine" ` -CopySourceTagsToRestoredResource $false
By setting "InstanceInitiatedShutdownBehavior" to "stop", you're configuring the instance to remain in a stopped state after the restore process completes. This approach allows you to restore the EC2 instance without it automatically starting, giving you control over when to start the instance manually later if needed.
Sources
Customizing the Network Settings When Using AWS Backup to Restore VMware-Based Instances to Amazon EC2 | AWS re:Post
Restore a virtual machine using AWS Backup - AWS Backup
Relevant content
- asked 16 days ago
- AWS OFFICIALUpdated 3 years ago

This does not work.