4 comentarios
Editing the serialized part of the metadata wasn't straightforward so I come up with this command:
aws backup get-recovery-point-restore-metadata --backup-vault-name Default --recovery-point-arn arn:aws:ec2:eu-south-1::image/ami-001a2a3a4a00005aa | jq '.RestoreMetadata | del (.SecurityGroupIds, .SubnetId)' | jq '.NetworkInterfaces = (.NetworkInterfaces | fromjson | map(. + { Description: "Primary network interface" }) | map(del(.NetworkInterfaceId, .SecondaryPrivateIpAddressCount, .AssociatePublicIpAddress, .PrivateIpAddress)) | @json) ' > restore.json
What this command does:
- extracts RestoreMetadata
- removes from it the fields SecurityGroupIds and SubnetId
- then deserialize and replaces the content of NetworkInterfaces removing NetworkInterfaceId, SecondaryPrivateIpAddressCount, AssociatePublicIpAddress and PrivateIpAddress
- serializes NetworkInterfaces and creates the json file for the restore job:
aws backup start-restore-job --region eu-south-1 --recovery-point-arn arn:aws:ec2:eu-south-1::image/ami-001a2a3a4a00005aa --iam-role-arn "arn:aws:iam::123412341234:role/service-role/AWSBackupDefaultServiceRole" --metadata file://restore.json
YMMV: for example this might not work if the primary ENI has two private addresses.
respondido hace un año
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
The Private IP Address should be retained.
In the step1, PrivateIpAddress is 172.16.1.5.
In the step2, PrivateIpAddress is 172.16.2.5.
respondido hace 10 meses
Thank you for your comment. We'll review and update the Knowledge Center article as needed.

Contenido relevante
- preguntada hace un mes
- preguntada hace 22 días
- preguntada hace un mes
- preguntada hace un mes
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace 3 años