Skip to content

claranet/terraform-azurerm-managed-grafana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Managed Grafana

Changelog Notice Apache V2 License TF Registry

Azure module to deploy a Azure Managed Grafana.

Global versioning rule for Claranet Azure modules

Module version Terraform version OpenTofu version AzureRM version
>= 8.x.x Unverified 1.8.x >= 4.0
>= 7.x.x 1.3.x >= 3.0
>= 6.x.x 1.x >= 3.0
>= 5.x.x 0.15.x >= 2.0
>= 4.x.x 0.13.x / 0.14.x >= 2.0
>= 3.x.x 0.12.x >= 2.0
>= 2.x.x 0.12.x < 2.0
< 2.x.x 0.11.x < 2.0

Contributing

If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.

More details are available in the CONTRIBUTING.md file.

Usage

This module is optimized to work with the Claranet terraform-wrapper tool which set some terraform variables in the environment needed by this module. More details about variables set by the terraform-wrapper available in the documentation.

⚠️ Since modules version v8.0.0, we do not maintain/check anymore the compatibility with Hashicorp Terraform. Instead, we recommend to use OpenTofu.

data "azuread_group" "admin" {
  display_name     = "Contoso Admins"
  security_enabled = true
}

module "managed_grafana" {
  source  = "claranet/managed-grafana/azurerm"
  version = "x.x.x"

  location            = module.azure_region.location
  location_short      = module.azure_region.location_short
  resource_group_name = module.rg.resource_group_name

  client_name = var.client_name
  environment = var.environment
  stack       = var.stack

  grafana_major_version = 10
  api_key_enabled       = true

  grafana_admin_role_object_ids = {
    "Contoso Admin Group" = data.azuread_group.admin.object_id
  }

  logs_destinations_ids = [
    module.run.logs_storage_account_id,
    module.run.log_analytics_workspace_id
  ]

  extra_tags = {
    foo = "bar"
  }
}

Providers

Name Version
azurecaf ~> 1.2, >= 1.2.22
azurerm ~> 3.92

Modules

Name Source Version
diagnostics claranet/diagnostic-settings/azurerm ~> 6.5.0

Resources

Name Type
azurerm_dashboard_grafana.main resource
azurerm_role_assignment.grafana_role_admin resource
azurerm_role_assignment.grafana_role_contributor resource
azurerm_role_assignment.grafana_role_viewer resource
azurecaf_name.managed_grafana data source

Inputs

Name Description Type Default Required
api_key_enabled Enable API key for Grafana. bool false no
auto_generated_domain_name_label_scope The scope of the auto-generated domain name label. string "TenantReuse" no
azure_monitor_workspace_id The Azure Monitor workspace ID for Grafana integration. string null no
client_name Client name/account used in naming. string n/a yes
custom_name Custom Azure Managed Grafana, generated if not set. string "" no
default_tags_enabled Option to enable or disable default tags. bool true no
deterministic_outbound_ip_enabled Enable deterministic outbound IP for Grafana. bool true no
diagnostic_settings_custom_name Custom name of the diagnostics settings, name will be default if not set. string "default" no
environment Project environment. string n/a yes
extra_tags Additional tags to add on resources. map(string) {} no
grafana_admin_role_object_ids Map of object names => IDs for Grafana Admin role. map(string) {} no
grafana_contributor_role_object_ids Map of object names => IDs for Grafana Contributor role. map(string) {} no
grafana_major_version The major version of Grafana to deploy. number 10 no
grafana_viewer_role_object_ids Map of object names => IDs for Grafana Viewer role. map(string) {} no
identity Identity block information.
object({
type = optional(string, "SystemAssigned")
identity_ids = optional(list(string))
})
{} no
location Azure region to use. string n/a yes
location_short Short string for Azure location. string n/a yes
logs_categories Log categories to send to destinations. list(string) null no
logs_destinations_ids List of destination resources IDs for logs diagnostic destination.
Can be Storage Account, Log Analytics Workspace and Event Hub. No more than one of each can be set.
If you want to specify an Azure EventHub to send logs and metrics to, you need to provide a formated string with both the EventHub Namespace authorization send ID and the EventHub name (name of the queue to use in the Namespace) separated by the pipe character.
list(string) n/a yes
logs_metrics_categories Metrics categories to send to destinations. list(string) null no
name_prefix Optional prefix for the generated name. string "" no
name_suffix Optional suffix for the generated name. string "" no
public_network_access_enabled Whether the Azure Managed Grafana is available from public network. bool false no
resource_group_name Name of the resource group. string n/a yes
sku The SKU of the Grafana. string "Standard" no
smtp SMTP configuration for Grafana.
object({
enabled = bool
host = optional(string)
user = optional(string)
password = optional(string)
start_tls_policy = optional(string)
from_address = optional(string)
from_name = optional(string, "Azure Managed Grafana Notification")
verification_skip_enabled = optional(bool, false)
})
null no
stack Project stack name. string n/a yes
zone_redundancy_enabled Enable zone redundant for Grafana. bool true no

Outputs

Name Description
dashboard_grafana Azure Managed Grafana output object
id Azure Managed Grafana ID
identity_principal_id Azure Managed Grafana system identity principal ID
name Azure Managed Grafana name

Related documentation

Microsoft Azure documentation: Azure Managed Grafana documentation.