Subject: | Documentation for register_image is misleading |
The documentation for register_image says
"$image = $ec2->register_image(-name=>$name,%other_args)
Register an image, creating an AMI."
and
"Note: Immediately after registering the image you can add tags to it and use modify_image_attribute to change launch permissions, etc."
Even though it doesn't explicitly says it, I assumed that this returns a VM::EC2::Image object.
But it does not, it returns a String with the AMI ID.
(create_image does returns a VM::EC2::Image which makes it even more confusing).
Either register_image should be changed to wait for the AMI and return an object, like create_image, or the documentation should explicitly say something "Returns the AMI ID which is not immediately valid. You will need to wait for the AMI to be available with code like until( $ami = $self->ec2->describe_images($ami_id) ) { sleep 1 }"
Regards,
Frank Lichtenheld