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
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.
- Resource
Group stringName - Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
- Virtual
Machine stringName - Only retrieve Policy Set Definitions from this Management Group.
- Name string
- Specifies the name of the Guest Configuration Assignment.
- Resource
Group stringName - Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
- Virtual
Machine stringName - Only retrieve Policy Set Definitions from this Management Group.
- name String
- Specifies the name of the Guest Configuration Assignment.
- resource
Group StringName - Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
- virtual
Machine StringName - Only retrieve Policy Set Definitions from this Management Group.
- name string
- Specifies the name of the Guest Configuration Assignment.
- resource
Group stringName - Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
- virtual
Machine stringName - Only retrieve Policy Set Definitions from this Management Group.
- name str
- Specifies the name of the Guest Configuration Assignment.
- resource_
group_ strname - Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
- virtual_
machine_ strname - Only retrieve Policy Set Definitions from this Management Group.
- name String
- Specifies the name of the Guest Configuration Assignment.
- resource
Group StringName - Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
- virtual
Machine StringName - Only retrieve Policy Set Definitions from this Management Group.
getVirtualMachineConfigurationAssignment Result
The following output properties are available:
- Assignment
Hash string - Combined hash of the configuration package and parameters.
- Compliance
Status string - A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are
Compliant
,NonCompliant
andPending
. - Content
Hash string - The content hash for the Guest Configuration package.
- Content
Uri string - The content URI where the Guest Configuration package is stored.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Compliance stringStatus Checked - Date and time, in RFC3339 format, when the machines compliance status was last checked.
- Latest
Report stringId - The ID of the latest report for the guest configuration assignment.
- Name string
- Resource
Group stringName - Virtual
Machine stringName
- Assignment
Hash string - Combined hash of the configuration package and parameters.
- Compliance
Status string - A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are
Compliant
,NonCompliant
andPending
. - Content
Hash string - The content hash for the Guest Configuration package.
- Content
Uri string - The content URI where the Guest Configuration package is stored.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Compliance stringStatus Checked - Date and time, in RFC3339 format, when the machines compliance status was last checked.
- Latest
Report stringId - The ID of the latest report for the guest configuration assignment.
- Name string
- Resource
Group stringName - Virtual
Machine stringName
- assignment
Hash String - Combined hash of the configuration package and parameters.
- compliance
Status String - A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are
Compliant
,NonCompliant
andPending
. - content
Hash String - The content hash for the Guest Configuration package.
- content
Uri String - The content URI where the Guest Configuration package is stored.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Compliance StringStatus Checked - Date and time, in RFC3339 format, when the machines compliance status was last checked.
- latest
Report StringId - The ID of the latest report for the guest configuration assignment.
- name String
- resource
Group StringName - virtual
Machine StringName
- assignment
Hash string - Combined hash of the configuration package and parameters.
- compliance
Status string - A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are
Compliant
,NonCompliant
andPending
. - content
Hash string - The content hash for the Guest Configuration package.
- content
Uri string - The content URI where the Guest Configuration package is stored.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Compliance stringStatus Checked - Date and time, in RFC3339 format, when the machines compliance status was last checked.
- latest
Report stringId - The ID of the latest report for the guest configuration assignment.
- name string
- resource
Group stringName - virtual
Machine stringName
- 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
andPending
. - 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_ strstatus_ checked - Date and time, in RFC3339 format, when the machines compliance status was last checked.
- latest_
report_ strid - The ID of the latest report for the guest configuration assignment.
- name str
- resource_
group_ strname - virtual_
machine_ strname
- assignment
Hash String - Combined hash of the configuration package and parameters.
- compliance
Status String - A value indicating compliance status of the machine for the assigned guest configuration. Possible return values are
Compliant
,NonCompliant
andPending
. - content
Hash String - The content hash for the Guest Configuration package.
- content
Uri String - The content URI where the Guest Configuration package is stored.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Compliance StringStatus Checked - Date and time, in RFC3339 format, when the machines compliance status was last checked.
- latest
Report StringId - The ID of the latest report for the guest configuration assignment.
- name String
- resource
Group StringName - virtual
Machine StringName
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.