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

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleLab = new azure.devtest.Lab("example", {
name: "example-devtestlab",
location: example.location,
resourceGroupName: example.name,
tags: {
Sydney: "Australia",
},
});
const examplePolicy = new azure.devtest.Policy("example", {
name: "LabVmCount",
policySetName: "default",
labName: exampleLab.name,
resourceGroupName: example.name,
factData: "",
threshold: "999",
evaluatorType: "MaxValuePolicy",
tags: {
Acceptance: "Test",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_lab = azure.devtest.Lab("example",
name="example-devtestlab",
location=example.location,
resource_group_name=example.name,
tags={
"Sydney": "Australia",
})
example_policy = azure.devtest.Policy("example",
name="LabVmCount",
policy_set_name="default",
lab_name=example_lab.name,
resource_group_name=example.name,
fact_data="",
threshold="999",
evaluator_type="MaxValuePolicy",
tags={
"Acceptance": "Test",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleLab = new Azure.DevTest.Lab("example", new()
{
Name = "example-devtestlab",
Location = example.Location,
ResourceGroupName = example.Name,
Tags =
{
{ "Sydney", "Australia" },
},
});
var examplePolicy = new Azure.DevTest.Policy("example", new()
{
Name = "LabVmCount",
PolicySetName = "default",
LabName = exampleLab.Name,
ResourceGroupName = example.Name,
FactData = "",
Threshold = "999",
EvaluatorType = "MaxValuePolicy",
Tags =
{
{ "Acceptance", "Test" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/devtest"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleLab, err := devtest.NewLab(ctx, "example", &devtest.LabArgs{
Name: pulumi.String("example-devtestlab"),
Location: example.Location,
ResourceGroupName: example.Name,
Tags: pulumi.StringMap{
"Sydney": pulumi.String("Australia"),
},
})
if err != nil {
return err
}
_, err = devtest.NewPolicy(ctx, "example", &devtest.PolicyArgs{
Name: pulumi.String("LabVmCount"),
PolicySetName: pulumi.String("default"),
LabName: exampleLab.Name,
ResourceGroupName: example.Name,
FactData: pulumi.String(""),
Threshold: pulumi.String("999"),
EvaluatorType: pulumi.String("MaxValuePolicy"),
Tags: pulumi.StringMap{
"Acceptance": pulumi.String("Test"),
},
})
if err != nil {
return err
}
return nil
})
}
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleLab = new Lab("exampleLab", LabArgs.builder()
.name("example-devtestlab")
.location(example.location())
.resourceGroupName(example.name())
.tags(Map.of("Sydney", "Australia"))
.build());
var examplePolicy = new Policy("examplePolicy", PolicyArgs.builder()
.name("LabVmCount")
.policySetName("default")
.labName(exampleLab.name())
.resourceGroupName(example.name())
.factData("")
.threshold("999")
.evaluatorType("MaxValuePolicy")
.tags(Map.of("Acceptance", "Test"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleLab:
type: azure:devtest:Lab
name: example
properties:
name: example-devtestlab
location: ${example.location}
resourceGroupName: ${example.name}
tags:
Sydney: Australia
examplePolicy:
type: azure:devtest:Policy
name: example
properties:
name: LabVmCount
policySetName: default
labName: ${exampleLab.name}
resourceGroupName: ${example.name}
factData: ""
threshold: '999'
evaluatorType: MaxValuePolicy
tags:
Acceptance: Test

API Providers

This resource uses the following Azure API Providers:

  • Microsoft.DevTestLab: 2018-09-15

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
constructor(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)

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.

Functions

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