...
Basically, we created the structure of the necessary cost tables for snowflake and then, in parallel, we created the structure of the aws cost tables along with the slack notifications and event structure about the customers.
The flow above is triggered by the EventBridge here.
...
About the codes, basically all the functions just run a set of queries, mainly for the snowflake calculations, where we separate them by large queries and in separate files for debugs if necessary, in the others, you just need to understand the query and update it if necessary.
...
Basically to create an integration with slack and the application in lambda function, first an application was created in slack. The generated token was saved in this secret to be used in our application via API by the python slack_sdk library. Our apps: https://api.slack.com/apps/A03TTGKC5L1
...
And the combination of the python library for snowflake with this and other libraries that you can find here in the requirements.txt, we managed to get the results and handle the alerts. Here is an example identical to our case of how to use it.
https://www.pragnakalp.com/create-slack-bot-using-python-tutorial-with-examples/