Skip to content

Commit

Permalink
Markdown cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
okigan authored Apr 13, 2022
1 parent 6853732 commit b4d4807
Showing 1 changed file with 60 additions and 44 deletions.
104 changes: 60 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,81 @@
# awscurl [![Donate](https://img.shields.io/badge/donate-github-orange.svg?style=flat-square)](https://github.com/sponsors/okigan) [![Donate](https://img.shields.io/badge/donate-paypal-orange.svg?style=flat-square)](https://www.paypal.com/donate/?business=UDN4FL55J34QC&amount=25) [![Donate](https://img.shields.io/badge/donate-buy_me_a_coffee-orange.svg?style=flat-square)](https://www.buymeacoffee.com/okigan)
# awscurl [![Donate](https://img.shields.io/badge/donate-github-orange.svg?style=flat-square)](https://github.com/sponsors/okigan) [![Donate](https://img.shields.io/badge/donate-paypal-orange.svg?style=flat-square)](https://www.paypal.com/donate/?business=UDN4FL55J34QC&amount=25) [![Donate](https://img.shields.io/badge/donate-buy_me_a_coffee-orange.svg?style=flat-square)](https://www.buymeacoffee.com/okigan)

[![PyPI](https://img.shields.io/pypi/v/awscurl.svg)](https://pypi.python.org/pypi/awscurl)
[![Build Status](https://travis-ci.org/okigan/awscurl.svg?branch=master)](https://travis-ci.org/okigan/awscurl)
[![Docker Hub](https://img.shields.io/docker/pulls/okigan/awscurl.svg)](https://hub.docker.com/r/okigan/awscurl)
![CI badge](https://github.com/okigan/awscurl/workflows/CI/badge.svg?branch=master)
![CI badge](https://github.com/okigan/awscurl/workflows/CI/badge.svg?branch=master)

[![Edit with gitpod](https://img.shields.io/badge/edit--with-gitpod-blue.svg?style=flat-square)](https://gitpod.io/#https://github.com/okigan/awscurl)
[![Edit with vscode](https://img.shields.io/badge/edit--with-vscode-blue.svg?style=flat-square)](https://vscode.dev/github/okigan/awscurl)
[![Edit with github codespaces](https://img.shields.io/badge/edit--with-codespaces-blue.svg?style=flat-square)](https://github.dev/okigan/awscurl)


curl-like tool with AWS Signature Version 4 request signing.

## Features
* performes requests to AWS services with requests signing using curl interface
* supports IAM profile credentials

* performes requests to AWS services with requests signing using curl interface
* supports IAM profile credentials

## 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
```

```sh
pip install awscurl
```

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

#### Installation via Homebrew for MacOS
```sh
$ brew install awscurl
```
```sh
pip install git+https://github.com/okigan/awscurl
```

### Installation via Homebrew for MacOS

```sh
brew install awscurl
```

#### Running via Docker
```sh
$ docker pull okigan/awscurl # or via docker pull ghcr.io/okigan/awscurl
```

```sh
docker pull okigan/awscurl # or via docker pull ghcr.io/okigan/awscurl
```

or via Github docker registry
```sh
$ docker pull ghcr.io/okigan/awscurl
```

```sh
docker pull ghcr.io/okigan/awscurl
```

then

```sh
$ docker run --rm -it okigan/awscurl --access_key ACCESS_KEY --secret_key SECRET_KEY --service s3 s3://...

# or allow access to local credentials as following
$ docker run --rm -it -v "$HOME/.aws:/root/.aws" okigan/awscurl --service s3 s3://...
```

To shorten the length of docker commands use the following alias:

```sh
alias awscurl='docker run --rm -ti -v "$HOME/.aws:/root/.aws" -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SECURITY_TOKEN -e AWS_PROFILE okigan/awscurl'
```
$ alias awscurl='docker run --rm -ti -v "$HOME/.aws:/root/.aws" -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SECURITY_TOKEN -e AWS_PROFILE okigan/awscurl'
```

This will allow you to run the awscurl from within a Docker container as if it was installed on the host system:
```
$ awscurl

```sh
awscurl
```

## Examples
* Call S3:
List bucket content

* Call S3: List bucket content

```sh
$ awscurl --service s3 https://awscurl-sample-bucket.s3.amazonaws.com | tidy -xml -iq
<?xml version="1.0" encoding="utf-8"?>
Expand All @@ -85,6 +96,7 @@ automates the process of signing and allows to make requests to AWS as simple as
```

* Call EC2:

```sh
$ awscurl --service ec2 'https://ec2.amazonaws.com?Action=DescribeRegions&Version=2013-10-15' | tidy -xml -iq
<?xml version="1.0" encoding="utf-8"?>
Expand All @@ -105,13 +117,15 @@ automates the process of signing and allows to make requests to AWS as simple as
```

* Call API Gateway:

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

## Options
```

```sh
usage: awscurl [-h] [-v] [-i] [-X REQUEST] [-d DATA] [-H HEADER]
[--region REGION] [--service SERVICE]
[--profile AWS_PROFILE]
Expand Down Expand Up @@ -152,22 +166,24 @@ the credentials you set in `~/.aws/credentials`. If you
do not specify a `--profile` or `AWS_PROFILE`, `awscurl`
uses `default`.


## Who uses awscurl
* [AWS Documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html)
* [Onica blog](https://onica.com/blog/how-to/how-to-kibana-default-index-pattern/)
* QnA on [StackOverflow](https://stackoverflow.com/search?q=awscurl)
* QnA on [DevOps StackExchange](https://devops.stackexchange.com/search?q=awscurl)
* Examples on [Golfbert](https://golfbert.com/api/samples)

* [AWS Documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html)
* [Onica blog](https://onica.com/blog/how-to/how-to-kibana-default-index-pattern/)
* QnA on [StackOverflow](https://stackoverflow.com/search?q=awscurl)
* QnA on [DevOps StackExchange](https://devops.stackexchange.com/search?q=awscurl)
* Examples on [Golfbert](https://golfbert.com/api/samples)

## Related projects
* awscurl in Go:
* https://github.com/allthings/awscurl
* https://github.com/legal90/awscurl
* awscurl in Lisp: https://github.com/aw/picolisp-awscurl
* awscurl on DockerHub: https://hub.docker.com/r/okigan/awscurl
* [aws-signature-proxy](https://github.com/sverch/aws-signature-proxy) and related [blog post](https://shaunverch.com/butter/open-source/2019/09/27/butter-days-6.html)
* [aws-sigv4-proxy](https://github.com/awslabs/aws-sigv4-proxy) on awslabs

* awscurl in Go:
* <https://github.com/allthings/awscurl>
* <https://github.com/legal90/awscurl>
* awscurl in Lisp: <https://github.com/aw/picolisp-awscurl>
* awscurl on DockerHub: <https://hub.docker.com/r/okigan/awscurl>
* [aws-signature-proxy](https://github.com/sverch/aws-signature-proxy) and related [blog post](https://shaunverch.com/butter/open-source/2019/09/27/butter-days-6.html)
* [aws-sigv4-proxy](https://github.com/awslabs/aws-sigv4-proxy) on awslabs

## Last but not least
* [Sponsor awscurl](https://github.com/sponsors/okigan)

* [Sponsor awscurl](https://github.com/sponsors/okigan)

0 comments on commit b4d4807

Please sign in to comment.