Skip to content

PublicRepository

Source: src/AWS/ECRPublic/Repository.ts

An Amazon ECR Public repository on the public.ecr.aws registry. Images pushed here are pullable by anyone. ECR Public is a global service hosted only in us-east-1; this resource pins every control-plane call there regardless of the stack region.

Basic Public Repository

const repo = yield* PublicRepository("MyPublicRepo", {});

With Catalog Metadata

const repo = yield* PublicRepository("MyPublicRepo", {
catalogData: {
description: "My awesome container image",
architectures: ["x86-64", "ARM 64"],
operatingSystems: ["Linux"],
aboutText: "# About\nThis image does X.",
usageText: "docker pull public.ecr.aws/...",
},
});
const repo = yield* PublicRepository("MyPublicRepo", {
policyText: JSON.stringify({
Version: "2012-10-17",
Statement: [
{
Sid: "AllowPush",
Effect: "Allow",
Principal: { AWS: "arn:aws:iam::123456789012:root" },
Action: ["ecr-public:BatchCheckLayerAvailability", "ecr-public:PutImage"],
},
],
}),
});