-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* UML-1959 Create Cloudwatch dashboard in Terraform
- Loading branch information
Sam Ainsworth
authored
Mar 13, 2024
1 parent
6a51e04
commit a9115c3
Showing
10 changed files
with
469 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
resource "aws_cloudwatch_dashboard" "main" { | ||
count = var.create_dashboard ? 1 : 0 | ||
dashboard_name = "${var.environment_name}-${data.aws_region.current.name}-dashboard" | ||
dashboard_body = templatefile("${path.module}/templates/cw_dashboard_watching.tftpl", { | ||
region = data.aws_region.current.name, | ||
environment = var.environment_name, | ||
viewer_alb_arn = local.viewer_alb_arn, | ||
use_alb_arn = local.use_alb_arn | ||
}) | ||
|
||
provider = aws.region | ||
} | ||
|
||
locals { | ||
viewer_alb_arn = trimprefix(aws_lb.viewer.arn, "arn:aws:elasticloadbalancing:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:loadbalancer/") | ||
use_alb_arn = trimprefix(aws_lb.use.arn, "arn:aws:elasticloadbalancing:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:loadbalancer/") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.