Skip to content

Data Source: azurermPolicyVirtualMachineConfigurationAssignment

Use this data source to access information about an existing Guest Configuration Policy.

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 dataAzurermPolicyVirtualMachineConfigurationAssignmentExample =
  new azurerm.dataAzurermPolicyVirtualMachineConfigurationAssignment.DataAzurermPolicyVirtualMachineConfigurationAssignment(
    this,
    "example",
    {
      name: "AzureWindowsBaseline",
      resource_group_name: "example-RG",
      virtual_machine_name: "example-vm",
    }
  );
new cdktf.TerraformOutput(this, "compliance_status", {
  value:
    dataAzurermPolicyVirtualMachineConfigurationAssignmentExample.complianceStatus,
});

Argument Reference

  • name - (Required) Specifies the name of the Guest Configuration Assignment.

  • resourceGroupName - (Required) Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.

  • virtualMachineName - (Required) Only retrieve Policy Set Definitions from this Management Group.

Attributes Reference

  • id - The ID of the Guest Configuration Assignment.

  • contentHash - The content hash for the Guest Configuration package.

  • contentUri - The content URI where the Guest Configuration package is stored.

  • assignmentHash - Combined hash of the configuration package and parameters.

  • complianceStatus - A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are compliant, nonCompliant and pending.

  • lastComplianceStatusChecked - Date and time, in RFC3339 format, when the machines compliance status was last checked.

  • latestReportId - The ID of the latest report for the guest configuration assignment.

Timeouts

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

  • read - (Defaults to 5 minutes) Used when retrieving the Guest Configuration Assignment.