I have been trying to migrate an AMI from my AWS account A (ap-southeast-2) to Account B (us-east-1).
In my account I have given launch permissions to my Account A.
However when I run below code,
$result = $this->destination_ec2_client->copyImage(
array(
'SourceRegion' => $this->source_region,
'SourceImageId' => $image_id,
'Name' => $amis[0]['Name']
));
When I run above code by documentation the call should copy the AMI from source region and copy it to destination region.
However, The final output is an error. The Error is shown on the console under failed AMI description.
State Reason: AMI ownership mismatch
Any thoughts? Have I understood the mechanism correctly?