1. Packages
  2. Azure Classic
  3. API Docs
  4. policy
  5. getVirtualMachineConfigurationAssignment

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.policy.getVirtualMachineConfigurationAssignment

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.policy.getVirtualMachineConfigurationAssignment({
        name: "AzureWindowsBaseline",
        resourceGroupName: "example-RG",
        virtualMachineName: "example-vm",
    });
    export const complianceStatus = example.then(example => example.complianceStatus);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.policy.get_virtual_machine_configuration_assignment(name="AzureWindowsBaseline",
        resource_group_name="example-RG",
        virtual_machine_name="example-vm")
    pulumi.export("complianceStatus", example.compliance_status)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := policy.LookupVirtualMachineConfigurationAssignment(ctx, &policy.LookupVirtualMachineConfigurationAssignmentArgs{
    			Name:               "AzureWindowsBaseline",
    			ResourceGroupName:  "example-RG",
    			VirtualMachineName: "example-vm",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("complianceStatus", example.ComplianceStatus)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.Policy.GetVirtualMachineConfigurationAssignment.Invoke(new()
        {
            Name = "AzureWindowsBaseline",
            ResourceGroupName = "example-RG",
            VirtualMachineName = "example-vm",
        });
    
        return new Dictionary<string, object?>
        {
            ["complianceStatus"] = example.Apply(getVirtualMachineConfigurationAssignmentResult => getVirtualMachineConfigurationAssignmentResult.ComplianceStatus),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.policy.PolicyFunctions;
    import com.pulumi.azure.policy.inputs.GetVirtualMachineConfigurationAssignmentArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = PolicyFunctions.getVirtualMachineConfigurationAssignment(GetVirtualMachineConfigurationAssignmentArgs.builder()
                .name("AzureWindowsBaseline")
                .resourceGroupName("example-RG")
                .virtualMachineName("example-vm")
                .build());
    
            ctx.export("complianceStatus", example.applyValue(getVirtualMachineConfigurationAssignmentResult -> getVirtualMachineConfigurationAssignmentResult.complianceStatus()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:policy:getVirtualMachineConfigurationAssignment
          Arguments:
            name: AzureWindowsBaseline
            resourceGroupName: example-RG
            virtualMachineName: example-vm
    outputs:
      complianceStatus: ${example.complianceStatus}
    

    Using getVirtualMachineConfigurationAssignment

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getVirtualMachineConfigurationAssignment(args: GetVirtualMachineConfigurationAssignmentArgs, opts?: InvokeOptions): Promise<GetVirtualMachineConfigurationAssignmentResult>
    function getVirtualMachineConfigurationAssignmentOutput(args: GetVirtualMachineConfigurationAssignmentOutputArgs, opts?: InvokeOptions): Output<GetVirtualMachineConfigurationAssignmentResult>
    def get_virtual_machine_configuration_assignment(name: Optional[str] = None,
                                                     resource_group_name: Optional[str] = None,
                                                     virtual_machine_name: Optional[str] = None,
                                                     opts: Optional[InvokeOptions] = None) -> GetVirtualMachineConfigurationAssignmentResult
    def get_virtual_machine_configuration_assignment_output(name: Optional[pulumi.Input[str]] = None,
                                                     resource_group_name: Optional[pulumi.Input[str]] = None,
                                                     virtual_machine_name: Optional[pulumi.Input[str]] = None,
                                                     opts: Optional[InvokeOptions] = None) -> Output[GetVirtualMachineConfigurationAssignmentResult]
    func LookupVirtualMachineConfigurationAssignment(ctx *Context, args *LookupVirtualMachineConfigurationAssignmentArgs, opts ...InvokeOption) (*LookupVirtualMachineConfigurationAssignmentResult, error)
    func LookupVirtualMachineConfigurationAssignmentOutput(ctx *Context, args *LookupVirtualMachineConfigurationAssignmentOutputArgs, opts ...InvokeOption) LookupVirtualMachineConfigurationAssignmentResultOutput

    > Note: This function is named LookupVirtualMachineConfigurationAssignment in the Go SDK.

    public static class GetVirtualMachineConfigurationAssignment 
    {
        public static Task<GetVirtualMachineConfigurationAssignmentResult> InvokeAsync(GetVirtualMachineConfigurationAssignmentArgs args, InvokeOptions? opts = null)
        public static Output<GetVirtualMachineConfigurationAssignmentResult> Invoke(GetVirtualMachineConfigurationAssignmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVirtualMachineConfigurationAssignmentResult> getVirtualMachineConfigurationAssignment(GetVirtualMachineConfigurationAssignmentArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:policy/getVirtualMachineConfigurationAssignment:getVirtualMachineConfigurationAssignment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the name of the Guest Configuration Assignment.
    ResourceGroupName string
    Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
    VirtualMachineName string
    Only retrieve Policy Set Definitions from this Management Group.
    Name string
    Specifies the name of the Guest Configuration Assignment.
    ResourceGroupName string
    Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
    VirtualMachineName string
    Only retrieve Policy Set Definitions from this Management Group.
    name String
    Specifies the name of the Guest Configuration Assignment.
    resourceGroupName String
    Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
    virtualMachineName String
    Only retrieve Policy Set Definitions from this Management Group.
    name string
    Specifies the name of the Guest Configuration Assignment.
    resourceGroupName string
    Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
    virtualMachineName string
    Only retrieve Policy Set Definitions from this Management Group.
    name str
    Specifies the name of the Guest Configuration Assignment.
    resource_group_name str
    Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
    virtual_machine_name str
    Only retrieve Policy Set Definitions from this Management Group.
    name String
    Specifies the name of the Guest Configuration Assignment.
    resourceGroupName String
    Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
    virtualMachineName String
    Only retrieve Policy Set Definitions from this Management Group.

    getVirtualMachineConfigurationAssignment Result

    The following output properties are available:

    AssignmentHash string
    Combined hash of the configuration package and parameters.
    ComplianceStatus string
    A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are Compliant, NonCompliant and Pending.
    ContentHash string
    The content hash for the Guest Configuration package.
    ContentUri string
    The content URI where the Guest Configuration package is stored.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastComplianceStatusChecked string
    Date and time, in RFC3339 format, when the machines compliance status was last checked.
    LatestReportId string
    The ID of the latest report for the guest configuration assignment.
    Name string
    ResourceGroupName string
    VirtualMachineName string
    AssignmentHash string
    Combined hash of the configuration package and parameters.
    ComplianceStatus string
    A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are Compliant, NonCompliant and Pending.
    ContentHash string
    The content hash for the Guest Configuration package.
    ContentUri string
    The content URI where the Guest Configuration package is stored.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastComplianceStatusChecked string
    Date and time, in RFC3339 format, when the machines compliance status was last checked.
    LatestReportId string
    The ID of the latest report for the guest configuration assignment.
    Name string
    ResourceGroupName string
    VirtualMachineName string
    assignmentHash String
    Combined hash of the configuration package and parameters.
    complianceStatus String
    A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are Compliant, NonCompliant and Pending.
    contentHash String
    The content hash for the Guest Configuration package.
    contentUri String
    The content URI where the Guest Configuration package is stored.
    id String
    The provider-assigned unique ID for this managed resource.
    lastComplianceStatusChecked String
    Date and time, in RFC3339 format, when the machines compliance status was last checked.
    latestReportId String
    The ID of the latest report for the guest configuration assignment.
    name String
    resourceGroupName String
    virtualMachineName String
    assignmentHash string
    Combined hash of the configuration package and parameters.
    complianceStatus string
    A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are Compliant, NonCompliant and Pending.
    contentHash string
    The content hash for the Guest Configuration package.
    contentUri string
    The content URI where the Guest Configuration package is stored.
    id string
    The provider-assigned unique ID for this managed resource.
    lastComplianceStatusChecked string
    Date and time, in RFC3339 format, when the machines compliance status was last checked.
    latestReportId string
    The ID of the latest report for the guest configuration assignment.
    name string
    resourceGroupName string
    virtualMachineName string
    assignment_hash str
    Combined hash of the configuration package and parameters.
    compliance_status str
    A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are Compliant, NonCompliant and Pending.
    content_hash str
    The content hash for the Guest Configuration package.
    content_uri str
    The content URI where the Guest Configuration package is stored.
    id str
    The provider-assigned unique ID for this managed resource.
    last_compliance_status_checked str
    Date and time, in RFC3339 format, when the machines compliance status was last checked.
    latest_report_id str
    The ID of the latest report for the guest configuration assignment.
    name str
    resource_group_name str
    virtual_machine_name str
    assignmentHash String
    Combined hash of the configuration package and parameters.
    complianceStatus String
    A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are Compliant, NonCompliant and Pending.
    contentHash String
    The content hash for the Guest Configuration package.
    contentUri String
    The content URI where the Guest Configuration package is stored.
    id String
    The provider-assigned unique ID for this managed resource.
    lastComplianceStatusChecked String
    Date and time, in RFC3339 format, when the machines compliance status was last checked.
    latestReportId String
    The ID of the latest report for the guest configuration assignment.
    name String
    resourceGroupName String
    virtualMachineName String

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi