28

In AWS documentation is crystal clear how to delete a package version, ok.

But, how can I delete a package?

I've uploaded a package with a wrong name, I've deleted the only version of it, now I can see a package without any version but I can't find a way to remove the package with the wrong name. :(

Daniele Ricci
  • 15,422
  • 1
  • 27
  • 55
  • 1
    Still waiting on this functionality it seems. I can't find it in the CLI docs, either. https://docs.aws.amazon.com/cli/latest/reference/codeartifact/index.html. Weird. – Matthew Allen May 16 '22 at 13:43
  • 1
    I have the exact same problem now. I guess we're stuck with the empty package… – NiñoScript Jan 11 '23 at 16:11

1 Answers1

0

AWS added delete-package api in codeartifact in the version 1.26.61 (you can delete package in cli, console, APIs)

AWS Console

You can select the package and click on Delete Package under actions.

delete codeartifact package in aws console CLI:

You need to update aws-cli to make use of this.

aws codeartifact delete-package --domain <domain> --repository <repo> --package "my_package" --format <pypi | maven | npm | nuget>

Boto3

Update boto3 version to latest

pip install -U boto3

script to delete a package

import boto3

client = boto3.client("codeartifact")

response = client.delete_package(
    domain='mydomain',
    repository='myrepo',
    format='npm'|'pypi'|'maven'|'nuget',
    package='mypackage'
)
DilLip_Chowdary
  • 841
  • 4
  • 18