Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cloudendure/cloudendure.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,15 @@ def copy_image(self, image_id: str, kms_id: str):
new_image = _ec2_client.copy_image(
SourceImageId=image_id,
SourceRegion=AWS_REGION,
Name="test",
Name=f"copied-ami-{image_id}",
Encrypted=True,
KmsKeyId=kms_id,
)

print(new_image)
return new_image["ImageId"]

def split_image(self, image_id: str, root_name: str = "root_image"):
def split_image(self, image_id: str):
"""Split the image into a root drive only AMI and a collection of snapshots."""
print("Loading EC2 client for region: ", AWS_REGION)
_ec2_res = boto3.resource("ec2", AWS_REGION)
Expand Down Expand Up @@ -626,7 +626,7 @@ def split_image(self, image_id: str, root_name: str = "root_image"):
response = _ec2_res.register_image(
Architecture=image.architecture,
BlockDeviceMappings=[root_drive],
Name=root_name,
Name=f"root-ami-{image_id}",
RootDeviceName=image.root_device_name,
VirtualizationType=image.virtualization_type,
)
Expand Down