Skip to content

Commit 4143c67

Browse files
author
Teadeveloper
committed
Fist MVP version. Initial version
0 parents  commit 4143c67

25 files changed

+3032
-0
lines changed

.gitignore

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/python
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
4+
5+
#customfiles and folders
6+
examples/
7+
terraform/
8+
.idea/
9+
10+
temporal.txt
11+
test.py
12+
test.sh
13+
test.sh
14+
type_filename.ext
15+
16+
### Python ###
17+
# Byte-compiled / optimized / DLL files
18+
__pycache__/
19+
*.py[cod]
20+
*$py.class
21+
22+
# C extensions
23+
*.so
24+
25+
# Distribution / packaging
26+
.Python
27+
build/
28+
develop-eggs/
29+
dist/
30+
downloads/
31+
eggs/
32+
.eggs/
33+
lib/
34+
lib64/
35+
parts/
36+
sdist/
37+
var/
38+
wheels/
39+
pip-wheel-metadata/
40+
share/python-wheels/
41+
*.egg-info/
42+
.installed.cfg
43+
*.egg
44+
MANIFEST
45+
46+
# PyInstaller
47+
# Usually these files are written by a python script from a template
48+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
49+
*.manifest
50+
*.spec
51+
52+
# Installer logs
53+
pip-log.txt
54+
pip-delete-this-directory.txt
55+
56+
# Unit test / coverage reports
57+
htmlcov/
58+
.tox/
59+
.nox/
60+
.coverage
61+
.coverage.*
62+
.cache
63+
nosetests.xml
64+
coverage.xml
65+
*.cover
66+
*.py,cover
67+
.hypothesis/
68+
.pytest_cache/
69+
pytestdebug.log
70+
71+
# Translations
72+
*.mo
73+
*.pot
74+
75+
# Django stuff:
76+
*.log
77+
local_settings.py
78+
db.sqlite3
79+
db.sqlite3-journal
80+
81+
# Flask stuff:
82+
instance/
83+
.webassets-cache
84+
85+
# Scrapy stuff:
86+
.scrapy
87+
88+
# Sphinx documentation
89+
docs/_build/
90+
doc/_build/
91+
92+
# PyBuilder
93+
target/
94+
95+
# Jupyter Notebook
96+
.ipynb_checkpoints
97+
98+
# IPython
99+
profile_default/
100+
ipython_config.py
101+
102+
# pyenv
103+
.python-version
104+
105+
# pipenv
106+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
107+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
108+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
109+
# install all needed dependencies.
110+
#Pipfile.lock
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
pythonenv*
131+
132+
# Spyder project settings
133+
.spyderproject
134+
.spyproject
135+
136+
# Rope project settings
137+
.ropeproject
138+
139+
# mkdocs documentation
140+
/site
141+
142+
# mypy
143+
.mypy_cache/
144+
.dmypy.json
145+
dmypy.json
146+
147+
# Pyre type checker
148+
.pyre/
149+
150+
# pytype static type analyzer
151+
.pytype/
152+
153+
# profiling data
154+
.prof
155+
156+
# End of https://www.toptal.com/developers/gitignore/api/python
157+
158+
159+
# Created by https://www.toptal.com/developers/gitignore/api/terraform
160+
# Edit at https://www.toptal.com/developers/gitignore?templates=terraform
161+
162+
### Terraform ###
163+
# Local .terraform directories
164+
**/.terraform/*
165+
166+
# .tfstate files
167+
*.tfstate
168+
*.tfstate.*
169+
170+
# Crash log files
171+
crash.log
172+
173+
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
174+
# .tfvars files are managed as part of configuration and so should be included in
175+
# version control.
176+
#
177+
# example.tfvars
178+
179+
# Ignore override files as they are usually used to override resources locally and so
180+
# are not checked in
181+
override.tf
182+
override.tf.json
183+
*_override.tf
184+
*_override.tf.json
185+
186+
# Include override files you do wish to add to version control using negated pattern
187+
# !example_override.tf
188+
189+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
190+
# example: *tfplan*
191+
192+
# End of https://www.toptal.com/developers/gitignore/api/terraform

README.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
[![CodeFactor](https://www.codefactor.io/repository/github/teadeveloper/awscloudexplorer/badge?s=e65ddad85c3e993c6ec4a68e3fe046d32e67e472)](https://www.codefactor.io/repository/github/teadeveloper/awscloudexplorer)
2+
3+
4+
<p align="center">
5+
<img src="images/logo.png" width="750" height="250">
6+
</p>
7+
8+
[![asciicast](https://asciinema.org/a/1IkBGa3DB0xKuhCmWtOjeoYSx.svg)](https://asciinema.org/a/1IkBGa3DB0xKuhCmWtOjeoYSx)
9+
10+
11+
### About The Project & Motivation
12+
13+
Cloud Explorer is a tool for TUI lovers to explore the resources in AWS Cloud using a TUI (terminal user interface) instead a GUI or AWS web console,
14+
Inspired in legacy tools like Norton Commander, who was programming in the 80s or 90s are going to have a TUI experience using the
15+
last technology in cloud.
16+
17+
This the first MVP of Cloud Explorer, a lot of things to be improved, new features etc.. This MVP is stable and you can use in
18+
your daily activities as a SysDev os SysAdmin.
19+
20+
**Main features:**
21+
22+
**TUI:**
23+
24+
* Explore the AWS resources quickly from your terminal in Linux, Mac or Windows (CMD & WLS) using your console accounts or programmatic accounts.
25+
* Get quickly the resource configuration.
26+
* EC2 instances could be exported using customs keys.
27+
* Support filters (if supported by AWS API).
28+
* Export the configuration of a resource to YML. For example, save ec2 instance config to a yml.
29+
* Export all resources VPCs, EC2s, Buckets etc. to YML, Excel, CSV, Markdown, HTML and String.
30+
31+
** AWS Services currently supported: **
32+
33+
- EC2
34+
- VPC
35+
- Subnets
36+
- ACL Network
37+
- Security groups
38+
- Network Interfaces
39+
- Buckets
40+
- EBS
41+
- EFS
42+
- IAM
43+
- Users
44+
- Groups
45+
- Roles
46+
- Policies
47+
48+
* Lambda functions
49+
50+
**Pipeline Integration:**
51+
52+
If cloud explorer runs in some sort of automation (Jenkins, Rundeck, Git Hub actions etc.) there is a command to
53+
export AWS services to a YML,Excel, CSV, Markdown, HTML and String.
54+
55+
56+
<!-- GETTING STARTED -->
57+
## Getting Started
58+
59+
Cloud Explorer is written in Python, and it works in Python 3.x and the current tests are running using Python 3.8.
60+
61+
### Prerequisites
62+
63+
1) Your terminal Width must be **140** otherwise you got this error:
64+
65+
```shell
66+
.NotEnoughSpaceForWidget: Not enough space: max y and x = 58 , 117. Height and Width = 18
67+
```
68+
To fix it, you have to resize your terminal in Linux, OSX or windows using your mouse :unamused:
69+
70+
2) Set your AWS credentials:
71+
72+
```shell
73+
export AWS_ACCESS_KEY_ID="XXXXXXXXX"
74+
export AWS_SECRET_ACCESS_KEY="XXXXXXXXX"
75+
export AWS_SESSION_TOKEN="XXXXXXXXX"
76+
```
77+
78+
### Installation
79+
80+
Using virtual environment:
81+
82+
```shell
83+
# clone the repo
84+
git clone https://github.com/teadeveloper/awscloudexplorer.git
85+
cd awscloudexplorer/
86+
# Create virtual environment
87+
python3 -m venv ./venv && source venv/bin/activate
88+
# Install pre-reqs for
89+
pip install -r requirements.txt
90+
#Run cloud explorer
91+
python cloudexplorer.py
92+
```
93+
<!-- USAGE EXAMPLES -->
94+
## Usage
95+
96+
**Pipeline Mode**
97+
98+
Find the python called exportall.py to export from command line or in a pipeline the AWS services to a file.
99+
100+
1. To export all ec2 instances to a excel file with all keys:
101+
102+
```shell
103+
python exportall.py --ec2_all_keys --filename="ec2_all_keys.csv" --format=0
104+
```
105+
2. To export all ec2 instances to an excel file with basic keys:
106+
```shell
107+
Shellpython exportall.py --ec2ins --filename="ec2.csv" --format=0
108+
```
109+
3. To export all users to CSV:
110+
```shell
111+
python exportall.py --user --filename="users.csv" --format=1
112+
```
113+
114+
4. To export all policies to HTML:
115+
116+
```shell
117+
python exportall.py --policy --filename="policies.csv" --format=4
118+
```
119+
120+
<!-- ROADMAP -->
121+
## Roadmap
122+
123+
Currently, I am working to improve the Python code to optimize it and also:
124+
125+
* Add pytest/testinfra to automatize tests.
126+
* Add test to check the app works fine in several Python versions.
127+
* Support new AWS services.
128+
129+
<!-- CONTRIBUTING -->
130+
## Contributing
131+
132+
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
133+
134+
1. Fork the Project
135+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
136+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
137+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
138+
5. Open a Pull Request
139+
140+
<!-- LICENSE -->
141+
## License
142+
143+
Distributed under Open Source (GPL-3.0)
144+
145+
<h3 align="left">Support:</h3>
146+
<p><a href="https://www.buymeacoffee.com/teadeveloper"> <img align="left" src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" height="50" width="210" alt="teadeveloper" /></a></p><br><br>
147+
148+
149+
## If you like it & Feedback
150+
151+
Feel free to send me an email with your feedback or open an issue. Feature requests are always welcome.
152+
153+
This personal project is open source (GPL-3.0), and I took me (and take me.) some time and efforts to design, to code, to make some researches and to test it in my personal AWS account.
154+
155+
Please consider supporting it by buying me a tea or a coffee , so I can dedicate more time on it and add more new features.
156+
157+
<!-- CONTACT -->
158+
## Contact
159+
160+
Teadeveloper
161+
162+
163+
164+

SUMMARY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Table of contents
2+
3+
* [Initial page](README.md)
4+
* [handbook](handbook.md)
5+

changeme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
,ImageId,AmiLaunchIndex,InstanceId,InstanceType,LaunchTime,PrivateDnsName,PrivateIpAddress,PublicDnsName,PublicIpAddress,StateTransitionReason,SubnetId,VpcId,Architecture,ClientToken,EbsOptimized,EnaSupport,Hypervisor,RootDeviceName,RootDeviceType,SourceDestCheck
2+
0,ami-04169656fea786776,0,i-044dfd4dd3a3fbc50,t2.nano,2021-04-26 10:04:13+00:00,ip-172-31-47-175.ec2.internal,172.31.47.175,ec2-18-207-192-183.compute-1.amazonaws.com,18.207.192.183,,subnet-0ded9e1e3e82a9862,vpc-0f6a62bb9ffd97303,x86_64,2E0F3809-F931-48FD-831D-70C9ED559D40,False,True,xen,/dev/sda1,ebs,True
3+
1,ami-04169656fea786776,0,i-044459fdd755e8964,t2.nano,2021-04-26 10:04:13+00:00,ip-172-31-34-229.ec2.internal,172.31.34.229,ec2-3-88-18-186.compute-1.amazonaws.com,3.88.18.186,,subnet-0ded9e1e3e82a9862,vpc-0f6a62bb9ffd97303,x86_64,9C5C3994-1F6A-4F1A-8F32-EFE4078508A8,False,True,xen,/dev/sda1,ebs,True

cloudexplorer.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/python
2+
import npyscreen
3+
from forms import aws_form
4+
5+
import curses
6+
7+
8+
class App(npyscreen.NPSAppManaged):
9+
10+
keypress_timeout_default = 1
11+
12+
def onStart(self):
13+
self.CloudForm = self.addForm(
14+
'MAIN', aws_form.AwsMeanForm, name="AWS Cloud Explorer")
15+
16+
17+
if (__name__ == "__main__"):
18+
19+
CloudExplorer = App().run()
20+
21+
22+

0 commit comments

Comments
 (0)