Skip to content

rajasoun/aws-hub

Repository files navigation

Quality Gate StatusCodeQL - Vulnerability AnalysisDependency Review - Vulnerability CheckSecrets ScanGo Build codecov

AWS Cot Hub

Go based cost exploration tool for AWS on multiple accounts

Getting Started

1. Setup

Refer Setup Instructions

2. Start the Server

  1. In Visual Studio Code, Click the Green Button as shown in the image below and select.

    • Open Folder in Container... command and select the local folder.
    • Click the Green Button
  2. Start the server

    $ go mod tidy
    $ aws-env go run main.go start
  3. In another terminal, query the rest end point

    $ AWS_PROFILE=<profile_name>
    $ http localhost:3000/aws/iam/account 'profile:$AWS_PROFILE'

3. aws-identity from CLI

Get Identity by account - validate setup

$ aws-whoami <aws_profile>

4. AWS Consolidated Bill

For previous month using aws-vault via aws cli

  1. Get Identity by account. Select aws-vault

    $ /workspaces/tools/all_bills.sh
  2. View Bill

    $ column -t -s,  /tmp/reports/aws-cost-hub/aws-cli/bill.csv

Test Driven Development

Server Start - Key Flow

  1. Refer Server Start Flow

  2. In Visual Studio Code devcontainer Terminal, Install Go Packages needed for TDD

    touch .dev
    make install-packages
  3. Running All Tests

    make tdd-unit
    aws-env make tdd-integration
  4. Running Package Level Tests

    gotestsum --format testname -- -coverprofile=coverage/coverage.out github.com/rajasoun/aws-hub/app/...