[AWS] SageMaker에서 boto3를 이용해 S3 csv 파일 읽기/쓰기
boto3는 python용 AWS SDK(Software Development Kit)로 python에서 Amazon S3, EC2와 같은 서비스를 활용할 수 있도록 지원하는 패키지이다. 여기서는 AWS SageMaker 환경에서 python 코드를 작성하는 경우 boto3를 활용해 S3로부터 데이터를 업로드/다운로드 없이 바로 읽고 쓰는 방법에 대해 소개하고자 한다. 1. AWS credential 설정 먼저 S3에 접근하기 위해 AWS Access Key 정보가 필요하다. (access key, secret key) 해당 정보는 직접 입력하거나 설정 파일에서 ConfigParser를 이용해 읽어 올 수 있다. (1) config.ini 파일 생성 [aws_credentials] access_key =..
2022.06.16