S3 with Python Basic Tutorial
Bucket 만들기 Bucket을 만들어보도록 한다. import boto3 print(boto3.__version__) 1.23.5 bucket = boto3.resource('s3') response = bucket.create_bucket( Bucket = "your_bucket_name", ACL="private", # public-read CreateBucketConfiguration = { 'LocationConstraint' : 'ap-northeast-2' } ) print(response) s3.Bucket(name='your_bucket_name') 버킷 대시보드에서 실제 Bucket이 만들어졌는지 확인한다. Client Bucket 이번에는 client 버킷을 생성한다. client = boto3.client('s3') response = client.create_bucket( Bucket = "your_bucket_name", ACL = "private", CreateBucketConfiguration = { 'LocationConstraint' : 'ap-northeast-2' } ) print(response) {'ResponseMetadata': {'RequestId': '1X0BAXRG653Q7Y61', 'HostId': 'WwKyxNBcd1V9x6D/WZn8twMKSWKBnkwVCPWtvarZvyNSSvqr7Q77J6OFAdWuYAwiv/nQfXoW/0U=', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amz-id-2': 'WwKyxNBcd1V9x6D/WZn8twMKSWKBnkwVCPWtvarZvyNSSvqr7Q77J6OFAdWuYAwiv/nQfXoW/0U=', 'x-amz-request-id': '1X0BAXRG653Q7Y61', 'date': 'Wed, 25 May 2022 03:16:52 GMT', 'location': 'http://your_bucket_name.