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

Aws Lambda cost calculation improvements #1009

Merged
merged 3 commits into from
Sep 29, 2023

Conversation

Azanul
Copy link
Collaborator

@Azanul Azanul commented Sep 28, 2023

Problem

AWS Lambda costs were off by ~1000x magnitude.

Solution

The calculation for duration was off, it needed to bed divided by 1024 to get correct units.

Changes Made

  • Added common utils for AWS cost calculations
  • Fixed AWS Lambda cost calculation
  • Took free tier into account

Notes

  • Pay more attention towards the common utils as, if correctly implemented, these can be used throughout aws provider.

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

Signed-off-by: Azanul <azanulhaque@gmail.com>
Signed-off-by: Azanul <azanulhaque@gmail.com>
@Traxmaxx
Copy link
Contributor

hey @Azanul

Pay more attention towards the common utils as, if correctly implemented, these can be used throughout aws provider.

I 100% agree with you, thanks for pointing that out! Do you mind adding a test for this particular util to make sure this does not happen again? There is an example test here

Only if it's doable though! Thanks for your contribution 🙂 🙏

Signed-off-by: Azanul <azanulhaque@gmail.com>
@Azanul
Copy link
Collaborator Author

Azanul commented Sep 28, 2023

@Traxmaxx great suggestion! I've added the tests, although not exhaustive. While writing the tests, I found a mistake I did as well!

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.

Thanks a million @Azanul

@mlabouardy mlabouardy merged commit fea6f9f into tailwarden:develop Sep 29, 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.

None yet

3 participants