Created
September 19, 2018 17:05
-
-
Save archmangler/4f99d94c230dfe7f01a8e6997f9a7eb9 to your computer and use it in GitHub Desktop.
terraform azure boot_diagnostics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Terraform Example of using boot_diagnostics for Azure virtual Machine | |
===================================================================== | |
- include this in the vm resource bloc: | |
``` | |
. | |
. | |
. | |
boot_diagnostics { | |
enabled = "true" | |
storage_uri = "${azurerm_storage_account.diagstorage2.primary_blob_endpoint}" | |
} | |
. | |
. | |
. | |
``` | |
- will need to define a boot diagnostics sa type: | |
``` | |
variable "boot_diagnostics_sa_type" { | |
description = "(Optional) Storage account type for boot diagnostics" | |
default = "Standard_LRS" | |
} | |
``` | |
- create a storage account | |
``` | |
/*Create a storage account to create blob storage for the boot diag output*/ | |
resource "azurerm_storage_account" "main" { | |
name = "bootdiag20092018001" | |
resource_group_name = "${azurerm_resource_group.main.name}" | |
location = "${azurerm_resource_group.main.location}" | |
account_tier = "${element(split("_", var.boot_diagnostics_sa_type),0)}" | |
account_replication_type = "${element(split("_", var.boot_diagnostics_sa_type),1)}" | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment