Skip to content

reservix/terraform-aws-budget

 
 

Repository files navigation

terraform-aws-budget

Build Status Latest Release GitHub tag (latest SemVer) Terraform Version Infrastructure Tests pre-commit checkov Infrastructure Tests

Terraform module - creates a Budget and a Budget for half as much.


It's 100% Open Source and licensed under the APACHE2.

Usage

These are just basic examples, your budget rules should be much more sophisticated.

Include this repository as a module in your existing terraform code:

module "budget" {
  source            = "JamesWoolfenden/budget/aws"
  version           = "0.3.32"
  limit             = var.limit
  time_period_start = var.time_period_start
  budget            = var.budget
  notification      = var.notification
}

The module reference uses 2 objects, budget and notification, from the example data. This module implements billing alerts on your AWS account, the provided variables are in examplea.auto.tfvars:

budget={
    name              = "budget-ec2-monthly"
    budget_type       = "COST"
    time_unit         = "MONTHLY"
    limit_unit        = "Pounds"
   }
notification={
    comparison_operator        = "GREATER_THAN"
    threshold                  = 100
    threshold_type             = "PERCENTAGE"
    notification_type          = "FORECASTED"
    subscriber_email_addresses = ["[email protected]"]
    subscriber_sns_topic_arns  = [""]
  }

The variable limit creates 2 sets of alerts one at its setting and another at half. Additional users or groups can added to subscriber_email_addresses.

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_budgets_budget.budget resource

Inputs

Name Description Type Default Required
budget Basic Budget Properties map(any)
{
"budget_type": "COST",
"limit_unit": "USD",
"name": "budget-ec2-monthly",
"time_unit": "MONTHLY"
}
no
cost_filters The Budget filters to use map(any) null no
half_budget_enabled Whether to enable or disable the half budget alert bool true no
limit Budget alarm limit number n/a yes
notification Budget notification properties
object({
comparison_operator = string
threshold = number
threshold_type = string
notification_type = string
subscriber_email_addresses = set(any)
subscriber_sns_topic_arns = set(any)
})
n/a yes
time_period_start Time to start string n/a yes

Outputs

Name Description
budget n/a
half_budget n/a

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Copyrights

Copyright © 2019-2022 James Woolfenden

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributors

James Woolfenden
James Woolfenden

About

Creates budgets for AWS Usage

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 60.5%
  • Makefile 29.1%
  • PowerShell 4.9%
  • Shell 3.1%
  • Python 2.4%