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

feat: use sdkv3 #47

Merged
merged 5 commits into from
Aug 29, 2024
Merged

feat: use sdkv3 #47

merged 5 commits into from
Aug 29, 2024

Conversation

TheRealAmazonKendra
Copy link
Contributor

This updates usage of the sdk to sdkv3 and begins publishing it on a new major version. For the moment we will publish these as release candidates until we are sure of stability.

process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE = '1';
this.config = {
clientConfig,
credentials: fromNodeProviderChain({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is a big improvement over random env vars


return upload.done();
} catch (e) {
// TODO: add something more useful here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add something here before I remove the release candidate tag. I need to actually test the failure modes in the CLI to figure out what will be useful information here.

lib/aws.ts Outdated Show resolved Hide resolved
lib/aws.ts Outdated Show resolved Hide resolved
return true;
} catch (e: any) {
if (e.code !== 'ImageNotFoundException') {
if (e.name !== 'ImageNotFoundException') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the change from code to name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDK v3 updated the error class as such that code is no longer a field and name is the replacement for it. No idea why they did that ¯_(ツ)_/¯

@@ -130,7 +131,7 @@ export class FileAssetHandler implements IAssetHandler {
paramsEncryption
);

await s3.upload(params).promise();
await this.host.aws.upload(params, {});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make the second parameter optional?

@mergify mergify bot merged commit 22c6d8d into main Aug 29, 2024
7 checks passed
@mergify mergify bot deleted the TheRealAmazonKendra/sdkv3 branch August 29, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants