Contact Us | Stratusphere FinOps | StratusGrid Home | Blog
GitHub: StratusGrid/terraform-aws-anomaly-detection-alerts
This terraform module uses AWS Cloudformation under the hood to create AWS Cost Anomaly Detection monitors and subscriptions.
This repo has several base requirements
- The following packages are installed via brew:
tflint,terrascan,terraform-docs,gitleaks,tfsec,pre-commit,tfsec - Install
bashthrough Brew for Bash 5.0, otherwise it will fail with the error that looks likedeclare: -g: invalid option - If you need more tflint plugins, please edit the
.tflint.hclfile with the instructions from here - It's highly recommend that you follow the Git Pre-Commit Instructions below, these will run in GitHub though they should be ran locally to reduce issues
- By default Terraform docs will always run so our auto generated docs are always up to date
- This repo has been tested with awsume
See the pre-commit tfsec documentation here, this includes on how to bypass warnings
#Verify you have bash5
brew install bash
# Test your pre-commit hooks - This will force them to run on all files
pre-commit run --all-files
# Add your pre-commit hooks forever
pre-commit installmodule "aws_anomaly_detection_alerts" {
source = "StratusGrid/anomaly-detection-alerts/aws"
version = "3.0.0"
input_tags = merge(local.common_tags, {})
cost_threshold = 100 # This is a sample of 100
subscription_email = "[email protected]" # This is the email to send the billing alert to
}| Name | Version |
|---|---|
| terraform | ~> 1.1 |
| aws | ~> 5.0 |
| Name | Type |
|---|---|
| aws_ce_anomaly_monitor.this | resource |
| aws_ce_anomaly_subscription.this | resource |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| cost_threshold | Defines the amount in the account currency before AWS sends an email to the subscriber(s) that an anomaly was detected. | number |
n/a | yes |
| enable_cost_anomaly_detection | Boolean to enable or disable Cost Explorer Anomaly Detection monitor and subscription. | bool |
true |
no |
| input_tags | Map of tags to apply to resources | map(string) |
{ |
no |
| subscription_email | This is the email address that gets notified when an anomaly is detected. | string |
n/a | yes |
No outputs.
Note, manual changes to the README will be overwritten when the documentation is updated. To update the documentation, run terraform-docs -c .config/.terraform-docs.yml
