PolicyArgs

data class PolicyArgs(val description: Output<String>? = null, val evaluatorType: Output<String>? = null, val factData: Output<String>? = null, val labName: Output<String>? = null, val name: Output<String>? = null, val policySetName: Output<String>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val threshold: Output<String>? = null) : ConvertibleToJava<PolicyArgs>

Manages a Policy within a Dev Test Policy Set.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.devtest.Lab;
import com.pulumi.azure.devtest.LabArgs;
import com.pulumi.azure.devtest.Policy;
import com.pulumi.azure.devtest.PolicyArgs;
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) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleLab = new Lab("exampleLab", LabArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.tags(Map.of("Sydney", "Australia"))
.build());
var examplePolicy = new Policy("examplePolicy", PolicyArgs.builder()
.policySetName("default")
.labName(exampleLab.name())
.resourceGroupName(exampleResourceGroup.name())
.factData("")
.threshold("999")
.evaluatorType("MaxValuePolicy")
.tags(Map.of("Acceptance", "Test"))
.build());
}
}

Import

Dev Test Policies can be imported using the resource id, e.g.

$ pulumi import azure:devtest/policy:Policy policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevTestLab/labs/lab1/policySets/default/policies/policy1

Constructors

Link copied to clipboard
fun PolicyArgs(description: Output<String>? = null, evaluatorType: Output<String>? = null, factData: Output<String>? = null, labName: Output<String>? = null, name: Output<String>? = null, policySetName: Output<String>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, threshold: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): PolicyArgs

Properties

Link copied to clipboard
val description: Output<String>? = null

A description for the Policy.

Link copied to clipboard
val evaluatorType: Output<String>? = null

The Evaluation Type used for this Policy. Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy'. Changing this forces a new resource to be created.

Link copied to clipboard
val factData: Output<String>? = null

The Fact Data for this Policy.

Link copied to clipboard
val labName: Output<String>? = null

Specifies the name of the Dev Test Lab in which the Policy should be created. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>? = null

Specifies the name of the Dev Test Policy. Possible values are GalleryImage, LabPremiumVmCount, LabTargetCost, LabVmCount, LabVmSize, UserOwnedLabPremiumVmCount, UserOwnedLabVmCount and UserOwnedLabVmCountInSubnet. Changing this forces a new resource to be created.

Link copied to clipboard
val policySetName: Output<String>? = null

Specifies the name of the Policy Set within the Dev Test Lab where this policy should be created. Changing this forces a new resource to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val threshold: Output<String>? = null

The Threshold for this Policy.