Skip to content

azurermProximityPlacementGroup

Manages a proximity placement group for virtual machines, virtual machine scale sets and availability sets.

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.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermProximityPlacementGroupExample =
  new azurerm.proximityPlacementGroup.ProximityPlacementGroup(
    this,
    "example_1",
    {
      location: azurermResourceGroupExample.location,
      name: "exampleProximityPlacementGroup",
      resource_group_name: azurermResourceGroupExample.name,
      tags: {
        environment: "Production",
      },
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermProximityPlacementGroupExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the proximity placement group. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the availability set. Changing this forces a new resource to be created.

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

  • allowedVmSizes - (Optional) Specifies the supported sizes of Virtual Machines that can be created in the Proximity Placement Group.

\~> NOTE: Removing allowedVmSizes after it is set forces a new resource to be created.

  • zone - (Optional) Specifies the supported zone of the Proximity Placement Group. Changing this forces a new resource to be created.

\~> NOTE: allowedVmSizes must be set when zone is specified.

  • tags - (Optional) A mapping of tags to assign to the resource.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Proximity Placement Group.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Proximity Placement Group.
  • update - (Defaults to 30 minutes) Used when updating the Proximity Placement Group.
  • read - (Defaults to 5 minutes) Used when retrieving the Proximity Placement Group.
  • delete - (Defaults to 30 minutes) Used when deleting the Proximity Placement Group.

Import

Proximity Placement Groups can be imported using the resourceId, e.g.

terraform import azurerm_proximity_placement_group.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Compute/proximityPlacementGroups/example-ppg