Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deybhayden/hostess
Boto3 CLI tool to display AWS hosting costs by separated by tags
https://github.com/deybhayden/hostess
asyncio aws boto3 cost-explorer python3
Last synced: about 13 hours ago
JSON representation
Boto3 CLI tool to display AWS hosting costs by separated by tags
- Host: GitHub
- URL: https://github.com/deybhayden/hostess
- Owner: deybhayden
- License: unlicense
- Created: 2020-05-22T22:11:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T16:53:21.000Z (5 months ago)
- Last Synced: 2024-06-18T21:21:47.275Z (5 months ago)
- Topics: asyncio, aws, boto3, cost-explorer, python3
- Language: Python
- Size: 63.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hostess
CLI tool to separate AWS hosting costs by client for a given date range.
## Development
This utility uses [asyncio](https://docs.python.org/3/library/asyncio.html), so Python 3+ is required to run it.
Below is an easy setup using [Pipenv](https://github.com/pypa/pipenv).
```bash
pipenv --python 3.10.2
pipenv install --dev
```:warning: This tool supports Python 3.8+ and up.
### Private Configuration
By default, there is an empty `hostess.config` Python file that contains example config variables and possible values. You can override these defaults by setting the `$HOSTESS_CONFIG` environment variable to the filepath of your own organization's client configuration. Below example uses [direnv](https://direnv.net/) to set per directory environment variables.
```bash
mkdir -p ~/code
cd ~/code
gh repo clone deybhayden/hostess
cd hostess/
# example assumes a Python file is located at ~/.config/hostess/config.py
echo "export AWS_PROFILE=\"my_profile\"\nexport HOSTESS_CONFIG=\"$HOME/.config/hostess/config.py\"" > .envrc
direnv allow
```## Usage
The example below uses [AWS SSO CLI credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html) to federate access to AWS accounts.
```bash
# you'll need awscli v2, your SSO URL & region and to have set that all up correctly
aws configure sso
aws sso login --profile my_profile
pipenv shell
pipenv install -e .
hostess -s 2020-04-01 -e 2020-05-01 -v
# write a month of results to CSV to import into a spreadsheet
hostess -s 2021-07-01 -e 2021-08-01 -f july.csv
```