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

#322 AWS-SDK V3으로 마이그레이션 #323

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

cokia
Copy link
Contributor

@cokia cokia commented Aug 15, 2023

Summary

It closes #322

매번 실행할때마다 Deprecated 경고가 뜨는 AWS-SDK의 버전을 v2에서 v3으로 마이그레이션 수행함.

@cokia cokia marked this pull request as draft August 15, 2023 08:46
@cokia cokia marked this pull request as ready for review November 2, 2023 11:47
Comment on lines 5 to 6
const {getSignedUrl} = require("@aws-sdk/s3-request-presigner")
const {PutObjectCommand,S3} = require("@aws-sdk/client-s3")
Copy link
Member

Choose a reason for hiding this comment

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

지난번에 말씀해주신 것처럼, prettier가 동작하지 않은 것 같아요!

  • 오 이번에 CI 단계에 prettier 검사를 넣어볼까요?
Suggested change
const {getSignedUrl} = require("@aws-sdk/s3-request-presigner")
const {PutObjectCommand,S3} = require("@aws-sdk/client-s3")
const { getSignedUrl } = require("@aws-sdk/s3-request-presigner");
const { PutObjectCommand, S3 } = require("@aws-sdk/client-s3");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오 너무좋아요..! 아니면 git hook으로 하나 걸어놔도 괜찮을 것 같아요!

Copy link
Member

@withSang withSang left a comment

Choose a reason for hiding this comment

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

우왕 최종 이미지 용량도 줄어들었겠군요... AWS 사용하는 코드들 모두 확인하시고 변경하시느라 고생 많으셨습니다!

@withSang
Copy link
Member

withSang commented Nov 2, 2023

유닛 테스트는 왜 깨졌을까요.. 😢

@cokia cokia marked this pull request as draft November 2, 2023 12:05
@chlehdwon
Copy link
Contributor

chlehdwon commented Nov 3, 2023

유닛 테스트는 왜 깨졌을까요.. 😢

뭔가 install 문제로 저 부분 실행이 안되는 것 같네요...
image

@cokia
Copy link
Contributor Author

cokia commented Nov 16, 2023

본 작업은 프론트엔드에서 작업도 병행되어야 합니다~
이 부분 관련해서는 금일 (11/16) 회의때 말씀드리겠습니다!

  • 제 PC 프리티어가 많이 꼬여서.. 프리티어가 적용이 잘 안됩니다 ㅜㅜ 혹여 가능하신분 계신다면 그대로 풀해서 프리티어 적용해서 다시 올려주시면 대단히 감사드리겠습니다..!

@chlehdwon
Copy link
Contributor

chlehdwon commented Nov 21, 2023

꼬인 아픔 제가 잘 알기에 적용 완료 후 올려드립니다
제가 예전에 작성한 코드들인데 마이그레이션 해주셔서 감사합니다 :)

src/services/users.js Outdated Show resolved Hide resolved
@xMHW xMHW marked this pull request as ready for review March 12, 2024 17:03
@xMHW
Copy link

xMHW commented Mar 12, 2024

aws.js에 있던

try {
    const presignedUrl = await getSignedUrl(
      s3,
      new PutObjectCommand({
        Bucket: awsEnv.s3BucketName,
        Key: filePath,
        contentType: contentType,
      }),
      {
        expiresIn: 60,
      }
    );
    return presignedUrl;
  } catch (e) {
    return e;
  }

에서 에러 Catch하여 반환하는 Try Catch문을 제거하였습니다. 에러 나는 것을 굳이 잡아서 반환값으로 돌려주는 것 보다는, 에러를 Throw하는 Behavior를 그대로 가져가고, Caller가 이에 대한 책임을 지는 것이 맞는 부분이라고 생각이 듭니다.
@cokia

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.

AWS-SDK V3으로 마이그레이션
5 participants