0

I am trying to run multipart copy key API. I have attached IAM role to my instance from where I am running multipart API. This IAM user has all required permissions. But it is giving me this error.

"A client error (SignatureDoesNotMatch) occurred when calling the ListBuckets operation: The request signature we calculated does not match the signature you provided. Check your key and signing method"

It seems like I am using signature v2 with my IAM role and It is not supported in eu-central-1.

Please help me modify IAM role to use signature v4 instated of signature v2 in eu-central-1 region.

Amar Patil
  • 75
  • 2
  • 11
  • If this is the error message, then I don't believe you are diagnosing the problem correctly. Using V2 when V4 is required [results in a different error](http://stackoverflow.com/a/26538266/1695906). Additionally, the signature algorithm is not related to any attribute of the IAM role. We will, in any event, need to see some code you have written, in order to understand what isn't working. – Michael - sqlbot Oct 20 '16 at 09:17
  • @Michael-sqlbot: I am using IAM role with required attributes. While using multi-part in copy_part_from_key() it is giving error as "A client error (SignatureDoesNotMatch) occurred when calling the ListBuckets operation: The request signature we calculated does not match the signature you provided. Check your key and signing method" – Amar Patil Oct 20 '16 at 10:23
  • @Michael-sqlbot I am getting error as "AWS::S3::Errors::InvalidRequest The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256" after using awscli instead of boto api – Amar Patil Oct 24 '16 at 09:31

1 Answers1

0

This is python example of doing list buckets in EU region with V4 signature.

import boto3
import boto3.session
session = boto3.session.Session(region_name='eu-central-1')
s3client = session.client('s3', config= boto3.session.Config(signature_version='s3v4'))
s3client.list_buckets()
omuthu
  • 5,948
  • 1
  • 27
  • 37
  • I am working with boto2 and I am using copy_part_from_key() boto2 function. It is failing with S3ResponseError: S3ResponseError: 403 Forbidden SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method.ASIAJKNVAMBDYWBIUZPAAWS4-HMAC-SHA256 – Amar Patil Nov 09 '16 at 11:17