如何将AMI AWS帐号权限从一个AMI映像批量复制到另一个AMI映像? [英] How do I bulk copy AMI AWS account number permissions from one AMI image to another?
问题描述
我有一个专用的AMI映像,通过权限"选项卡,该映像可用于数十个AWS帐号.
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.
我有一个新的AMI映像,我想将其提供给与原始映像相同的AWS账户.
I have a new AMI image that I would like to make available to the same AWS accounts as the original image.
我可以将每个帐号剪切并粘贴到新AMI图像上的权限"选项卡对话框中,但这看起来非常乏味.是否可以将在一个AMI映像上设置的AWS帐号权限批量复制到另一个AMI映像?
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?
谢谢.
推荐答案
您应该能够使用AWS CLI命令aws ec2 modify-image-attribute
You should be able to script this using the AWS CLI command aws ec2 modify-image-attribute
请参见文档中的一些示例.具体来说,标题为向AWS帐户授予启动权限"的示例
See some of the examples in the documentation. Specifically the example titled "To grant launch permission to an AWS account"
这篇关于如何将AMI AWS帐号权限从一个AMI映像批量复制到另一个AMI映像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!