Skip to content

Data Source: azurermVirtualMachineScaleSet

Use this data source to access information about an existing Virtual Machine Scale Set.

Example Usage

import * as cdktf from "cdktf";
/*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 dataAzurermVirtualMachineScaleSetExample =
  new azurerm.dataAzurermVirtualMachineScaleSet.DataAzurermVirtualMachineScaleSet(
    this,
    "example",
    {
      name: "existing",
      resource_group_name: "existing",
    }
  );
new cdktf.TerraformOutput(this, "id", {
  value: dataAzurermVirtualMachineScaleSetExample.id,
});

Arguments Reference

The following arguments are supported:

  • name - (Required) The name of this Virtual Machine Scale Set.

  • resourceGroupName - (Required) The name of the Resource Group where the Virtual Machine Scale Set exists.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Virtual Machine Scale Set.

  • location - The Azure Region in which this Virtual Machine Scale Set exists.

  • identity - A identity block as defined below.

  • instances - A list of instances blocks as defined below.

  • networkInterface - A list of networkInterface blocks as defined below.


An identity block exports the following:

  • type - The type of Managed Service Identity that is configured on this Virtual Machine Scale Set.

  • principalId - The Principal ID of the System Assigned Managed Service Identity that is configured on this Virtual Machine Scale Set.

  • tenantId - The Tenant ID of the System Assigned Managed Service Identity that is configured on this Virtual Machine Scale Set.

  • identityIds - The list of User Assigned Managed Identity IDs assigned to this Virtual Machine Scale Set.


instances exports the following:

  • computerName - The Hostname of this Virtual Machine.
  • instanceId - The Instance ID of this Virtual Machine.
  • latestModelApplied - Whether the latest model has been applied to this Virtual Machine.
  • name - The name of the this Virtual Machine.
  • privateIpAddress - The Primary Private IP Address assigned to this Virtual Machine.
  • privateIpAddresses - A list of Private IP Addresses assigned to this Virtual Machine.
  • publicIpAddress - The Primary Public IP Address assigned to this Virtual Machine.
  • publicIpAddresses - A list of the Public IP Addresses assigned to this Virtual Machine.
  • provisioningState - The provisioning state of the virtual machine.
  • virtualMachineId - The unique ID of the virtual machine.
  • zone - The zones of the virtual machine.

networkInterface exports the following:

  • name - The name of the network interface configuration.
  • primary - Whether network interfaces created from the network interface configuration will be the primary NIC of the VM.
  • ipConfiguration - An ipConfiguration block as documented below.
  • enableAcceleratedNetworking - Whether to enable accelerated networking or not.
  • dnsServers - An array of the DNS servers in use.
  • enableIpForwarding - Whether IP forwarding is enabled on this NIC.
  • networkSecurityGroupId - The identifier for the network security group.

ipConfiguration exports the following:

  • name - The name of the IP configuration.
  • subnetId - The the identifier of the subnet.
  • applicationGatewayBackendAddressPoolIds - An array of references to backend address pools of application gateways.
  • loadBalancerBackendAddressPoolIds - An array of references to backend address pools of load balancers.
  • loadBalancerInboundNatRulesIds - An array of references to inbound NAT pools for load balancers.
  • primary - If this ip_configuration is the primary one.
  • applicationSecurityGroupIds - The application security group IDs to use.
  • publicIpAddress - The virtual machines scale set IP Configuration's PublicIPAddress configuration. The publicIpAddress is documented below.

publicIpAddress exports the following:

  • name - The name of the public IP address configuration
  • idleTimeoutInMinutes - The idle timeout in minutes.
  • domainNameLabel - The domain name label for the DNS settings.
  • ipTag - A list of ipTag blocks as defined below.
  • publicIpPrefixId - The ID of the public IP prefix.
  • version - The Internet Protocol Version of the public IP address.

ipTag exports the following:

  • tag - The IP Tag associated with the Public IP.
  • type - The Type of IP Tag.

Timeouts

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

  • read - (Defaults to 5 minutes) Used when retrieving the Virtual Machine Scale Set.