Skip to main content

Curl like tool with AWS request signing

Project description

# awscurl [![Build Status](https://travis-ci.org/okigan/awscurl.svg?branch=master)](https://travis-ci.org/okigan/awscurl)

Curl like tool with AWS Signature Version 4 request signing.


## Overview
Requests to AWS API must be signed (see [Signing AWS API Requests](http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html))
automates the process of signing and allows to make requests to AWS as simple as standard curl command.


## Installation
```sh
$ pip install awscurl
```

#### Installation from source (bleeding edge)
```sh
$ pip install git+https://github.com/okigan/awscurl
```

#### Installation via Docker
Assumes Docker is installed and the working directory is project root of the cloned repo. Result will be an image named `$USER/awscurl`.

```sh
$ docker build --rm -t $USER/awscurl .
```

On OS X run via a shell script in your $PATH or directly with something like the following:

```sh
#!/bin/bash

export AWS_DIR="${AWS_DIR:-$HOME/.aws}"
mkdir -p $AWS_DIR

docker run --rm -it -v "$AWS_DIR:/root/.aws" "$USER/awscurl:latest" "$@"
```

## Examples
* Call S3:
List bucket content
```sh
$ awscurl --service s3 https://awscurl-sample-bucket.s3.amazonaws.com
```

* Call EC2:
```sh
$ awscurl --service ec2 'https://ec2.amazonaws.com?Action=DescribeRegions&Version=2013-10-15'
```

* Call API Gateway:
```sh
$ awscurl --service execute-api -X POST -d @request.json \
https://<prefix>.execute-api.us-east-1.amazonaws.com/<resource>
```

## Options
```
usage: awscurl [-h] [-v] [-X REQUEST] [-d DATA] [-H HEADER]
[--region REGION] [--service SERVICE]
[--profile AWS_PROFILE]
[--access_key ACCESS_KEY] [--secret_key SECRET_KEY]
[--security_token SECURITY_TOKEN]
uri

Curl AWS request signing If an arg is specified in more than one place, then
command-line values override environment variables which override defaults.

positional arguments:
uri

optional arguments:
-h, --help show this help message and exit
-v, --verbose verbose flag (default: False)
-X REQUEST, --request REQUEST
Specify request command to use (default: GET)
-d DATA, --data DATA HTTP POST data (default: )
-H HEADER, --header HEADER
HTTP POST data (default: None)
--region REGION AWS region (default: us-east-1)
--profile PROFILE [env var: AWS_PROFILE] (default: default)
--service SERVICE AWS service (default: execute-api)
--access_key ACCESS_KEY
[env var: AWS_ACCESS_KEY_ID] (default: None)
--secret_key SECRET_KEY
[env var: AWS_SECRET_ACCESS_KEY] (default: None)
--security_token SECURITY_TOKEN
[env var: AWS_SECURITY_TOKEN] (default: None)

```

If you do not specify the `--access_key` or `--secret_key`
(or environment variables), `awscurl` will attempt to use
the credentials you set in `~/.aws/credentials`. If you
do not specify a `--profile` or `AWS_PROFILE`, `awscurl`
uses `default`.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awscurl-0.14.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file awscurl-0.14.tar.gz.

File metadata

  • Download URL: awscurl-0.14.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for awscurl-0.14.tar.gz
Algorithm Hash digest
SHA256 8ce97a7b4fe448080ecbfd46290b2ec270d008c6526fc3c0e251f6135cd43bf8
MD5 8957be3f17599fe5b365c05a906589ed
BLAKE2b-256 0fc382ffdac5671b1f89f369c0c33aebd4122df3f4ab3c11c802bab41c2edb37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page