'AWS Code for S3 Upload file using embedded-C SDK

I am trying to upload a file to an AWS S3 private bucket using aws-iot-device-sdk-embedded-c, but without success.

First I tried upload a file using python and boto3 upload_file function, this was successful. Now because the embedded-C sdk requires a pre-signed URL's (boto3 doesn't) I have modified the python script not to call upload_file but only print the aws credentials and key to the screen.

Then I take these credentials, put in ~/.aws/credentials and generate a pre-signed URL using the presigned_urls_gen.py script of embedded-C sdk.

When I run the demo I am always getting the error: The AWS Access Key Id you provided does not exist in our records.

When I added some debug I saw that boto3 is doing something completly different then the upload example in embedded-C sdk. The example in embedded-C sdk is not even using sigv4 to sign anything or add security headers to the request.

How come the same upload procedure is so different in embedded-C sdk versus the boto3?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source