lestex / aws-cli-ec2-plugin

Simple aws cli plugin for retrieving information about EC2 instances based on tag key

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aws-cli-ec2-plugin

Basic AWS CLI extension for fetching data related to EC2 instances using tag keys.

Installation

From GitHub

python -m pip install git+https://github.com/pyToshka/aws-cli-ec2-plugin.git

Local installation

git clone https://github.com/pyToshka/aws-cli-ec2-plugin.git
cd aws-cli-ec2-plugin
pip install .

Configuration

For enabling the plugin:

aws configure set plugins.ec2info awsec2info    

Options


Options:
  --tag TEXT                                            Tag name  [required]
  --output [json|plain|table]                           Output format for received information
  --attribute [name|type|state|private_ip|public_ip]    Get single attribute
  --region TEXT                                         AWS region name. Default us-east-1

Simple output

Text

aws ec2info --tag Name --region us-west-2

output

------
name: test
type: t3.large
state: stopped
private_ip: 127.0.0.1
public_ip: None
------

Json

aws ec2info --tag Name --output json --region us-west-2 

output

{
        "name": "test",
        "private_ip": "127.0.0.1",
        "public_ip": null,
        "state": "stopped",
        "type": "t3.large"
    }
]

Table

aws ec2info --tag Name --output table --region us-west-2 

output

name      | type      | state   | private_ip    | public_ip     
--------- | --------- | ------- | ------------- | --------------
test      | t3.large  | stopped | 127.0.0.      |   

Enjoy

About

Simple aws cli plugin for retrieving information about EC2 instances based on tag key

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%