Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/praveen1664/boto-flask-fetch
Search your AWS infrastructure with Boto3 wrapped inside a Flask api with power of Boto3 & Flask .
https://github.com/praveen1664/boto-flask-fetch
aws-infrastructure boto3 flask-api python script
Last synced: 16 days ago
JSON representation
Search your AWS infrastructure with Boto3 wrapped inside a Flask api with power of Boto3 & Flask .
- Host: GitHub
- URL: https://github.com/praveen1664/boto-flask-fetch
- Owner: praveen1664
- Created: 2018-02-22T01:33:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T01:42:18.000Z (almost 7 years ago)
- Last Synced: 2024-11-21T04:10:03.446Z (3 months ago)
- Topics: aws-infrastructure, boto3, flask-api, python, script
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Boto-Flask-Fetch
Search your AWS infrastructure with Boto3 wrapped inside a Flask api
# Boto3 Flask FetchSearch your AWS infrastructure with Boto3 wrapped inside a Flask api.
**Setup**
```virtualenv venvvenv/bin/pip install -r requirements.txt```
**Run**
```venv/bin/python run.py```
**Use**
Try running
``` curl localhost:6000/api/fetch-regions```
to get the following response
```{ "data": [ "ap-south-1", "eu-west-2", "eu-west-1", "ap-northeast-2", "ap-northeast-1", "sa-east-1", "ca-central-1", "ap-southeast-1", "ap-southeast-2", "eu-central-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2" ]}```
## Fetch API
Example: fetch ec2-instance with tags
```curl "localhost:6000/api/fetch?tag:Environment=dev&state=running"```
**URL Params**-
*Search Criteria*
- **state** - aws instance state- **region** - aws-region- **id** - aws instance id- **public-ip** - public ip address of ec2-instance- **private-ip** - private ip address of ec2-instance- **tag:*** - any tag name to match
Tag Examples: - tag:Name=srvX - tag:Environment=dev
*Functions*
- **single-region** - [0 or 1] - if a region is not specified and single-region=1, returns the first instance(s) matching search criteria within a region loop