All Projects → okigan → Awscurl

okigan / Awscurl

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

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Awscurl

Cognitocurl
🦉🤖Easily sign curl calls to API Gateway with Cognito authorization token.
Stars: ✭ 76 (-78.29%)
Mutual labels:  aws, curl
Laravel Dynamodb
Eloquent syntax for DynamoDB
Stars: ✭ 342 (-2.29%)
Mutual labels:  aws
Mkit
MKIT is a Managed Kubernetes Inspection Tool that validates several common security-related configuration settings of managed Kubernetes cluster objects and the workloads/resources running inside the cluster.
Stars: ✭ 330 (-5.71%)
Mutual labels:  aws
Requests
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.
Stars: ✭ 3,433 (+880.86%)
Mutual labels:  curl
Awsweeper
A tool for cleaning your AWS account
Stars: ✭ 331 (-5.43%)
Mutual labels:  aws
Express
⚡ Take existing Express.js apps and host them easily on cheap, auto-scaling, serverless infrastructure (AWS Lambda and AWS HTTP API).
Stars: ✭ 337 (-3.71%)
Mutual labels:  aws
Aws Amicleaner
Cleanup your old unused ami and related snapshots
Stars: ✭ 327 (-6.57%)
Mutual labels:  aws
Cloud Custodian
Rules engine for cloud security, cost optimization, and governance, DSL in yaml for policies to query, filter, and take actions on resources
Stars: ✭ 3,926 (+1021.71%)
Mutual labels:  aws
Serverless Photo Recognition
A collection of 3 lambda functions that are invoked by Amazon S3 or Amazon API Gateway to analyze uploaded images with Amazon Rekognition and save picture labels to ElasticSearch (written in Kotlin)
Stars: ✭ 345 (-1.43%)
Mutual labels:  aws
Aws Mobile Appsync Events Starter React
GraphQL starter application with Realtime and Offline functionality using AWS AppSync
Stars: ✭ 337 (-3.71%)
Mutual labels:  aws
Aws Inventory
AWS Inventory in a single HTML file using JS AWS-SDK & Bootstrap
Stars: ✭ 336 (-4%)
Mutual labels:  aws
Aws Security Workshops
A collection of the latest AWS Security workshops
Stars: ✭ 332 (-5.14%)
Mutual labels:  aws
Xidel
Command line tool to download and extract data from HTML/XML pages or JSON-APIs, using CSS, XPath 3.0, XQuery 3.0, JSONiq or pattern matching. It can also create new or transformed XML/HTML/JSON documents.
Stars: ✭ 335 (-4.29%)
Mutual labels:  curl
Hammer
Dow Jones Hammer : Protect the cloud with the power of the cloud(AWS)
Stars: ✭ 330 (-5.71%)
Mutual labels:  aws
Terraform Aws Ec2 Instance
Terraform module which creates EC2 instance(s) on AWS
Stars: ✭ 344 (-1.71%)
Mutual labels:  aws
Terraform Aws Security Group
Terraform module which creates EC2-VPC security groups on AWS
Stars: ✭ 326 (-6.86%)
Mutual labels:  aws
S3mock
A simple mock implementation of the AWS S3 API startable as Docker image, JUnit 4 rule, or JUnit Jupiter extension
Stars: ✭ 332 (-5.14%)
Mutual labels:  aws
Lamby
Simple Rails & AWS Lambda Integration 🐑🛤
Stars: ✭ 336 (-4%)
Mutual labels:  aws
Curl
CURL: Contrastive Unsupervised Representation Learning for Sample-Efficient Reinforcement Learning
Stars: ✭ 346 (-1.14%)
Mutual labels:  curl
Rpc Websockets
JSON-RPC 2.0 implementation over WebSockets for Node.js and JavaScript/TypeScript
Stars: ✭ 344 (-1.71%)
Mutual labels:  aws

awscurl Donate

PyPI Build Status Docker Hub

CI badge

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

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 Homebrew for MacOS

$ brew install awscurl

Running via Docker

$ docker pull okigan/awscurl

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

In order to shorten the length of docker commands, you can add the following alias:

$ 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

Examples

  • Call S3: List bucket content

    $ awscurl --service s3 https://awscurl-sample-bucket.s3.amazonaws.com | tidy -xml -iq
    <?xml version="1.0" encoding="utf-8"?>
    <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
      <Name>awscurl-sample-bucket</Name>
      <Prefix></Prefix>
      <Marker></Marker>
      <MaxKeys>1000</MaxKeys>
      <IsTruncated>false</IsTruncated>
      <Contents>
        <Key>awscurl-sample-file.txt</Key>
        <LastModified>2017-07-25T21:27:38.000Z</LastModified>
        <ETag>"d41d8cd98f00b204e9800998ecf8427e"</ETag>
        <Size>0</Size>
        <StorageClass>STANDARD</StorageClass>
      </Contents>
    </ListBucketResult>
    
  • Call EC2:

    $ awscurl --service ec2 'https://ec2.amazonaws.com?Action=DescribeRegions&Version=2013-10-15' | tidy -xml -iq 
    <?xml version="1.0" encoding="utf-8"?>
    <DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2013-10-15/">
    
      <requestId>96511ccd-2d6d-4d63-ad9b-6be6f2c9874d</requestId>
      <regionInfo>
        <item>
          <regionName>eu-north-1</regionName>
          <regionEndpoint>ec2.eu-north-1.amazonaws.com</regionEndpoint>
        </item>
        <item>
          <regionName>ap-south-1</regionName>
          <regionEndpoint>ec2.ap-south-1.amazonaws.com</regionEndpoint>
        </item>
      </regionInfo>
    </DescribeRegionsResponse>
    
  • 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.

Who uses awscurl

Related projects

Last but not least

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].