mirror of
https://github.com/ipxe/ipxe
synced 2026-01-21 18:30:56 +03:00
[cloud] Remove AWS public image access block automatically if needed
Making images public is blocked by default in new AWS regions. Remove this block automatically whenever creating a public image. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -104,6 +104,7 @@ def import_image(region, name, family, architecture, image, public, overwrite,
|
|||||||
image_id = image['ImageId']
|
image_id = image['ImageId']
|
||||||
client.get_waiter('image_available').wait(ImageIds=[image_id])
|
client.get_waiter('image_available').wait(ImageIds=[image_id])
|
||||||
if public:
|
if public:
|
||||||
|
client.disable_image_block_public_access()
|
||||||
resource.Image(image_id).modify_attribute(Attribute='launchPermission',
|
resource.Image(image_id).modify_attribute(Attribute='launchPermission',
|
||||||
OperationType='add',
|
OperationType='add',
|
||||||
UserGroups=['all'])
|
UserGroups=['all'])
|
||||||
|
|||||||
Reference in New Issue
Block a user