Skip to content

Latest commit

 

History

History
110 lines (76 loc) · 2.65 KB

DEVELOPER.md

File metadata and controls

110 lines (76 loc) · 2.65 KB

git-remote-aws

Developer notes

PS: git fetch aws will actually create the files in the local directory (unlike a normal git fetch which doesn't update the local files)

Save into a subdirectory (doesnt work yet)

mkdir ec2DescInst
git worktree add ec2DescInst example_1

Install editable python package

pip install pew
pew new test_gra
# needed? # pip3 install -r requirements.txt
pip3 install -e .

Test

echo "list" | git-remote-aws+ec2 aws /describe-instances # default AWS endpoint
echo "list" | git-remote-aws+ec2 aws http://ec2.us-west-2.amazonaws.com/describe-instances # specific AWS endpoint
echo "list" | git-remote-aws+ec2 aws http://localhost:5000/describe-instances # moto AWS endpoint

echo "list" | git-remote-aws+cloudtrail ctle_ec2Typechanges "/lookup-events?filter=ec2TypeChanges&profile=shadi_none" # cloudtrail

echo "list" | git-remote-aws+ec2 aws /catalog

or more completely

bash test_example.sh

Testing against moto server

pip3 install "moto[server]"
moto_server ec2 -p3000

echo "list" | git-remote-aws+ec2 aws http://localhost:3000/describe-instances

or

git init
git remote add aws aws+ec2::http://localhost:3000/describe-instances
git fetch aws

Also

pytest gitRemoteAws/test_pullEc2.py

References for git remote helpers

Publish to pypi

pip3 install twine
rm -rf build/*
rm -rf dist/*
python3 setup.py sdist bdist_wheel
twine upload dist/*

Got pypi badge from https://badge.fury.io/for/py/git-remote-aws

Install git-remote-aws from gitlab

# over ssh if private repo
pip3 install git+ssh://[email protected]/autofitcloud/[email protected]

# over https if public repo
pip3 install git+https://gitlab.com/autofitcloud/[email protected]

To get AWS EC2 catalog (generates a 23MB file www.ec2instances.info/t0_raw.json)

git remote add ec2_catalog        aws+ec2::/catalog
git fetch ec2_catalog

echo "www.ec2instances.info/t0_raw.json" > .gitignore # useful to avoid checking in a 23MB file