Skip to content

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

License

Notifications You must be signed in to change notification settings

pyToshka/aws-cli-ec2-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages