Acquia makes available the
s3cmd command line utility to manage Amazon S3 buckets. If you encounter either of these errors using the
s3cmd --configure command:
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.
These steps are the workaround:
- Create an IAM user in your S3 console, or visit the permissions for an existing IAM user.
- Make sure the IAM user has the permissions to do things you want the `s3cmd` to do. For example, `ListAllMyBuckets` is required for `s3cmd ls`.
- In the IAM user's "Security credentials" tab, create a new Access Key ID. You can only have two access keys for one user. If you need more keys, create another IAM user.
- Create Environment Variables for the ID and key. Use
AWS_ACCESS_KEY_IDas the label for the access key ID, and
AWS_SECRET_ACCESS_KEYfor the secret access key. The variables will be available to you in your Drupal application and via SSH, i.e.
s3cmd(in new shell after you create the environment variables).
Once you've followed the above steps, try it out:
s3cmd ls will list all of your buckets. Run
s3cmd --help to list all the commands possible. Note that you will be interacting with buckets outside of Acquia's control, so our support will be limited to getting the
s3cmd running. It you get stuck with any of the above items, file a support ticket with us.