Skip to content

Commit

Permalink
add example for Microsoft.Dashboard/grafana (#275)
Browse files Browse the repository at this point in the history
* Add files via upload

* Delete Microsoft.Dashboard/grafana directory

* Add files via upload

* Delete azure-pipelines-azapi-az-managed-grafana-v1.0.yml

* Delete README.md

* Update main.tf

* Delete az-managed-grafana.tf

* Delete az-managed-grafana.tfvars

* Delete variables.tf

* Update main.tf

* terraform fmt

---------

Co-authored-by: Heng Lu <79895375+ms-henglu@users.noreply.github.com>
  • Loading branch information
arindam0310018 and ms-henglu authored Aug 7, 2023
1 parent 9a9e811 commit 0ff2c5b
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions examples/Microsoft.Dashboard/grafana/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
terraform {
required_version = ">= 1.3.3"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.27"
}
azapi = {
source = "Azure/azapi"
version = "1.0.0"
}
}
}
provider "azurerm" {
features {}
skip_provider_registration = true
}

provider "azapi" {
}

#####################
## Resource Group:-
#####################

resource "azurerm_resource_group" "azrg" {
name = "GrafanaRG"
location = "West Europe"
}

##############################
## Azure Managed Grafana:-
##############################
resource "azapi_resource" "azgrafana" {
type = "Microsoft.Dashboard/grafana@2022-08-01"
name = "AMGrafanaTest"
parent_id = azurerm_resource_group.azrg.id
location = azurerm_resource_group.azrg.location

identity {
type = "SystemAssigned"
}

body = jsonencode({
sku = {
name = "Standard"
}
properties = {
publicNetworkAccess = "Enabled",
zoneRedundancy = "Enabled",
apiKey = "Enabled",
deterministicOutboundIP = "Enabled"
}
})
}

0 comments on commit 0ff2c5b

Please sign in to comment.