Skip to content

AWS.ECRPublic reference

Source: src/AWS/ECRPublic/BatchCheckLayerAvailability.ts

Runtime binding for ecr-public:BatchCheckLayerAvailability.

Checks whether image layers already exist in the bound PublicRepository so a push can skip re-uploading them. Provide the implementation with Effect.provide(AWS.ECRPublic.BatchCheckLayerAvailabilityHttp).

BatchCheckLayerAvailability: Pushing Images

Section titled “BatchCheckLayerAvailability: Pushing Images”
// init
const checkLayers = yield* AWS.ECRPublic.BatchCheckLayerAvailability(repository);
// runtime
const result = yield* checkLayers({ layerDigests: ["sha256:abc..."] });
const missing = (result.failures ?? []).map((f) => f.layerDigest);

Source: src/AWS/ECRPublic/BatchDeleteImage.ts

Runtime binding for ecr-public:BatchDeleteImage.

Deletes images (by tag or digest) from the bound PublicRepository. Per-image failures (e.g. ImageNotFound) are reported in the response’s failures list, not as errors. Provide the implementation with Effect.provide(AWS.ECRPublic.BatchDeleteImageHttp).

// init
const batchDeleteImage = yield* AWS.ECRPublic.BatchDeleteImage(repository);
// runtime
const result = yield* batchDeleteImage({
imageIds: [{ imageTag: "stale" }],
});

Source: src/AWS/ECRPublic/CompleteLayerUpload.ts

Runtime binding for ecr-public:CompleteLayerUpload.

Seals an in-flight layer upload in the bound PublicRepository, validating the uploaded bytes against the provided sha256 digest. Provide the implementation with Effect.provide(AWS.ECRPublic.CompleteLayerUploadHttp).

// init
const completeLayerUpload = yield* AWS.ECRPublic.CompleteLayerUpload(repository);
// runtime
const { layerDigest } = yield* completeLayerUpload({
uploadId,
layerDigests: [digest],
});

Source: src/AWS/ECRPublic/DescribeImages.ts

Runtime binding for ecr-public:DescribeImages.

Lists metadata (digest, tags, size, push time) for the images in the bound PublicRepository. Provide the implementation with Effect.provide(AWS.ECRPublic.DescribeImagesHttp).

// init
const describeImages = yield* AWS.ECRPublic.DescribeImages(repository);
// runtime
const result = yield* describeImages();
const digests = (result.imageDetails ?? []).map((i) => i.imageDigest);

Source: src/AWS/ECRPublic/DescribeImageTags.ts

Runtime binding for ecr-public:DescribeImageTags.

Lists the tag details (tag, digest, push time) for the images in the bound PublicRepository. Provide the implementation with Effect.provide(AWS.ECRPublic.DescribeImageTagsHttp).

// init
const describeImageTags = yield* AWS.ECRPublic.DescribeImageTags(repository);
// runtime
const result = yield* describeImageTags();
const tags = (result.imageTagDetails ?? []).map((t) => t.imageTag);

Source: src/AWS/ECRPublic/DescribeRegistries.ts

Runtime binding for ecr-public:DescribeRegistries.

Reads the account’s public registry details — most usefully the registry aliases that form public pull URIs (public.ecr.aws/<alias>/<repo>). Provide the implementation with Effect.provide(AWS.ECRPublic.DescribeRegistriesHttp).

// init — registry-level binding takes no resource
const describeRegistries = yield* AWS.ECRPublic.DescribeRegistries();
// runtime
const result = yield* describeRegistries();
const alias = result.registries?.[0]?.aliases?.[0]?.name;

Source: src/AWS/ECRPublic/GetAuthorizationToken.ts

Runtime binding for ecr-public:GetAuthorizationToken (plus the sts:GetServiceBearerToken permission the API requires).

Retrieves a registry authorization token (valid for 12 hours) used to authenticate docker push against public.ecr.aws. The token in the response is Redacted — unwrap it with Redacted.value at the point of use. Provide the implementation with Effect.provide(AWS.ECRPublic.GetAuthorizationTokenHttp).

// init — registry-level binding takes no resource
const getAuthorizationToken = yield* AWS.ECRPublic.GetAuthorizationToken();
// runtime
const result = yield* getAuthorizationToken();
const token = result.authorizationData?.authorizationToken; // Redacted<string>

Source: src/AWS/ECRPublic/GetRegistryCatalogData.ts

Runtime binding for ecr-public:GetRegistryCatalogData.

Reads the registry-level catalog metadata (the gallery display name). Provide the implementation with Effect.provide(AWS.ECRPublic.GetRegistryCatalogDataHttp).

// init — registry-level binding takes no resource
const getRegistryCatalogData = yield* AWS.ECRPublic.GetRegistryCatalogData();
// runtime
const result = yield* getRegistryCatalogData();
const displayName = result.registryCatalogData.displayName;

Source: src/AWS/ECRPublic/GetRepositoryCatalogData.ts

Runtime binding for ecr-public:GetRepositoryCatalogData.

Reads the gallery catalog metadata (description, architectures, about / usage markdown) of the bound PublicRepository. Provide the implementation with Effect.provide(AWS.ECRPublic.GetRepositoryCatalogDataHttp).

GetRepositoryCatalogData: Catalog Metadata

Section titled “GetRepositoryCatalogData: Catalog Metadata”
// init
const getCatalogData = yield* AWS.ECRPublic.GetRepositoryCatalogData(repository);
// runtime
const result = yield* getCatalogData();
const description = result.catalogData?.description;

Source: src/AWS/ECRPublic/InitiateLayerUpload.ts

Runtime binding for ecr-public:InitiateLayerUpload.

Starts an image layer upload to the bound PublicRepository, returning the uploadId used by UploadLayerPart and CompleteLayerUpload. Provide the implementation with Effect.provide(AWS.ECRPublic.InitiateLayerUploadHttp).

// init
const initiateLayerUpload = yield* AWS.ECRPublic.InitiateLayerUpload(repository);
// runtime
const { uploadId } = yield* initiateLayerUpload();

Source: src/AWS/ECRPublic/PutImage.ts

Runtime binding for ecr-public:PutImage.

Creates or updates an image manifest in the bound PublicRepository — the final step of an image push after all referenced layers are uploaded (InitiateLayerUploadUploadLayerPartCompleteLayerUpload). Provide the implementation with Effect.provide(AWS.ECRPublic.PutImageHttp).

// init
const putImage = yield* AWS.ECRPublic.PutImage(repository);
// runtime
const result = yield* putImage({
imageManifest: JSON.stringify(manifest),
imageManifestMediaType: "application/vnd.oci.image.manifest.v1+json",
imageTag: "latest",
});

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.

PublicRepository: Creating Public Repositories

Section titled “PublicRepository: Creating Public Repositories”

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"],
},
],
}),
});

Source: src/AWS/ECRPublic/UploadLayerPart.ts

Runtime binding for ecr-public:UploadLayerPart.

Uploads one chunk of an in-flight image layer upload to the bound PublicRepository. Provide the implementation with Effect.provide(AWS.ECRPublic.UploadLayerPartHttp).

// init
const uploadLayerPart = yield* AWS.ECRPublic.UploadLayerPart(repository);
// runtime
yield* uploadLayerPart({
uploadId,
partFirstByte: 0,
partLastByte: blob.byteLength - 1,
layerPartBlob: blob,
});