Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ build
**vm_disk_stdout**
**/.test/.gitconfig
Runbook Log.html
**/debug/**
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,22 @@ metadata:
annotations:
{% include "common-annotations.yaml" %}
spec:
displayUnitsLong: OK
displayUnitsShort: ok
displayUnitsLong: Execution Status
displayUnitsShort: exe
locations:
- {{default_location}}
description: "Monitor cost trends for AWS account {{ match_resource.account_name }}. Returns 1 (healthy) if costs are stable or decreasing, 0 (unhealthy) if cost increase exceeds the configured threshold."
description: Schedules daily execution of AWS account cost health analysis runbook for account {{ match_resource.account_name }}.
codeBundle:
{% if repo_url %}
repoUrl: {{repo_url}}
{% else %}
repoUrl: https://github.com/runwhen-contrib/rw-cli-codecollection.git
{% endif %}
{% if ref %}
ref: {{ref}}
{% else %}
repoUrl: https://github.com/runwhen-contrib/rw-workspace-utils.git
ref: main
{% endif %}
pathToRobot: codebundles/aws-account-cost-health/sli.robot
pathToRobot: codebundles/cron-scheduler-sli/sli.robot
intervalStrategy: intermezzo
intervalSeconds: 3600
intervalSeconds: 300
configProvided:
- name: AWS_REGION
value: "{{match_resource.resource.region}}"
- name: AWS_ACCOUNT_ID
value: "{{ match_resource.resource.account_id }}"
- name: AWS_ACCOUNT_NAME
value: "{{ match_resource.account_name }}"
- name: COST_ANALYSIS_LOOKBACK_DAYS
value: "30"
- name: COST_INCREASE_THRESHOLD
value: "10"
secretsProvided:
{% include "aws-auth.yaml" ignore missing %}
alertConfig:
tasks:
persona: eager-edgar
sessionTTL: 10m
- name: CRON_SCHEDULE
value: "0 8 * * *"
- name: TARGET_SLX
value: ""
Comment thread
stewartshea marked this conversation as resolved.
- name: DRY_RUN
value: "false"
secretsProvided: []
221 changes: 201 additions & 20 deletions codebundles/aws-account-cost-health/aws_cost_report.sh

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions codebundles/aws-account-cost-health/runbook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,21 @@ Suite Initialization
... description=Percentage threshold for cost increase alerts. An issue will be raised if period-over-period cost increase exceeds this value (e.g., 10 for 10% increase).
... pattern=\d+
... default=10
${OUTPUT_FORMAT}= RW.Core.Import User Variable OUTPUT_FORMAT
... type=string
... description=Output format for cost report: table, csv, json, or all (default: table)
... pattern=.*
... default=table
${COST_BUDGET}= RW.Core.Import User Variable COST_BUDGET
... type=string
... description=Budget threshold in USD for the analysis period. An issue will be raised if total costs exceed this value. Set to 0 to disable (default: 0).
... pattern=\d+
... default=0
${COST_CONCENTRATION_THRESHOLD}= RW.Core.Import User Variable COST_CONCENTRATION_THRESHOLD
... type=string
... description=Maximum percentage of total cost that any single service should represent. An issue will be raised if exceeded (default: 25).
... pattern=\d+
... default=25
${TIMEOUT_SECONDS}= RW.Core.Import User Variable TIMEOUT_SECONDS
... type=string
... description=Timeout in seconds for tasks (default: 600 = 10 minutes).
Expand All @@ -169,10 +184,16 @@ Suite Initialization
Set Suite Variable ${AWS_ACCOUNT_NAME} ${AWS_ACCOUNT_NAME}
Set Suite Variable ${COST_ANALYSIS_LOOKBACK_DAYS} ${COST_ANALYSIS_LOOKBACK_DAYS}
Set Suite Variable ${COST_INCREASE_THRESHOLD} ${COST_INCREASE_THRESHOLD}
Set Suite Variable ${OUTPUT_FORMAT} ${OUTPUT_FORMAT}
Set Suite Variable ${COST_BUDGET} ${COST_BUDGET}
Set Suite Variable ${COST_CONCENTRATION_THRESHOLD} ${COST_CONCENTRATION_THRESHOLD}
Set Suite Variable ${TIMEOUT_SECONDS} ${TIMEOUT_SECONDS}

${env}= Create Dictionary
... AWS_REGION=${AWS_REGION}
... COST_ANALYSIS_LOOKBACK_DAYS=${COST_ANALYSIS_LOOKBACK_DAYS}
... COST_INCREASE_THRESHOLD=${COST_INCREASE_THRESHOLD}
... OUTPUT_FORMAT=${OUTPUT_FORMAT}
... COST_BUDGET=${COST_BUDGET}
... COST_CONCENTRATION_THRESHOLD=${COST_CONCENTRATION_THRESHOLD}
Set Suite Variable ${env}
91 changes: 0 additions & 91 deletions codebundles/aws-account-cost-health/sli.robot

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,22 @@ metadata:
annotations:
{% include "common-annotations.yaml" %}
spec:
displayUnitsLong: OK
displayUnitsShort: ok
displayUnitsLong: Execution Status
displayUnitsShort: exe
locations:
- {{default_location}}
description: "Score the health of EKS cluster {{match_resource.resource.name}} in {{match_resource.resource.region}} (1=Healthy, 0=Unhealthy). Checks cluster status, node group health, add-on status, and configuration issues."
description: Schedules periodic execution of EKS cluster health check runbook for cluster {{match_resource.resource.name}} in {{match_resource.resource.region}}.
codeBundle:
{% if repo_url %}
repoUrl: {{repo_url}}
{% else %}
repoUrl: https://github.com/runwhen-contrib/rw-cli-codecollection.git
{% endif %}
{% if ref %}
ref: {{ref}}
{% else %}
repoUrl: https://github.com/runwhen-contrib/rw-workspace-utils.git
ref: main
{% endif %}
pathToRobot: codebundles/aws-eks-health/sli.robot
pathToRobot: codebundles/cron-scheduler-sli/sli.robot
intervalStrategy: intermezzo
intervalSeconds: 300
configProvided:
- name: AWS_REGION
value: {{match_resource.resource.region}}
- name: EKS_CLUSTER_NAME
value: {{match_resource.resource.name}}
- name: AWS_ACCOUNT_NAME
value: "{{match_resource.account_name}}"
secretsProvided:
{% include "aws-auth.yaml" ignore missing %}
alertConfig:
tasks:
persona: eager-edgar
sessionTTL: 10m
- name: CRON_SCHEDULE
value: "0 */6 * * *"
- name: TARGET_SLX
value: ""
- name: DRY_RUN
value: "false"
secretsProvided: []
Loading