답변
boto3.resource고수준 서비스 클래스 랩 어라운드 boto3.client입니다.
원래 리소스 ID를 지정하지 않고 나중에 다른 리소스를 사용할 수있는 위치에 연결된 리소스를 연결하기위한 것입니다.
import boto3
s3 = boto3.resource("s3")
bucket = s3.Bucket('mybucket')
# now bucket is "attached" the S3 bucket name "mybucket"
print(bucket)
# s3.Bucket(name='mybucket')
print(dir(bucket))
#show you all class method action you may perform
OTH, boto3.client는 하위 수준이므로 “entry-class 개체”가 없으므로 수행하는 모든 작업에 대해 연결되는 정확한 리소스를 명시 적으로 지정해야합니다.
개인의 필요에 따라 다릅니다. 그러나 boto3.resource모든 boto3.client기능을 래핑하지는 않으므로 가끔을 호출하거나을 boto3.client사용 boto3.resource.meta.client하여 작업을 완료해야합니다.
