diff --git a/.gitignore b/.gitignore index c0678016c6b..7c57e3e4f06 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,8 @@ obj/ bin/ node_modules/ test-results/ -playwright-report/ \ No newline at end of file + +# terraform .tfstate files +**/.terraform +*.tfstate* +*.terraform* \ No newline at end of file diff --git a/.vscode/cspell.global.yaml b/.vscode/cspell.global.yaml index 0eed431835b..3ed76d755ab 100644 --- a/.vscode/cspell.global.yaml +++ b/.vscode/cspell.global.yaml @@ -80,6 +80,10 @@ ignoreWords: - httptrigger - resourcegroups - devcontainer + - azurecaf + - azurerm + - aztfmod + - menuid useGitignore: true dictionaryDefinitions: - name: gitHubUserAliases diff --git a/templates/common/infra/terraform/applicationinsights/applicationinsights.tf b/templates/common/infra/terraform/applicationinsights/applicationinsights.tf new file mode 100644 index 00000000000..25770feb2ce --- /dev/null +++ b/templates/common/infra/terraform/applicationinsights/applicationinsights.tf @@ -0,0 +1,1241 @@ +terraform { + required_providers { + azurerm = { + version = "~>3.18.0" + source = "hashicorp/azurerm" + } + azurecaf = { + source = "aztfmod/azurecaf" + version = "1.2.15" + } + } +} +# ------------------------------------------------------------------------------------------------------ +# DEPLOY APPLICATION INSIGHTS +# ------------------------------------------------------------------------------------------------------ +resource "azurecaf_name" "applicationinsights_name" { + name = var.resource_token + resource_type = "azurerm_application_insights" + random_length = 0 + clean_input = true +} + +resource "azurerm_application_insights" "applicationinsights" { + name = azurecaf_name.applicationinsights_name.result + location = var.location + resource_group_name = var.rg_name + application_type = "web" + workspace_id = var.workspace_id + tags = var.tags +} + +data "azurerm_subscription" "current" {} + +resource "azurerm_portal_dashboard" "board" { + name = "dash-${var.resource_token}" + resource_group_name = var.rg_name + location = var.location + tags = var.tags + dashboard_properties = <