Skip to content Skip to sidebar Skip to footer

Aws S3 - Object Has No Attribute 'server_side_encryption'

Can someone please explain the differences in these two calls. The first one gives the correct server_side_encryption and the second one gives an error. The other attributes give t

Solution 1:

As the error you received states, the object you're trying to get the server_side_encryption attribute from is not, in fact, of the type s3.Object, but rather of the type s3.ObjectSummary

Fortunately you can get the object as a sub-resource as specified here

inner = outer.Object() Then query for the property

print(inner.server_side_encryption)

Solution 2:

s3.Object returns Object

bucket.objects returns ObjectSummary

Object has these attributes

[u'Acl', u'Bucket', u'MultipartUpload', u'Version', u'accept_ranges', u'bucket_name', u'cache_control', u'content_disposition', u'content_encoding', u'content_language', u'content_length', u'content_type', 'copy', u'copy_from', u'delete', u'delete_marker', 'download_file', 'download_fileobj', u'e_tag', u'expiration', u'expires', u'get', 'get_available_subresources', u'initiate_multipart_upload', u'key', u'last_modified', 'load', 'meta', u'metadata', u'missing_meta', u'parts_count', u'put', 'reload', u'replication_status', u'request_charged', u'restore', u'restore_object', u'server_side_encryption', u'sse_customer_algorithm', u'sse_customer_key_md5', u'ssekms_key_id', u'storage_class', 'upload_file', 'upload_fileobj', u'version_id', u'wait_until_exists', u'wait_until_not_exists', u'website_redirect_location']

ObjectSummary has these attributes

[u'Acl', u'Bucket', u'MultipartUpload', u'Object', u'Version', u'bucket_name', u'copy_from', u'delete', u'e_tag', u'get', 'get_available_subresources', u'initiate_multipart_upload', u'key', u'last_modified', 'load', 'meta', u'owner', u'put', u'restore_object', u'size', u'storage_class', u'wait_until_exists', u'wait_until_not_exists']

Post a Comment for "Aws S3 - Object Has No Attribute 'server_side_encryption'"