Documente Academic
Documente Profesional
Documente Cultură
YoucanshareanAMIwithspecificAWSaccountswithoutmakingtheAMIpublic.Allyouneedarethe
AWSaccountIDs.
1.OpentheAmazonEC2consoleathttps://console.aws.amazon.com/ec2/.
2.Inthenavigationpane,chooseAMIs.
3.SelectyourAMIinthelist,andthenchooseActions,ModifyImagePermissions.
4.SpecifytheAWSaccountnumberoftheuserwithwhomyouwanttosharetheAMIintheAWS
AccountNumberfield,thenchooseAddPermission.
TosharethisAMIwithmultipleusers,repeattheabovestepuntilyouhaveaddedalltherequired
users.
5.Toallowcreatevolumepermissionsforsnapshots,selectAdd"createvolume"permissionstothe
followingassociatedsnapshotswhencreatingpermissions.
Note
YoudonotneedtosharetheAmazonEBSsnapshotsthatanAMIreferencesinordertosharethe
AMI.OnlytheAMIitselfneedstobesharedthesystemautomaticallyprovidestheinstanceaccess
tothereferencedAmazonEBSsnapshotsforthelaunch.
6.ChooseSavewhenyouaredone.
SharinganAMI(AWSCLI)
UsethemodifyimageattributecommandtoshareanAMIasshowninthefollowingexamples.
Tograntexplicitlaunchpermissions
ThefollowingcommandgrantslaunchpermissionsforthespecifiedAMItothespecifiedAWSaccount.
$awsec2modifyimageattributeimageidami2bb65342launchpermission"
{\"Add\":[{\"UserId\":\"123456789012\"}]}"
Toremovelaunchpermissionsforanaccount
ThefollowingcommandremoveslaunchpermissionsforthespecifiedAMIfromthespecifiedAWS
account:
$awsec2modifyimageattributeimageidami2bb65342launchpermission"
{\"Remove\":[{\"UserId\":\"123456789012\"}]}"
Toremovealllaunchpermissions
ThefollowingcommandremovesallpublicandexplicitlaunchpermissionsfromthespecifiedAMI.
NotethattheowneroftheAMIalwayshaslaunchpermissionsandisthereforeunaffectedbythis
command.
$awsec2resetimageattributeimageidami2bb65342attribute
launchPermission
SharinganAMI(AmazonEC2CLI)
Usetheec2modifyimageattributecommandtoshareanAMIasshowninthefollowingexamples.
Tograntexplicitlaunchpermissions
ThefollowingcommandgrantslaunchpermissionsforthespecifiedAMItothespecifiedAWSaccount.
$ec2modifyimageattributeami2bb65342la111122223333
Toremovelaunchpermissionsforanaccount
ThefollowingcommandremoveslaunchpermissionsforthespecifiedAMIfromthespecifiedAWS
account:
$ec2modifyimageattributeami2bb65342lr111122223333
Toremovealllaunchpermissions
ThefollowingcommandremovesallpublicandexplicitlaunchpermissionsfromthespecifiedAMI.
NotethattheowneroftheAMIalwayshaslaunchpermissionsandisthereforeunaffectedbythis
command.
$ec2resetimageattributeami2bb65342l