Have you ever gone to bed and forgot how much was the billing for this month. Just to check it you need to get up from your bed, open you laptop, log in with your credentials, open browser, go to AWS console and check the billing dashboard. Fear not, AWS Lambda combining with Siri will help you get your billing reports in your fingertips or even more, through your voice.

So what is AWS Lambda? AWS Lambda are the code/functions running on a serverless service provided by AWS. We don’t have to provision or manage servers on AWS Lambda and pay only for the compute time of our functions. Siri is a apple’s virtual assistant where we can input voice commands and it returns relevant information after processing the query. We will also be using **Boto3, **Python SDK for creating, reading, updating and deleting AWS resources from python scripts.

So, the first step is to write a basic code on AWS Lambda. I am going to use Python as the language to write code. You can directly write code into the AWS Lambda or you can write it on your IDE. I would suggest the latter one because we can debug while writing the code.

I would assume that you already have the AWS credentials configured on your local machine. If not them please see this AWS documentation for it.

Configuring AWS CLI: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html

Configuring won’t cute it. Now the next step is to give the permission of the cost explorer policy to the AWS user that is configured to the machine but unfortunately I couldn’t find the policy of cost explorer on the policy tab so I made one for it. To make a policy follow these steps in order:

  1. Go to **IAM **service
  2. Click on policies
  3. Create a new policy. You will be redirected to a new webpage. Select the JSON tab.

Image for post

JSON Policy editor

#boto3 #siri #shortcuts #aws-lambda #api-gateway

Combining Siri and AWS Lambda to Get the Monthly AWS Spending of Your Account
2.00 GEEK