GithubHelp home page GithubHelp logo

telegrapher / awscurl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from okigan/awscurl

0.0 2.0 0.0 71 KB

Curl like simplicity to access AWS resources with AWS Signature Version 4 request signing.

Dockerfile 1.27% Python 98.57% Shell 0.15%

awscurl's Introduction

awscurl Build Status

Curl like tool with AWS Signature Version 4 request signing.

Overview

Requests to AWS API must be signed (see Signing AWS API Requests) automates the process of signing and allows to make requests to AWS as simple as standard curl command.

Installation

$ pip install awscurl

Installation from source (bleeding edge)

$ 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.

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

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

#!/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

    $ awscurl --service s3 https://awscurl-sample-bucket.s3.amazonaws.com
  • Call EC2:

    $ awscurl --service ec2 'https://ec2.amazonaws.com?Action=DescribeRegions&Version=2013-10-15'
  • Call API Gateway:

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

Options

usage: awscurl [-h] [-v] [-i] [-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)
  -i, --include         include headers in response (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.

awscurl's People

Contributors

ajcrites avatar ajmath avatar bradleyjames avatar gozer avatar iulianmac avatar jmhummel avatar jonathan-cartwright-disney avatar lc0 avatar mariosotil avatar okigan avatar robingolden avatar wigor avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.