Skip to content

Commit

Permalink
Update cloudtrail to use only UQL (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
nslaughter authored May 5, 2023
1 parent 9be764f commit ef98376
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
40 changes: 13 additions & 27 deletions modules/cloudtrail-dashboard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
required_version = ">= v1.0.11"
}

resource "lightstep_metric_dashboard" "aws_cloudtrail_dashboard" {
resource "lightstep_dashboard" "aws_cloudtrail_dashboard" {
project_name = var.lightstep_project
dashboard_name = "AWS CloudTrail"

Expand All @@ -18,19 +18,12 @@ resource "lightstep_metric_dashboard" "aws_cloudtrail_dashboard" {
type = "timeseries"

query {
query_name = "a"
display = "bar"
hidden = false

metric = "aws.cloudtrail.units_sum"
timeseries_operator = "delta"


group_by {
aggregation_method = "sum"
keys = []
}

query_name = "a"
display = "line"
hidden = false
query_string = <<EOT
metric aws.cloudtrail.units_sum | delta | group_by [], sum
EOT
}

}
Expand All @@ -41,19 +34,12 @@ resource "lightstep_metric_dashboard" "aws_cloudtrail_dashboard" {
type = "timeseries"

query {
query_name = "b"
display = "bar"
hidden = false

metric = "aws.cloudtrail.total_data_retained_sum"
timeseries_operator = "delta"


group_by {
aggregation_method = "sum"
keys = []
}

query_name = "a"
display = "line"
hidden = false
query_string = <<EOT
metric aws.cloudtrail.total_data_retained_sum | delta | group_by [], sum
EOT
}

}
Expand Down
2 changes: 1 addition & 1 deletion modules/cloudtrail-dashboard/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "dashboard_url" {
value = "https://app.lightstep.com/${var.lightstep_project}/dashboard/${lightstep_metric_dashboard.aws_cloudtrail_dashboard.id}"
value = "https://app.lightstep.com/${var.lightstep_project}/dashboard/${lightstep_dashboard.aws_cloudtrail_dashboard.id}"
description = "CloudTrail Dashboard URL"
}

0 comments on commit ef98376

Please sign in to comment.