-
Notifications
You must be signed in to change notification settings - Fork 434
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
Tech 1048/cacluate cost elastic ip #703
Conversation
providers/aws/ec2/elastic-ips.go
Outdated
fetchedAt := time.Now() | ||
hoursSinceFetched := hoursSince(fetchedAt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, I approved but now I just saw, that this will be always 0
hours, hence 0$ monthly cost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there @eneskaya and @mlabouardy just to let you know that I made some updates (thanks for the help Moh!) |
ebd1978
to
87d7b92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jakepage91 I've added missing AWS permission to IAM policy file as well handled when the permission is missing otherwise the resource won't be collected
Hey there!
I've added a cost calculation part for Elastic IPs here. But, the AWS Go SDK doesn't let me find the exact creation time of the Elastic IP. So, I've come up with a workaround that calculates the cost of unassociated Elastic IPs from the moment they're first fetched. This isn't perfect, though, as it may give inaccurate cost calculations. Unassociated IP addresses will only start counting towards the cost after Komiser fetches them, which could lead to underestimating the actual costs.
Can you think of any better way?
Cheers