Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions infrastructure/modules/dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# app-insights

## Terraform documentation
For the list of inputs, outputs, resources... check the [terraform module documentation](tfdocs.md).
9 changes: 9 additions & 0 deletions infrastructure/modules/dashboard/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "azurerm_portal_dashboard" "dashboard" {

name = var.name
location = var.location
resource_group_name = var.resource_group_name
tags = var.tags

dashboard_properties = var.dashboard_properties
}
50 changes: 50 additions & 0 deletions infrastructure/modules/dashboard/tfdocs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Module documentation

## Required Inputs

The following input variables are required:

### <a name="input_location"></a> [location](#input\_location)

Description: The location/region where the dashboard is created.

Type: `string`

### <a name="input_name"></a> [name](#input\_name)

Description: Is the dashboard workspace name.

Type: `string`

### <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name)

Description: The name of the resource group in which the Dashboard is created. Changing this forces a new resource to be created.

Type: `string`

## Optional Inputs

The following input variables are optional (have default values):

### <a name="input_dashboard_properties"></a> [dashboard\_properties](#input\_dashboard\_properties)

Description: JSON data representing dashboard body. See above for details on how to obtain this from the Portal.

Type: `string`

Default: `{}`

### <a name="input_tags"></a> [tags](#input\_tags)

Description: A mapping of tags to assign to the resource.

Type: `map(string)`

Default: `{}`


## Resources

The following resources are used by this module:

- [azurerm_portal_dashboard.dashboard](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/portal_dashboard) (resource)
30 changes: 30 additions & 0 deletions infrastructure/modules/dashboard/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
variable "location" {
type = string
description = "The location/region where the dashboard is created."
}

variable "name" {
description = "Is the dashboard workspace name."
type = string
validation {
condition = can(regex("^[a-zA-Z0-9][a-zA-Z0-9-_]{0,253}[a-zA-Z0-9]$", var.name))
error_message = "The Dashboard name must be between 1 and 255 characters, start and end with an alphanumeric character, and can contain alphanumeric characters, hyphens, periods, and underscores (but not at the start or end)."
}
}

variable "resource_group_name" {
type = string
description = "The name of the resource group in which the Dashboard is created. Changing this forces a new resource to be created."
}

variable "tags" {
type = map(string)
default = {}
description = "A mapping of tags to assign to the resource."
}

variable "dashboard_properties" {
type = string
default = {}
description = "JSON data representing dashboard body. See above for details on how to obtain this from the Portal."
}
1 change: 1 addition & 0 deletions infrastructure/modules/shared-config/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ locals {
container-app-environment = lower("CAE-${var.env}-${var.location_map[var.location]}-${var.application}")
connection = lower("CON-${var.env}-${var.location_map[var.location]}-${var.application}")
custom-image = lower("IMAGE-${var.env}-${var.location_map[var.location]}")
dashboard = lower("DASH-${var.env}-${var.location_map[var.location]}-${var.application}")
dev-center = lower("DEVC-${var.env}-${var.location_map[var.location]}")
dev-center-project = lower("prj-${var.env}-${var.location_map[var.location]}")
dns-zone = lower("${var.application}.${var.env}.net")
Expand Down
Loading