Skip to content

data-platform-hq/terraform-azurerm-vm-extension

Repository files navigation

Azure Vm Extension Terraform module

Terraform module for creation Azure Vm Extension

Usage

# Prerequisite resources

data "azurerm_virtual_machine" "example" {
  name                = "production"
  resource_group_name = "networking"
}

locals {
  extentions = {
    name               = "example"
    virtual_machine_id = data.azurerm_virtual_machine.example.id
    settings = jsonencode({
      "script" : (base64encode(templatefile("./script.sh", {
        var  = "example"
      })))
    })
  }
}

module "virtual_machine_extension" {
  source   = "data-platform-hq/vm-extension/azurerm"
  version  = "~> 1.0"

  extentions = local.extentions
}

Requirements

Name Version
terraform >=1.0.0
azurerm >= 4.0.1

Providers

Name Version
azurerm >= 4.0.1

Modules

No modules.

Resources

Name Type
azurerm_virtual_machine_extension.this resource

Inputs

Name Description Type Default Required
extensions Objects to configure extentions for virtual machine
object({
name = string,
virtual_machine_id = string,
publisher = optional(string, "Microsoft.Azure.Extensions"),
type = optional(string, "CustomScript"),
type_handler_version = optional(string, "2.0"),
settings = optional(string),
protected_settings = optional(string),
tags = optional(map(any))
})
n/a yes

Outputs

Name Description
id The ID of the Virtual Machine Extension.

License

Apache 2 Licensed. For more information please see LICENSE