Skip to content

Commit 0df0889

Browse files
feat(aws-lambda): push a prebuilt image to ECR without Docker (#6063)
* feat(aws-lambda): push a prebuilt image to ECR without Docker Adds pushImageToEcr and ensureEcrRepository to the SDK subpath. The push reads a single-platform OCI image layout, verifies every blob against its descriptor before any ECR call, uploads only the blobs ECR lacks through the layer-upload API, and puts the manifest under a tag, returning the digest-pinned image URI. * fix(aws-lambda): keep the ECR client out of the SDK bundle Like the other AWS SDK clients, @aws-sdk/client-ecr is a dependency the consumer resolves. Bundled into the ESM SDK it hits a dynamic require of node:https and the packed package fails to import. * feat(aws-lambda): build the ECR client from a region like the other SDK calls * build(aws-lambda): add only the ECR client to the lockfile * fix(aws-lambda): adopt an existing ECR repository only when it carries the caller's tags * chore(aws-lambda): raise the size budget for pushing an image to ECR pushImageToEcr ships in dist (unminified chunk plus its .d.ts); no source maps, tests or release-only files are involved. Built dist, npm pack --dry-run, main versus main plus this branch: +2486 B packed, +8846 B unpacked. The merge-group run measured 73369 packed and 266805 unpacked, which are the new budgets (were 70874 and 258166).
1 parent 0255493 commit 0df0889

7 files changed

Lines changed: 635 additions & 2 deletions

File tree

‎bun.lock‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/aws-lambda/build.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const sharedOpts = {
3232
format: "esm",
3333
minify: false,
3434
external: [
35+
"@aws-sdk/client-ecr",
3536
"@aws-sdk/client-lambda",
3637
"@aws-sdk/client-s3",
3738
"@aws-sdk/client-sfn",

‎packages/aws-lambda/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"verify:zip-size": "tsx scripts/verify-zip-size.ts"
7373
},
7474
"dependencies": {
75+
"@aws-sdk/client-ecr": "^3.1146.0",
7576
"@aws-sdk/client-lambda": "^3.1146.0",
7677
"@aws-sdk/client-s3": "^3.1146.0",
7778
"@aws-sdk/client-sfn": "^3.1146.0",

‎packages/aws-lambda/src/sdk/index.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,12 @@ export {
4545
prebuiltVideoImage,
4646
type ReleaseAssetManifest,
4747
} from "./prebuiltHandler.js";
48+
export {
49+
ensureEcrRepository,
50+
type EnsureEcrRepositoryOptions,
51+
type PushedImage,
52+
pushImageToEcr,
53+
type PushImageToEcrOptions,
54+
} from "./pushImageToEcr.js";
4855
export type { SerializableDistributedRenderConfig } from "../events.js";
4956
export type { DistributedFormat } from "../formatExtension.js";

0 commit comments

Comments
 (0)