How do I bulk copy AMI AWS account number permissions from one AMI image to another?

Deadly 提交于 2019-12-13 01:27:12

问题


I have an AMI image which is private and via the Permissions tab I have made the image available to several dozen AWS account numbers.

I have a new AMI image that I would like to make available to the same AWS accounts as the original image.

I can cut and paste each account number into the Permissions tab dialog on the new AMI image... but that seems very tedious. Is there a way to bulk copy the AWS account number permissions set on one AMI image to another AMI image?

Thanks.


回答1:


You should be able to script this using the AWS CLI command aws ec2 modify-image-attribute

See some of the examples in the documentation. Specifically the example titled "To grant launch permission to an AWS account"



来源:https://stackoverflow.com/questions/35136235/how-do-i-bulk-copy-ami-aws-account-number-permissions-from-one-ami-image-to-anot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!