2023-01-04[TIL]

jenna·2024년 1월 4일
0

TIL/WIL

목록 보기
50/59

AWS S3 적용하기

aws에서 s3 버킷 생성 후 코드 적용하기

"@aws-sdk/client-s3": "^3.484.0", 이 모듈을 깔면
아래 에러가 난다

TypeError: this.client.send is not a function
    at Upload.__uploadUsingPut

안깔고 없애면 아래 에러가 뜨고

Error: Cannot find module '@aws-sdk/client-s3’

@aws-sdk/client-s3 이 모듈은 지워야 했었고 모듈 버전 호환 문제로 aws-sdk랑 multer-s3랑 버전이 2든 3이든 같아야된다고 해서 yarn add multer-s3@2.10.0 해줌


버킷 이름이나 그 외 키 설정 등이 안 맞으면 생기는 오류

NoSuchBucket: The specified bucket does not exist

aws s3 버킷에서 객체 소유권에 acl활성화 시켜주지 않아서 생기는 오류

AccessControlListNotSupported: The bucket does not allow ACLs
    at Request.extractError 

AWS IAM 설정

IAM 이란 Identity and Access Management의 약자로 , AWS 리소스에 대한 액세스를 안전하게 제어할 수 있는 웹 서비스다.
IAM을 사용하여 리소스를 사용하도록 인증(로그인) 및 권한 부여(권한 있음)된 대상을 제어한다.

참고
https://github.com/anacronw/multer-s3#readme
https://whitemackerel.tistory.com/50

profile
https://github.com/jennaaaaaaaaa

0개의 댓글