Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws): estimate aws cloudwatch costs #837

Merged

Conversation

siddarthkay
Copy link
Contributor

@siddarthkay siddarthkay commented Jun 3, 2023

Problem

Ability to calculate and view AWS Cloudwatch cost does not exist.

Solution

This PR adds a new cloudwatch.go file which queries the AWS v2 Go SDK and implements support for calculating AWS cloudwatch alarm costs.
An entry has also been made to aws.go to make sure ec2.CloudWatchAlarms is included.

Changes Made

fixes #415

How to Test

WIP

Screenshots

WIP

Checklist

  • Code follows the contributing guidelines
  • Changes have been thoroughly tested
  • Documentation has been updated, if necessary
  • Any dependencies have been added to the project, if necessary

Reviewers

@mlabouardy

AverageHoursPerMonth = 730
)

func CloudWatchAlarms(ctx context.Context, client providers.ProviderClient) ([]models.Resource, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant with existing implementation: https://github.com/tailwarden/komiser/blob/master/providers/aws/cloudwatch/alarms.go can you move the cost calculation there :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mlabouardy : thanks for pointing this out, I've moved the cost calculation logic to the existing implementation of alarms.go

@mlabouardy mlabouardy added the aws label Jun 3, 2023
@mlabouardy mlabouardy added this to the v3.0.19 milestone Jun 3, 2023
@siddarthkay siddarthkay force-pushed the estimate-aws-cloudwatch-cost branch from 0eb866d to 908f897 Compare June 4, 2023 06:18
@mlabouardy mlabouardy changed the base branch from master to develop June 6, 2023 10:30
Copy link
Collaborator

@mlabouardy mlabouardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, thanks for the changes!

@mlabouardy mlabouardy merged commit 4fb8faa into tailwarden:develop Jun 6, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Estimate cost of AWS CloudWatch alarms
2 participants