Skip to content

Latest commit

 

History

History
121 lines (95 loc) · 2.3 KB

azurerm_maintenance_assignment_virtual_machine.md

File metadata and controls

121 lines (95 loc) · 2.3 KB

azurerm_maintenance_assignment_virtual_machine

back

Index

Terraform

terraform {
  required_providers {
    azurerm = ">= 2.54.0"
  }
}

top

Example Usage

module "azurerm_maintenance_assignment_virtual_machine" {
  source = "./modules/azurerm/r/azurerm_maintenance_assignment_virtual_machine"

  # location - (required) is a type of string
  location = null
  # maintenance_configuration_id - (required) is a type of string
  maintenance_configuration_id = null
  # virtual_machine_id - (required) is a type of string
  virtual_machine_id = null

  timeouts = [{
    create = null
    delete = null
    read   = null
  }]
}

top

Variables

variable "location" {
  description = "(required)"
  type        = string
}

variable "maintenance_configuration_id" {
  description = "(required)"
  type        = string
}

variable "virtual_machine_id" {
  description = "(required)"
  type        = string
}

variable "timeouts" {
  description = "nested block: NestingSingle, min items: 0, max items: 0"
  type = set(object(
    {
      create = string
      delete = string
      read   = string
    }
  ))
  default = []
}

top

Resource

resource "azurerm_maintenance_assignment_virtual_machine" "this" {
  # location - (required) is a type of string
  location = var.location
  # maintenance_configuration_id - (required) is a type of string
  maintenance_configuration_id = var.maintenance_configuration_id
  # virtual_machine_id - (required) is a type of string
  virtual_machine_id = var.virtual_machine_id

  dynamic "timeouts" {
    for_each = var.timeouts
    content {
      # create - (optional) is a type of string
      create = timeouts.value["create"]
      # delete - (optional) is a type of string
      delete = timeouts.value["delete"]
      # read - (optional) is a type of string
      read = timeouts.value["read"]
    }
  }

}

top

Outputs

output "id" {
  description = "returns a string"
  value       = azurerm_maintenance_assignment_virtual_machine.this.id
}

output "this" {
  value = azurerm_maintenance_assignment_virtual_machine.this
}

top