Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.policy.kotlin.PolicyFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.policy.kotlin
import com.pulumi.azure.policy.PolicyFunctions.getPolicyAssignmentPlain
import com.pulumi.azure.policy.PolicyFunctions.getPolicyDefintionBuiltInPlain
import com.pulumi.azure.policy.PolicyFunctions.getPolicyDefintionPlain
import com.pulumi.azure.policy.PolicyFunctions.getPolicySetDefinitionPlain
import com.pulumi.azure.policy.PolicyFunctions.getVirtualMachineConfigurationAssignmentPlain
import com.pulumi.azure.policy.kotlin.inputs.GetPolicyAssignmentPlainArgs
import com.pulumi.azure.policy.kotlin.inputs.GetPolicyAssignmentPlainArgsBuilder
import com.pulumi.azure.policy.kotlin.inputs.GetPolicyDefintionBuiltInPlainArgs
import com.pulumi.azure.policy.kotlin.inputs.GetPolicyDefintionBuiltInPlainArgsBuilder
import com.pulumi.azure.policy.kotlin.inputs.GetPolicyDefintionPlainArgs
import com.pulumi.azure.policy.kotlin.inputs.GetPolicyDefintionPlainArgsBuilder
import com.pulumi.azure.policy.kotlin.inputs.GetPolicySetDefinitionPlainArgs
import com.pulumi.azure.policy.kotlin.inputs.GetPolicySetDefinitionPlainArgsBuilder
import com.pulumi.azure.policy.kotlin.inputs.GetVirtualMachineConfigurationAssignmentPlainArgs
import com.pulumi.azure.policy.kotlin.inputs.GetVirtualMachineConfigurationAssignmentPlainArgsBuilder
import com.pulumi.azure.policy.kotlin.outputs.GetPolicyAssignmentResult
import com.pulumi.azure.policy.kotlin.outputs.GetPolicyDefintionBuiltInResult
import com.pulumi.azure.policy.kotlin.outputs.GetPolicyDefintionResult
import com.pulumi.azure.policy.kotlin.outputs.GetPolicySetDefinitionResult
import com.pulumi.azure.policy.kotlin.outputs.GetVirtualMachineConfigurationAssignmentResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.azure.policy.kotlin.outputs.GetPolicyAssignmentResult.Companion.toKotlin as getPolicyAssignmentResultToKotlin
import com.pulumi.azure.policy.kotlin.outputs.GetPolicyDefintionBuiltInResult.Companion.toKotlin as getPolicyDefintionBuiltInResultToKotlin
import com.pulumi.azure.policy.kotlin.outputs.GetPolicyDefintionResult.Companion.toKotlin as getPolicyDefintionResultToKotlin
import com.pulumi.azure.policy.kotlin.outputs.GetPolicySetDefinitionResult.Companion.toKotlin as getPolicySetDefinitionResultToKotlin
import com.pulumi.azure.policy.kotlin.outputs.GetVirtualMachineConfigurationAssignmentResult.Companion.toKotlin as getVirtualMachineConfigurationAssignmentResultToKotlin
public object PolicyFunctions {
/**
* Use this data source to access information about an existing Policy Assignment.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.policy.getPolicyAssignment({
* name: "existing",
* scopeId: exampleAzurermResourceGroup.id,
* });
* export const id = example.then(example => example.id);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.policy.get_policy_assignment(name="existing",
* scope_id=example_azurerm_resource_group["id"])
* pulumi.export("id", example.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Policy.GetPolicyAssignment.Invoke(new()
* {
* Name = "existing",
* ScopeId = exampleAzurermResourceGroup.Id,
* });
* return new Dictionary
* {
* ["id"] = example.Apply(getPolicyAssignmentResult => getPolicyAssignmentResult.Id),
* };
* });
* ```
* ```go
* 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.GetPolicyAssignment(ctx, &policy.GetPolicyAssignmentArgs{
* Name: "existing",
* ScopeId: exampleAzurermResourceGroup.Id,
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("id", example.Id)
* return nil
* })
* }
* ```
* ```java
* 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.GetPolicyAssignmentArgs;
* 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.getPolicyAssignment(GetPolicyAssignmentArgs.builder()
* .name("existing")
* .scopeId(exampleAzurermResourceGroup.id())
* .build());
* ctx.export("id", example.applyValue(getPolicyAssignmentResult -> getPolicyAssignmentResult.id()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:policy:getPolicyAssignment
* Arguments:
* name: existing
* scopeId: ${exampleAzurermResourceGroup.id}
* outputs:
* id: ${example.id}
* ```
*
* @param argument A collection of arguments for invoking getPolicyAssignment.
* @return A collection of values returned by getPolicyAssignment.
*/
public suspend fun getPolicyAssignment(argument: GetPolicyAssignmentPlainArgs): GetPolicyAssignmentResult =
getPolicyAssignmentResultToKotlin(getPolicyAssignmentPlain(argument.toJava()).await())
/**
* @see [getPolicyAssignment].
* @param name The name of this Policy Assignment. Changing this forces a new Policy Assignment to be created.
* @param scopeId The ID of the scope this Policy Assignment is assigned to. The `scope_id` can be a subscription id, a resource group id, a management group id, or an ID of any resource that is assigned with a policy. Changing this forces a new Policy Assignment to be created.
* @return A collection of values returned by getPolicyAssignment.
*/
public suspend fun getPolicyAssignment(name: String, scopeId: String): GetPolicyAssignmentResult {
val argument = GetPolicyAssignmentPlainArgs(
name = name,
scopeId = scopeId,
)
return getPolicyAssignmentResultToKotlin(getPolicyAssignmentPlain(argument.toJava()).await())
}
/**
* @see [getPolicyAssignment].
* @param argument Builder for [com.pulumi.azure.policy.kotlin.inputs.GetPolicyAssignmentPlainArgs].
* @return A collection of values returned by getPolicyAssignment.
*/
public suspend fun getPolicyAssignment(argument: suspend GetPolicyAssignmentPlainArgsBuilder.() -> Unit): GetPolicyAssignmentResult {
val builder = GetPolicyAssignmentPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getPolicyAssignmentResultToKotlin(getPolicyAssignmentPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.policy.getPolicyDefintion({
* displayName: "Allowed resource types",
* });
* export const id = example.then(example => example.id);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.policy.get_policy_defintion(display_name="Allowed resource types")
* pulumi.export("id", example.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Policy.GetPolicyDefintion.Invoke(new()
* {
* DisplayName = "Allowed resource types",
* });
* return new Dictionary
* {
* ["id"] = example.Apply(getPolicyDefintionResult => getPolicyDefintionResult.Id),
* };
* });
* ```
* ```go
* 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.GetPolicyDefintion(ctx, &policy.GetPolicyDefintionArgs{
* DisplayName: pulumi.StringRef("Allowed resource types"),
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("id", example.Id)
* return nil
* })
* }
* ```
* ```java
* 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.GetPolicyDefintionArgs;
* 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.getPolicyDefintion(GetPolicyDefintionArgs.builder()
* .displayName("Allowed resource types")
* .build());
* ctx.export("id", example.applyValue(getPolicyDefintionResult -> getPolicyDefintionResult.id()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:policy:getPolicyDefintion
* Arguments:
* displayName: Allowed resource types
* outputs:
* id: ${example.id}
* ```
*
* @param argument A collection of arguments for invoking getPolicyDefintion.
* @return A collection of values returned by getPolicyDefintion.
*/
public suspend fun getPolicyDefintion(argument: GetPolicyDefintionPlainArgs): GetPolicyDefintionResult =
getPolicyDefintionResultToKotlin(getPolicyDefintionPlain(argument.toJava()).await())
/**
* @see [getPolicyDefintion].
* @param displayName Specifies the display name of the Policy Definition. Conflicts with `name`.
* > **NOTE** Looking up policies by `display_name` is not recommended by the Azure Policy team as the property is not unique nor immutable. As such errors may occur when there are multiple policy definitions with same display name or the display name is changed. To avoid these types of errors you may wish to use the `name` property instead.
* @param managementGroupName Only retrieve Policy Definitions from this Management Group.
* @param name Specifies the name of the Policy Definition. Conflicts with `display_name`.
* @return A collection of values returned by getPolicyDefintion.
*/
public suspend fun getPolicyDefintion(
displayName: String? = null,
managementGroupName: String? = null,
name: String? = null,
): GetPolicyDefintionResult {
val argument = GetPolicyDefintionPlainArgs(
displayName = displayName,
managementGroupName = managementGroupName,
name = name,
)
return getPolicyDefintionResultToKotlin(getPolicyDefintionPlain(argument.toJava()).await())
}
/**
* @see [getPolicyDefintion].
* @param argument Builder for [com.pulumi.azure.policy.kotlin.inputs.GetPolicyDefintionPlainArgs].
* @return A collection of values returned by getPolicyDefintion.
*/
public suspend fun getPolicyDefintion(argument: suspend GetPolicyDefintionPlainArgsBuilder.() -> Unit): GetPolicyDefintionResult {
val builder = GetPolicyDefintionPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getPolicyDefintionResultToKotlin(getPolicyDefintionPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access information about a Built-In Policy Definition. Retrieves Policy Definitions from your current subscription by default.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.policy.getPolicyDefintionBuiltIn({
* displayName: "Allowed resource types",
* });
* export const id = example.then(example => example.id);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.policy.get_policy_defintion_built_in(display_name="Allowed resource types")
* pulumi.export("id", example.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Policy.GetPolicyDefintionBuiltIn.Invoke(new()
* {
* DisplayName = "Allowed resource types",
* });
* return new Dictionary
* {
* ["id"] = example.Apply(getPolicyDefintionBuiltInResult => getPolicyDefintionBuiltInResult.Id),
* };
* });
* ```
* ```go
* 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.GetPolicyDefintionBuiltIn(ctx, &policy.GetPolicyDefintionBuiltInArgs{
* DisplayName: pulumi.StringRef("Allowed resource types"),
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("id", example.Id)
* return nil
* })
* }
* ```
* ```java
* 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.GetPolicyDefintionBuiltInArgs;
* 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.getPolicyDefintionBuiltIn(GetPolicyDefintionBuiltInArgs.builder()
* .displayName("Allowed resource types")
* .build());
* ctx.export("id", example.applyValue(getPolicyDefintionBuiltInResult -> getPolicyDefintionBuiltInResult.id()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:policy:getPolicyDefintionBuiltIn
* Arguments:
* displayName: Allowed resource types
* outputs:
* id: ${example.id}
* ```
*
* @param argument A collection of arguments for invoking getPolicyDefintionBuiltIn.
* @return A collection of values returned by getPolicyDefintionBuiltIn.
*/
public suspend fun getPolicyDefintionBuiltIn(argument: GetPolicyDefintionBuiltInPlainArgs): GetPolicyDefintionBuiltInResult =
getPolicyDefintionBuiltInResultToKotlin(getPolicyDefintionBuiltInPlain(argument.toJava()).await())
/**
* @see [getPolicyDefintionBuiltIn].
* @param displayName Specifies the display name of the Policy Definition. Conflicts with `name`.
* > **NOTE** As `display_name` is not unique errors may occur when there are multiple policy definitions with same display name.
* @param managementGroupName Only retrieve Policy Definitions from this Management Group.
* @param name Specifies the name of the Policy Definition. Conflicts with `display_name`.
* @return A collection of values returned by getPolicyDefintionBuiltIn.
*/
public suspend fun getPolicyDefintionBuiltIn(
displayName: String? = null,
managementGroupName: String? = null,
name: String? = null,
): GetPolicyDefintionBuiltInResult {
val argument = GetPolicyDefintionBuiltInPlainArgs(
displayName = displayName,
managementGroupName = managementGroupName,
name = name,
)
return getPolicyDefintionBuiltInResultToKotlin(getPolicyDefintionBuiltInPlain(argument.toJava()).await())
}
/**
* @see [getPolicyDefintionBuiltIn].
* @param argument Builder for [com.pulumi.azure.policy.kotlin.inputs.GetPolicyDefintionBuiltInPlainArgs].
* @return A collection of values returned by getPolicyDefintionBuiltIn.
*/
public suspend fun getPolicyDefintionBuiltIn(argument: suspend GetPolicyDefintionBuiltInPlainArgsBuilder.() -> Unit): GetPolicyDefintionBuiltInResult {
val builder = GetPolicyDefintionBuiltInPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getPolicyDefintionBuiltInResultToKotlin(getPolicyDefintionBuiltInPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access information about an existing Policy Set Definition.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.policy.getPolicySetDefinition({
* displayName: "Policy Set Definition Example",
* });
* export const id = example.then(example => example.id);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.policy.get_policy_set_definition(display_name="Policy Set Definition Example")
* pulumi.export("id", example.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Policy.GetPolicySetDefinition.Invoke(new()
* {
* DisplayName = "Policy Set Definition Example",
* });
* return new Dictionary
* {
* ["id"] = example.Apply(getPolicySetDefinitionResult => getPolicySetDefinitionResult.Id),
* };
* });
* ```
* ```go
* 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.LookupPolicySetDefinition(ctx, &policy.LookupPolicySetDefinitionArgs{
* DisplayName: pulumi.StringRef("Policy Set Definition Example"),
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("id", example.Id)
* return nil
* })
* }
* ```
* ```java
* 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.GetPolicySetDefinitionArgs;
* 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.getPolicySetDefinition(GetPolicySetDefinitionArgs.builder()
* .displayName("Policy Set Definition Example")
* .build());
* ctx.export("id", example.applyValue(getPolicySetDefinitionResult -> getPolicySetDefinitionResult.id()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:policy:getPolicySetDefinition
* Arguments:
* displayName: Policy Set Definition Example
* outputs:
* id: ${example.id}
* ```
*
* @param argument A collection of arguments for invoking getPolicySetDefinition.
* @return A collection of values returned by getPolicySetDefinition.
*/
public suspend fun getPolicySetDefinition(argument: GetPolicySetDefinitionPlainArgs): GetPolicySetDefinitionResult =
getPolicySetDefinitionResultToKotlin(getPolicySetDefinitionPlain(argument.toJava()).await())
/**
* @see [getPolicySetDefinition].
* @param displayName Specifies the display name of the Policy Set Definition. Conflicts with `name`.
* **NOTE** As `display_name` is not unique errors may occur when there are multiple policy set definitions with same display name.
* @param managementGroupName Only retrieve Policy Set Definitions from this Management Group.
* @param name Specifies the name of the Policy Set Definition. Conflicts with `display_name`.
* @return A collection of values returned by getPolicySetDefinition.
*/
public suspend fun getPolicySetDefinition(
displayName: String? = null,
managementGroupName: String? = null,
name: String? = null,
): GetPolicySetDefinitionResult {
val argument = GetPolicySetDefinitionPlainArgs(
displayName = displayName,
managementGroupName = managementGroupName,
name = name,
)
return getPolicySetDefinitionResultToKotlin(getPolicySetDefinitionPlain(argument.toJava()).await())
}
/**
* @see [getPolicySetDefinition].
* @param argument Builder for [com.pulumi.azure.policy.kotlin.inputs.GetPolicySetDefinitionPlainArgs].
* @return A collection of values returned by getPolicySetDefinition.
*/
public suspend fun getPolicySetDefinition(argument: suspend GetPolicySetDefinitionPlainArgsBuilder.() -> Unit): GetPolicySetDefinitionResult {
val builder = GetPolicySetDefinitionPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getPolicySetDefinitionResultToKotlin(getPolicySetDefinitionPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access information about an existing Guest Configuration Policy.
* ## Example Usage
*
* ```typescript
* 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);
* ```
* ```python
* 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)
* ```
* ```csharp
* 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
* {
* ["complianceStatus"] = example.Apply(getVirtualMachineConfigurationAssignmentResult => getVirtualMachineConfigurationAssignmentResult.ComplianceStatus),
* };
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:policy:getVirtualMachineConfigurationAssignment
* Arguments:
* name: AzureWindowsBaseline
* resourceGroupName: example-RG
* virtualMachineName: example-vm
* outputs:
* complianceStatus: ${example.complianceStatus}
* ```
*
* @param argument A collection of arguments for invoking getVirtualMachineConfigurationAssignment.
* @return A collection of values returned by getVirtualMachineConfigurationAssignment.
*/
public suspend fun getVirtualMachineConfigurationAssignment(argument: GetVirtualMachineConfigurationAssignmentPlainArgs): GetVirtualMachineConfigurationAssignmentResult =
getVirtualMachineConfigurationAssignmentResultToKotlin(getVirtualMachineConfigurationAssignmentPlain(argument.toJava()).await())
/**
* @see [getVirtualMachineConfigurationAssignment].
* @param name Specifies the name of the Guest Configuration Assignment.
* @param resourceGroupName Specifies the Name of the Resource Group where the Guest Configuration Assignment exists.
* @param virtualMachineName Only retrieve Policy Set Definitions from this Management Group.
* @return A collection of values returned by getVirtualMachineConfigurationAssignment.
*/
public suspend fun getVirtualMachineConfigurationAssignment(
name: String,
resourceGroupName: String,
virtualMachineName: String,
): GetVirtualMachineConfigurationAssignmentResult {
val argument = GetVirtualMachineConfigurationAssignmentPlainArgs(
name = name,
resourceGroupName = resourceGroupName,
virtualMachineName = virtualMachineName,
)
return getVirtualMachineConfigurationAssignmentResultToKotlin(getVirtualMachineConfigurationAssignmentPlain(argument.toJava()).await())
}
/**
* @see [getVirtualMachineConfigurationAssignment].
* @param argument Builder for [com.pulumi.azure.policy.kotlin.inputs.GetVirtualMachineConfigurationAssignmentPlainArgs].
* @return A collection of values returned by getVirtualMachineConfigurationAssignment.
*/
public suspend fun getVirtualMachineConfigurationAssignment(argument: suspend GetVirtualMachineConfigurationAssignmentPlainArgsBuilder.() -> Unit): GetVirtualMachineConfigurationAssignmentResult {
val builder = GetVirtualMachineConfigurationAssignmentPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getVirtualMachineConfigurationAssignmentResultToKotlin(getVirtualMachineConfigurationAssignmentPlain(builtArgument.toJava()).await())
}
}