I can list the files in the source bucket but when I try to download them I am getting "Client error 403" , the source team has server side encryption AES256 enabled.
So when I try :
client.download_fileobj(bucket, file, f, ExtraArgs={"ServerSideEncryption": "AES256"})
I am getting ValueError: Invalid extra_args key 'ServerSideEncryption', must be one of: VersionId, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, RequestPayer
How can I fix this issue?
It should work without mentioning ExtraArgs={"ServerSideEncryption": "AES256"}.
When SSE algorithm is AES256, you don't need to mention that while downloading object, only while uploading it.
While downloading it, you need to make sure that the credentials, you are using to download the object, have access to the key that is used to encrypt the object.
Download files with server side encryption SSE AES256 using boto3