Skip to main content

Command Palette

Search for a command to run...

Setting up AWS Budget in Free Tier Account

Published
4 min read
Setting up AWS Budget in Free Tier Account
U

👨‍💻 AWS Cloud Engineer | Around 6 years of Corporate Experience | Driving Innovation in Cloud Solutions 🔧 Day-to-Day Tasks: Specialize in creating AWS infrastructure for Migration Projects. Leveraging services such as S3, SNS, SQS, IAM, Lambda, System Manager, Kinesis, OpenSearch, Cognito, Storage Gateway, Cloud Watch, API Gateway, AWS Event Scheduler, Secret Manager, ECS, Application Load Balancer, VPC among others. Additionally, I excel in crafting Splunk Dashboards and implementing alerting mechanisms for Cloud Watch logs to monitor failures. My approach involves constructing AWS infrastructure using the Serverless framework and Cloud Formation templates, while automating tasks through Boto3 (Python Scripting) Lambdas. 🎯 Passion: I am deeply passionate about continuously learning new technologies and eagerly anticipate the transformative impact of cloud computing on the tech landscape. 📧 Connect: Feel free to reach out to me at awslearningoals@gmail.com. Let's connect and explore potential collaborations! https://www.linkedin.com/in/rastogiutkarsh/

Creating budgets in an AWS account is crucial for cost management and control. Budgets help learners and professionals monitor their spending and avoid unexpected charges. By setting up cost and usage budgets, users receive alerts when they approach or exceed their specified thresholds. This proactive approach enables better financial planning, ensures adherence to budget constraints, and promotes a deeper understanding of cloud cost structures. Additionally, AWS Budgets can track specific services, helping users identify cost-saving opportunities and optimize resource usage, making it an essential practice for efficient cloud management.

For this demo I will be creating AWS Budgets in Free tier account under root user. Here’s a concise list of prerequisites:

  • AWS Account: Ensure you have an AWS account with Free Tier access.

  • Active Email account which you can use for alert monitoring.

I will be creating monthly budget in Root account using CloudFormation Template. Let’s assume we are creating 5 USD amount budget, when you have spent equals to threshold of 70 percentage you will get email notification or if you cross over 80 threshold value for desired budget amount you will get email notification. We will be creating CloudFormation stack in ap-south-1 region i.e. Mumbai.

Note: You can customize default value as needed.

Step 1: Please find below attached code for creating CloudFormation template and save this code in system with name as budget_template.yaml

Description: "Creating AWS Monthly Budget for Learning Purpose"
Parameters:
  Amount:
    Type: Number
    Description: The cost or usage amount that's associated with a budget forecast, actual spend, or budget threshold.
    Default: 5
  Unit:
    Type: String
    Description: The unit of measurement that's used for the budget forecast, actual spend, or budget threshold.
    Default: USD
  TimeUnit:
    Type: String
    Description: The length of time until a budget resets the actual and forecasted spend.
    Default: MONTHLY
  BudgetType:
    Type: String
    Description: Specifies whether this budget tracks costs, usage, RI utilization, RI coverage, Savings Plans utilization, or Savings Plans coverage.
    Default: COST
  NotificationType:
    Type: String
    Description: Specifies whether the notification is for how much you have spent (ACTUAL) or for how much that you're forecasted to spend (FORECASTED).
    Default: ACTUAL
  ComparisonOperatorEqual:
    Type: String
    Description: The comparison that's used for this notification.
    Default: EQUAL_TO
  Threshold1:
    Type: Number
    Description: The threshold that's associated with a notification.
    Default: 70
  ComparisonOperatorGreater:
    Type: String
    Description: The comparison that's used for this notification.
    Default: GREATER_THAN
  Threshold2:
    Type: Number
    Description: The threshold that's associated with a notification.
    Default: 80
  SubscriptionType:
    Type: String
    Description:  The type of notification that AWS sends to a subscriber.
    Default: EMAIL
  Address:
    Type: String
    Description:  The address that AWS sends budget notifications to, either an SNS topic or an email.
    Default: example@gmail.com   


Resources:
  LearningBudget:
    Type: "AWS::Budgets::Budget"
    Properties:
      Budget:
        BudgetLimit:
          Amount: !Ref Amount
          Unit: !Ref Unit
        TimeUnit: !Ref TimeUnit
        BudgetType: !Ref BudgetType
      NotificationsWithSubscribers:
        - Notification:
            NotificationType: !Ref NotificationType
            ComparisonOperator: !Ref ComparisonOperatorEqual
            Threshold: !Ref Threshold1
          Subscribers:
            - SubscriptionType: !Ref SubscriptionType
              Address: !Ref Address
        - Notification:
            NotificationType: !Ref NotificationType
            ComparisonOperator: !Ref ComparisonOperatorGreater
            Threshold: !Ref Threshold2
          Subscribers:
          - SubscriptionType: !Ref SubscriptionType
            Address: !Ref Address

Outputs:
  BudgetId:
    Value: !Ref LearningBudget

Step 2: From AWS Console Home search CloudFormation and open CloudFormation service

Step 3: You will able to see below mentioned screen and click on yellow highlighted part i.e. create stack

Step 4: When you click on create stack as dropdown window will appear and select With new resources(standard) and it will redirect to below mentioned screen

Step 5: Select Choose an existing template under Prerequisite section and under Specify template select Upload a template file.

Step 6: Select Choose file from selecting location where you have saved template code. If no errors in file then it allow you to click on Next button.

Step 7: Under Stack Name Provide desired stack name as per limit ie. Monthly-learning-Budget-Stack and under parameters tab you can see what have you have specified in yaml file. Then click on next button.

Step 8: Under Configure Stack option we are not changing any values so click on next button.

Step 9: Under Review and Create just click on submit button. After that you will able to see Stack details as per name which you have specified and once stack is in Create Complete you are good.

Step 10: Under Resources Section of Stack you can see Budget Link and through that you can review Learning Budget which you have created.


"Thank you for reading! If you found this blog helpful, don't forget to subscribe and follow for more insightful content. Your support keeps me motivated to bring you valuable insights. Stay updated and never miss out on our latest posts. Feel free to leave comments or suggestions for future topics. Happy learning!"

https://awslearner.hashnode.dev/aws-beginner-level-project-ideas

https://awslearner.hashnode.dev/amazon-web-services-via-category

More from this blog

AWS Learner

39 posts