Skip to content

Commit

Permalink
Adding alarm example
Browse files Browse the repository at this point in the history
  • Loading branch information
lzrocha committed Oct 7, 2021
1 parent 0a125c7 commit 7c7d8c6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/cloudfront-simple-alarm.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resource "aws_s3_bucket" "app_frontend" {
bucket_prefix = "my-frontend-app-"
acl = "private"
}

module "app_frontend" {
source = "git::https://github.com/DNXLabs/terraform-aws-static-app.git?ref=2.0.1" # Always check the latest version

name = "my-frontend-app"
s3_bucket_id = aws_s3_bucket.app_frontend.id
hostnames = ["www.example.com"]
certificate_arn = "arn:aws:acm:us-east-1:<account-id>:certificate/<certificate-hash>" # Replace the <account-id> and <certificate-hash> from a valid certificate
hosted_zone = "example.com"
hostname_create = true

alarms = {
"TotalErrorRate" = {
threshold = 1 #(%)
}
"5xxErrorRate" = {
threshold = 5 #(%)
}
}
}

0 comments on commit 7c7d8c6

Please sign in to comment.