I am trying to transfer AMI from my AWS account A (ap-southeast-2) to account B (us-east-1).
In my account, I have granted launch permissions for my account A.
However, when I run the code below,
$result = $this->destination_ec2_client->copyImage(
array(
'SourceRegion' => $this->source_region,
'SourceImageId' => $image_id,
'Name' => $amis[0]['Name']
));
When I run the documentation over the code, the call should copy the AMI from the source area and copy it to the destination area.
However, the end result is an error. An error is displayed on the console when the AMI description is unsuccessful.
State Reason: AMI ownership mismatch
Any thoughts? Did I understand the mechanism correctly?
source
share