diff --git a/upload-ami/src/upload_ami/upload_ami.py b/upload-ami/src/upload_ami/upload_ami.py index 7cad646..122a5d0 100644 --- a/upload-ami/src/upload_ami/upload_ami.py +++ b/upload-ami/src/upload_ami/upload_ami.py @@ -265,7 +265,7 @@ def copy_image( "%Y-%m-%dT%H:%M:%SZ" ) logging.info(f"Deprecating {copy_image['ImageId']} at {deprecate_at}") - ec2r.enable_image_deprecation(ImageId=image_id, DeprecateAt=deprecate_at) + ec2r.enable_image_deprecation(ImageId=copy_image['ImageId'], DeprecateAt=deprecate_at) if public: logging.info(f"Making {copy_image['ImageId']} public") ec2r.modify_image_attribute(