Skip to content

Commit

Permalink
Merge pull request #16 from vistaprint/add-support-for-dashboard-perm…
Browse files Browse the repository at this point in the history
…issions

Add support to specify dashboard permissions
  • Loading branch information
betabandido authored Oct 7, 2021
2 parents b59fd79 + 85338ff commit 631865f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
28 changes: 15 additions & 13 deletions dashboards.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ resource "newrelic_one_dashboard" "dashboard" {
account_id = var.newrelic_account_id
name = "${var.newrelic_app_name} Dashboard"

permissions = var.dashboard_permissions

page {
name = "${var.newrelic_app_name} Dashboard"

widget_line {
title = "Latency (seconds)"
row = 1
column = 1
width = 12
title = "Latency (seconds)"
row = 1
column = 1
width = 12
nrql_query {
query = <<-EOF
SELECT
Expand All @@ -26,14 +28,14 @@ resource "newrelic_one_dashboard" "dashboard" {
TIMESERIES 5 minutes
SINCE 24 hours ago
EOF
}
}
}

widget_line {
title = "Traffic (requests per minute)"
row = 2
column = 1
width = 5
title = "Traffic (requests per minute)"
row = 2
column = 1
width = 5
nrql_query {
query = <<-EOF
SELECT rate(count(*), 1 minute) AS 'Requests per minute'
Expand All @@ -47,10 +49,10 @@ resource "newrelic_one_dashboard" "dashboard" {
}

widget_line {
title = "Errors"
row = 2
column = 6
width = 7
title = "Errors"
row = 2
column = 6
width = 7
nrql_query {
query = <<-EOF
SELECT
Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ variable "enable_dashboard" {
description = "True if creating a custom dashboard is desired; false otherwise."
}

variable "dashboard_permissions" {
type = string
default = "public_read_only"
description = <<-EOF
Determines who can see the dashboard in an account.
See https://registry.terraform.io/providers/newrelic/newrelic/latest/docs/resources/one_dashboard#permissions
EOF
}

variable "enable_victorops_notifications" {
type = bool
default = false
Expand Down

0 comments on commit 631865f

Please sign in to comment.