AWSCurl
AWSCurl is a command-line tool and Python module that provides a curl-like interface for making authenticated requests to AWS APIs. It simplifies interaction with AWS services by automatically handling AWS Signature Version 4 request signing, credential lookup, and header construction. The library supports all AWS services that utilize SigV4, including S3, CloudFront, and Lambda. Currently at version 0.39, it maintains an active release cadence with multiple updates throughout the year to introduce features and address bugs.
Warnings
- gotcha Credential precedence can be confusing: Command-line arguments override environment variables, which in turn override values from `~/.aws/credentials` or `~/.aws/config` profiles.
- gotcha Complex query strings, particularly for Prometheus APIs with PromQL filters (e.g., `query={key="value"}`), may require manual URL encoding of the query string before passing it to `awscurl` to avoid `InvalidQueryStringException` errors.
- breaking Early versions (around v0.19) had issues with Python 3's byte/string handling, leading to unparsable JSON output (prefixed with `b'`).
- gotcha Using `brew install awscurl` on macOS can sometimes lead to conflicts with existing Python installations or break the AWS CLI due to dependency version mismatches.
- gotcha Before v0.34, if using AWS SSO or complex AWS CLI profiles, `botocore` might not have been automatically installed or loaded, leading to `botocore package could not be loaded` errors.
Install
-
pip install awscurl
Quickstart
# Set AWS credentials as environment variables (or configure ~/.aws/credentials) # export AWS_ACCESS_KEY_ID="your_access_key" # export AWS_SECRET_ACCESS_KEY="your_secret_key" # export AWS_DEFAULT_REGION="us-east-1" # Example: List S3 bucket content awscurl --service s3 'https://your-bucket-name.s3.amazonaws.com/'