#8421 allow `aws-copr` group to deregister its own images
Closed: Fixed 4 years ago by kevin. Opened 4 years ago by praiskup.

$ aws ec2 deregister-image --image-id ami-05e2eb8244dae5c7a

An error occurred (UnauthorizedOperation) when calling the DeregisterImage operation: You are not authorized to perform this operation.

We update images each few months, and it's useless to keep the old
images available and waste space...


Metadata Update from @mizdebsk:
- Issue tagged with: aws

4 years ago

ok. Give this another try now.

Metadata Update from @kevin:
- Issue priority set to: Waiting on Reporter (was: Needs Review)

4 years ago

Still the same problem:

[copr@copr-be-dev ~][STG]$ aws ec2 deregister-image --image-id ami-05e2eb8244dae5c7a

An error occurred (UnauthorizedOperation) when calling the DeregisterImage operation: You are not authorized to perform this operation.

ok, try again now.

I might have had the wrong tag type set... make sure the ami is tagged FedoraGroup copr...

You can try on copr-be-dev.cloud.fedoraproject.org as copr user:

[copr@copr-be-dev ~][STG]$ aws ec2 describe-images --image-id ami-05e2eb8244dae5c7a 
{
    "Images": [
        {
            "Architecture": "x86_64",
            "CreationDate": "2019-11-20T10:05:56.000Z",
            "ImageId": "ami-05e2eb8244dae5c7a",
            "ImageLocation": "125523088429/test-praiskup",
            "ImageType": "machine",
            "Public": false,
            "OwnerId": "125523088429",
            "State": "available",
            "BlockDeviceMappings": [
                {
                    "DeviceName": "/dev/sda1",
                    "Ebs": {
                        "DeleteOnTermination": true,
                        "SnapshotId": "snap-01d7f12a29e22630c",
                        "VolumeSize": 6,
                        "VolumeType": "gp2",
                        "Encrypted": false
                    }
                }
            ],
            "EnaSupport": true,
            "Hypervisor": "xen",
            "Name": "test-praiskup",
            "RootDeviceName": "/dev/sda1",
            "RootDeviceType": "ebs",
            "Tags": [
                {
                    "Key": "FedoraGroup",
                    "Value": "copr"
                },
                {
                    "Key": "Owner",
                    "Value": "copr"
                },
                {
                    "Key": "UserRole",
                    "Value": "copr"
                },
                {
                    "Key": "PrincipalId",
                    "Value": "AIDAR2OOCKQWZW4XS3PEX"
                },
                {
                    "Key": "Name",
                    "Value": "copr-bulder-x86_64-test-praiskup"
                }
            ],
            "VirtualizationType": "hvm"
        }
    ]
[copr@copr-be-dev ~][STG]$ aws ec2 deregister-image --image-id ami-05e2eb8244dae5c7a

An error occurred (UnauthorizedOperation) when calling the DeregisterImage operation: You are not authorized to perform this operation.

Metadata Update from @smooge:
- Issue priority set to: Waiting on Assignee (was: Waiting on Reporter)

4 years ago

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata