Acquia provides the s3cmd command line utility to manage Amazon S3 Buckets.
If you encounter either of these errors while using the s3cmd --configure command, follow the provided workaround:
ERROR: Test failed: 400 (InvalidToken): The provided token is malformed or otherwise invalid.ERROR: Test failed: 403 (SignatureDoesNotMatch): The request signature we calculated does not match the signature you provided. Check your key and signing method.Workaround:
Ensure that the IAM user has the permissions to do things you want the `s3cmd` to do.
For example, ListAllMyBuckets is required for s3cmd ls.
From the Security credentials tab of the IAM user, create a new Access Key ID.
One user can only have two access keys. If you need more keys, create another IAM user.
Create Environment Variables for the ID and key. Use AWS_ACCESS_KEY_ID as the label for the access key ID, and AWS_SECRET_ACCESS_KEY for the secret access key.
The variables will be available to you in your Drupal application and through SSH, which is s3cmd in new shell after you create the environment variables.
After you follow these steps, try it out: s3cmd ls will list all of your buckets. You can also run s3cmd --help to list all the commands possible.
s3cmd executable on the platform is provided as a courtesy. If it is outdated or has issues, you can seek alternative methods to interact with your S3 Buckets.For additional information, visit https://s3tools.org/s3cmd-howto.