Search code examples
amazon-web-servicesrepositorypolicyaws-codeartifact

How to have a public AWS CodeArtifact Repository policy


Is it possible to make a repository inside AWS CodeArtifact public without any credentials required?

I tried this repository policy, but didn't work:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "codeartifact:DescribePackageVersion",
                "codeartifact:DescribeRepository",
                "codeartifact:GetPackageVersionReadme",
                "codeartifact:GetRepositoryEndpoint",
                "codeartifact:ListPackageVersionAssets",
                "codeartifact:ListPackageVersionDependencies",
                "codeartifact:ListPackageVersions",
                "codeartifact:ListPackages",
                "codeartifact:ReadFromRepository"
            ],
            "Resource": "*"
        }
    ]
}

Solution

  • Later I found this answer: https://stackoverflow.com/a/66365401/2359762

    which says:

    Unfortunately, this doesn't seem to be possible at the time of the writing.

    Also, there is only one Gradle plugin that allows generating the token and we couldn't make it work in the Android project. https://github.com/clarityai-eng/codeartifact-gradle-plugin

    For our specific use-case, we switched to GitHub Packages.