파일 업로드
import boto3
s3 = boto3.client('s3')
bucket = '버킷명'
s3.upload_file('original_object', bucket, 'upload_object', ExtraArgs={'ContentType':'image/jpeg'})
# Mime Type 매뉴얼하게 지정하려면, ExtraArgs를 사용
# 디렉토리 경로(test) 지정 : Ex) 'test/' + upload_object
파일 다운로드
import boto3
s3 = boto3.client('s3')
bucket = '버킷명'
s3.downfile_file(bucket, 'original_object', 'download_object')
'AWS Infra' 카테고리의 다른 글
[ AWS ] Python boto3를 이용하여 값 CPUCreditBalance 구하기 (0) | 2023.02.02 |
---|---|
[ AWS ] Python boto3를 이용하여 EC2 CPU 사용율 구하기 (0) | 2023.02.02 |
[ AWS ] Python Boto3를 이용한 CloudFront Invalidation (무효화) (0) | 2023.01.13 |
[ AWS ] S3 특정 확장자 파일만 업로드 하는 버킷정책 (0) | 2023.01.13 |
[ AWS ] Amazon Linux nginx Install (0) | 2022.10.11 |
[ AWS ] boto3를 이용한 보안그룹 소스IP 체크 (0) | 2022.07.11 |
[ AWS ] RDS mysql Slow Query Monitoring ( Cloudwatch ) (0) | 2022.06.29 |
[ AWS ] EventBridge cron expressions (0) | 2022.03.21 |