All Projects → guardian → Athena Cli

guardian / Athena Cli

Licence: apache-2.0
Presto-like CLI tool for AWS Athena

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Athena Cli

Aws Shell
An integrated shell for working with the AWS CLI.
Stars: ✭ 6,359 (+7381.18%)
Mutual labels:  aws, aws-cli
Panther
Detect threats with log data and improve cloud security posture
Stars: ✭ 885 (+941.18%)
Mutual labels:  aws, bigdata
Bash My Aws
Bash-my-AWS provides simple but powerful CLI commands for managing AWS resources
Stars: ✭ 782 (+820%)
Mutual labels:  aws, aws-cli
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+5648.24%)
Mutual labels:  aws, aws-cli
Holepunch
Punch holes in your AWS security groups.
Stars: ✭ 66 (-22.35%)
Mutual labels:  command-line-tool, aws
Awless
A Mighty CLI for AWS
Stars: ✭ 4,821 (+5571.76%)
Mutual labels:  aws, aws-cli
Ecsctl
Command-line tool for managing AWS Elastic Container Service and Projects to run on it.
Stars: ✭ 15 (-82.35%)
Mutual labels:  command-line-tool, aws
Aws Demos
A hands on repo with multiple demonstrations on AWS 🎓
Stars: ✭ 324 (+281.18%)
Mutual labels:  aws, aws-cli
Awsrun
CLI and library to execute commands over one or more AWS accounts concurrently.
Stars: ✭ 53 (-37.65%)
Mutual labels:  aws, aws-cli
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-68.24%)
Mutual labels:  aws, aws-cli
Perun
A command-line validation tool for AWS Cloud Formation that allows to conquer the cloud faster!
Stars: ✭ 82 (-3.53%)
Mutual labels:  aws, aws-cli
Awsconsolerecorder
Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.
Stars: ✭ 1,152 (+1255.29%)
Mutual labels:  aws, aws-cli
Aws Security Viz
Visualize your aws security groups.
Stars: ✭ 511 (+501.18%)
Mutual labels:  aws, aws-cli
Ecs Deploy
Powerful CLI tool to simplify Amazon ECS deployments, rollbacks & scaling
Stars: ✭ 541 (+536.47%)
Mutual labels:  aws, aws-cli
Aws
A collection of bash shell scripts for automating various tasks with Amazon Web Services using the AWS CLI and jq.
Stars: ✭ 493 (+480%)
Mutual labels:  aws, aws-cli
Homebrew Aws Session Manager Plugin
Install the AWS session manager plugin with Homebrew
Stars: ✭ 27 (-68.24%)
Mutual labels:  aws, aws-cli
Cloudiscovery
The tool to help you discover resources in the cloud environment
Stars: ✭ 298 (+250.59%)
Mutual labels:  aws, aws-cli
Prowler
Prowler is a security tool to perform AWS security best practices assessments, audits, incident response, continuous monitoring, hardening and forensics readiness. It contains more than 200 controls covering CIS, ISO27001, GDPR, HIPAA, SOC2, ENS and other security frameworks.
Stars: ✭ 4,561 (+5265.88%)
Mutual labels:  aws, aws-cli
Aws Auto Terminate Idle Emr
AWS Auto Terminate Idle AWS EMR Clusters Framework is an AWS based solution using AWS CloudWatch and AWS Lambda using a Python script that is using Boto3 to terminate AWS EMR clusters that have been idle for a specified period of time.
Stars: ✭ 21 (-75.29%)
Mutual labels:  aws, bigdata
Limes
Limes provides an easy work flow with MFA protected access keys, temporary credentials and access to multiple roles/accounts.
Stars: ✭ 67 (-21.18%)
Mutual labels:  aws, aws-cli

Athena CLI

Build Status

Presto-like CLI tool for AWS Athena. The alternative is using the AWS CLI Athena sub-commands.

asciicast

Requirements

A recent version of the aws CLI must be available on the PATH.

Installation

To install using pip run:

$ pip install athena-cli

Or, clone the GitHub repo and run:

$ python setup.py install

Configuration

Only required configuration is AWS credentials.

Usage

$ athena --help
usage: athena [--debug] [--execute <statement>] [--output-format <format>] [--schema <schema>]
              [--profile <profile>] [--region <region>] [--s3-bucket <bucket>]
              [--server-side-encryption] [--version]

Athena interactive console

optional arguments:
  -h, --help            show this help message and exit
  --debug               enable debug mode
  --execute STATEMENT   execute statement in batch mode
  --output-format FORMAT
                        output format for batch mode [ALIGNED, VERTICAL, CSV,
                        TSV, CSV_HEADER, TSV_HEADER, NULL]
  --schema SCHEMA, --database SCHEMA, --db SCHEMA
                        default schema
  --profile PROFILE     AWS profile
  --region REGION       AWS region
  --s3-bucket BUCKET, --bucket BUCKET
                        AWS S3 bucket for query results
  --server-side-encryption, --encryption
                        Use server-side-encryption for query results
  --version             show version info and exit
athena> help

Supported commands:
QUIT
SELECT
ALTER DATABASE <schema>
ALTER TABLE <table>
CREATE DATABASE <schema>
CREATE TABLE <table>
DESCRIBE <table>
DROP DATABASE <schema>
DROP TABLE <table>
MSCK REPAIR TABLE <table>
SHOW COLUMNS FROM <table>
SHOW CREATE TABLE <table>
SHOW DATABASES [LIKE <pattern>]
SHOW PARTITIONS <table>
SHOW TABLES [IN <schema>] [<pattern>]
SHOW TBLPROPERTIES <table>
USE [<catalog>.]<schema>
VALUES row [, ...]

See http://docs.aws.amazon.com/athena/latest/ug/language-reference.html

Example

athena> use sampledb;
athena:sampledb> show tables;
 tab_name
------------
 elb_logs
(1 rows)

Query deb156b5-293e-472d-8897-5ee195b06b11, SUCCEEDED
https://eu-west-1.console.aws.amazon.com/athena/home?force&region=eu-west-1#query/history/deb156b5-293e-472d-8897-5ee195b06b11
Time: 0:00:00, CPU Time: 474ms total, Data Scanned: 0.00B, Cost: $0.00

Troubleshooting

Use the --debug option when launching the athena CLI to get AWS debug output:

$ athena --debug
2017-07-21 10:10:45,477 botocore.credentials [DEBUG] Looking for credentials via: env
2017-07-21 10:10:45,478 botocore.credentials [DEBUG] Looking for credentials via: assume-role
2017-07-21 10:10:45,478 botocore.credentials [DEBUG] Looking for credentials via: shared-credentials-file
2017-07-21 10:10:45,479 botocore.credentials [INFO] Found credentials in shared credentials file: ~/.aws/credentials
...

Turn on debug at the athena> prompt by typing:

athena> set debug true
debug - was: False
now: True

The below error means the version of aws CLI is not recent enough. Upgrade to version 1.10.18 or higher:

Command 'aws sts get-caller-identity --output text --query 'Account' --profile default' returned non-zero exit status 2

Command history is written to ~/.athena_history.

References

License

Athena CLI
Copyright 2017-2018 Guardian News & Media

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].