How to change image permission (AMI) for AWS using boto/python?
You can use the modify_image_attribute method of the boto.ec2
module to modify this and other attributes associated with an image.
You can add additional authorized users like this:
import boto.ec2
ec2 = boto.ec2.connect_to_region('<your region>')
ec2.modify_image_attribute('ami-12345678', operation='add', attribute='launchPermission', user_ids=['user_id_1', 'user_id_2'])
Similarly, you could add authorize groups using the attribute='launchPermission'
and the group values in the parameter group_ids
.