To enable posting the message to Slack you must define a secret in secrets manager called 'awsgenie_secret_manager' with key=slack_url and value=.
To enable posting the message to SNS you must define a secret in secrets manager called 'awsgenie_secret_manager' with key=sns_arn and value=.
To enable posting the message to Teams you must define a secret in secrets manager called 'awsgenie_secret_manager' with key=teams_url and value=.
There are 3 parts to configuring this to run as a Lambda
- IAM Role for Lambda - The IAM Role for you Lambda will have to give permissions for Lambda and Cost Explorer.
- Trigger - Event Bridge(Cloudwatch Alarms) setup with a cron expression to trigger a run daily.
- Function Code - You can directly paste in the get_forecast.py file is is all ready to go.
Click here for instructions for setting up Lambda
If you get SSL Cert errors defining this environment varialbe may help you:
export SSL_CERT_FILE=$(python -m certifi)