Skip to content

azurermMaintenanceAssignmentDedicatedHost

Manages a maintenance assignment to Dedicated Host.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermDedicatedHostGroupExample =
  new azurerm.dedicatedHostGroup.DedicatedHostGroup(this, "example_2", {
    location: azurermResourceGroupExample.location,
    name: "example-host-group",
    platform_fault_domain_count: 2,
    resource_group_name: azurermResourceGroupExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermDedicatedHostGroupExample.overrideLogicalId("example");
const azurermMaintenanceConfigurationExample =
  new azurerm.maintenanceConfiguration.MaintenanceConfiguration(
    this,
    "example_3",
    {
      location: azurermResourceGroupExample.location,
      name: "example-mc",
      resource_group_name: azurermResourceGroupExample.name,
      scope: "Host",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMaintenanceConfigurationExample.overrideLogicalId("example");
const azurermDedicatedHostExample = new azurerm.dedicatedHost.DedicatedHost(
  this,
  "example_4",
  {
    dedicated_host_group_id: azurermDedicatedHostGroupExample.id,
    location: azurermResourceGroupExample.location,
    name: "example-host",
    platform_fault_domain: 1,
    sku_name: "DSv3-Type1",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermDedicatedHostExample.overrideLogicalId("example");
const azurermMaintenanceAssignmentDedicatedHostExample =
  new azurerm.maintenanceAssignmentDedicatedHost.MaintenanceAssignmentDedicatedHost(
    this,
    "example_5",
    {
      dedicated_host_id: azurermDedicatedHostExample.id,
      location: azurermResourceGroupExample.location,
      maintenance_configuration_id: azurermMaintenanceConfigurationExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMaintenanceAssignmentDedicatedHostExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • maintenanceConfigurationId - (Required) Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.

  • dedicatedHostId - (Required) Specifies the Dedicated Host ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Maintenance Assignment.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Maintenance Assignment.
  • read - (Defaults to 5 minutes) Used when retrieving the Maintenance Assignment.
  • delete - (Defaults to 30 minutes) Used when deleting the Maintenance Assignment.

Import

Maintenance Assignment can be imported using the resourceId, e.g.

terraform import azurerm_maintenance_assignment_dedicated_host.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Compute/hostGroups/group1/hosts/host1/providers/Microsoft.Maintenance/configurationAssignments/assign1