Policy

class Policy : KotlinCustomResource

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

Properties

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

A description for the Policy.

Link copied to clipboard
val evaluatorType: Output<String>

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>?

The Fact Data for this Policy.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val labName: Output<String>

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>

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>

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val threshold: Output<String>

The Threshold for this Policy.

Link copied to clipboard
val urn: Output<String>