Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use S3 Upload function instead of PutObjectCommand #218

Merged
merged 3 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
devDeps: [
'@aws-crypto/sha256-js',
'@aws-sdk/client-s3',
'@aws-sdk/lib-storage',
'@mrgrain/jsii-struct-builder',
'@smithy/signature-v4',
'@types/adm-zip',
Expand Down
3 changes: 2 additions & 1 deletion package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/lambdas/nextjs-bucket-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
type PutObjectCommandInput,
S3Client,
} from '@aws-sdk/client-s3';
import { Upload } from '@aws-sdk/lib-storage';
import type { CloudFormationCustomResourceHandler } from 'aws-lambda';
import type * as JSZipType from 'jszip';
// @ts-ignore jsii doesn't support esModuleInterop
Expand Down Expand Up @@ -292,7 +293,7 @@ async function uploadObjects({
};
});

await Promise.all(putObjectInputs.map((input) => s3.send(new PutObjectCommand(input))));
await Promise.all(putObjectInputs.map((params) => new Upload({ client: s3, params }).done()));
}
}

Expand Down
Loading
Loading