mirror of
https://github.com/ghndrx/argus.git
synced 2026-02-10 06:45:04 +00:00
Argus is an all-seeing eye on your AWS costs: - Scan for optimization opportunities (unused resources, oversized instances) - Evaluate Terraform plans for cost impact - Generate weekly/monthly cost reports - Integrate with Atlantis for pre-apply cost analysis Components: - CLI tool (argus scan/evaluate/report) - GitHub Action for CI/CD integration - AWS Scanner for resource analysis - AI engine for intelligent recommendations Features: - Unused EBS volumes, idle EC2, oversized RDS - Cost delta on Terraform changes - Atlantis integration - Slack/email notifications
139 lines
3.7 KiB
YAML
139 lines
3.7 KiB
YAML
name: 'Argus FinOps'
|
|
description: 'AI-powered cost analysis for AWS infrastructure'
|
|
author: 'ghndrx'
|
|
|
|
branding:
|
|
icon: 'dollar-sign'
|
|
color: 'green'
|
|
|
|
inputs:
|
|
mode:
|
|
description: 'Operation mode: scan, evaluate, or report'
|
|
required: true
|
|
default: 'evaluate'
|
|
|
|
plan-file:
|
|
description: 'Terraform plan file (for evaluate mode)'
|
|
required: false
|
|
|
|
regions:
|
|
description: 'AWS regions to scan (comma-separated)'
|
|
required: false
|
|
default: 'us-east-1'
|
|
|
|
period:
|
|
description: 'Report period: daily, weekly, monthly'
|
|
required: false
|
|
default: 'weekly'
|
|
|
|
ai-provider:
|
|
description: 'AI provider: bedrock or openai'
|
|
required: false
|
|
default: 'bedrock'
|
|
|
|
ai-model:
|
|
description: 'AI model ID'
|
|
required: false
|
|
default: 'anthropic.claude-3-5-sonnet-20241022-v2:0'
|
|
|
|
comment-on-pr:
|
|
description: 'Comment results on PR'
|
|
required: false
|
|
default: 'true'
|
|
|
|
fail-on-increase:
|
|
description: 'Fail if cost increases above threshold'
|
|
required: false
|
|
default: 'false'
|
|
|
|
fail-threshold:
|
|
description: 'Cost increase threshold (monthly $)'
|
|
required: false
|
|
default: '100'
|
|
|
|
slack-webhook:
|
|
description: 'Slack webhook for notifications'
|
|
required: false
|
|
|
|
output-format:
|
|
description: 'Output format: markdown, json, github'
|
|
required: false
|
|
default: 'github'
|
|
|
|
outputs:
|
|
monthly-delta:
|
|
description: 'Monthly cost change in dollars'
|
|
|
|
total-savings:
|
|
description: 'Total potential savings identified'
|
|
|
|
findings-count:
|
|
description: 'Number of optimization findings'
|
|
|
|
report:
|
|
description: 'Full report content'
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install Argus
|
|
shell: bash
|
|
run: |
|
|
pip install boto3 requests
|
|
# In production: pip install argus-finops
|
|
|
|
- name: Run Argus
|
|
id: argus
|
|
shell: bash
|
|
env:
|
|
ARGUS_AI_PROVIDER: ${{ inputs.ai-provider }}
|
|
ARGUS_AI_MODEL: ${{ inputs.ai-model }}
|
|
run: |
|
|
case "${{ inputs.mode }}" in
|
|
scan)
|
|
python -m argus scan \
|
|
--regions ${{ inputs.regions }} \
|
|
--output-format ${{ inputs.output-format }} \
|
|
--output /tmp/argus-report.md
|
|
;;
|
|
evaluate)
|
|
python -m argus evaluate \
|
|
--plan-file "${{ inputs.plan-file }}" \
|
|
--output-format ${{ inputs.output-format }} \
|
|
--output /tmp/argus-report.md \
|
|
${{ inputs.fail-on-increase == 'true' && '--fail-on-increase' || '' }} \
|
|
--fail-threshold ${{ inputs.fail-threshold }}
|
|
;;
|
|
report)
|
|
python -m argus report \
|
|
--period ${{ inputs.period }} \
|
|
--regions ${{ inputs.regions }} \
|
|
--output-format ${{ inputs.output-format }} \
|
|
--output /tmp/argus-report.md \
|
|
${{ inputs.slack-webhook && format('--slack-webhook {0}', inputs.slack-webhook) || '' }}
|
|
;;
|
|
esac
|
|
|
|
# Set outputs
|
|
echo "report<<EOF" >> $GITHUB_OUTPUT
|
|
cat /tmp/argus-report.md >> $GITHUB_OUTPUT
|
|
echo "EOF" >> $GITHUB_OUTPUT
|
|
|
|
- name: Comment on PR
|
|
if: inputs.comment-on-pr == 'true' && github.event_name == 'pull_request'
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const report = `${{ steps.argus.outputs.report }}`;
|
|
github.rest.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: `## 💰 Argus Cost Analysis\n\n${report}`
|
|
});
|