Policy Args
data class PolicyArgs(val description: Output<String>? = null, val evaluatorType: Output<Either<String, PolicyEvaluatorType>>? = null, val factData: Output<String>? = null, val factName: Output<Either<String, PolicyFactName>>? = null, val labName: Output<String>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val policySetName: Output<String>? = null, val resourceGroupName: Output<String>? = null, val status: Output<Either<String, PolicyStatus>>? = null, val tags: Output<Map<String, String>>? = null, val threshold: Output<String>? = null) : ConvertibleToJava<PolicyArgs>
A Policy. Uses Azure REST API version 2018-09-15. In version 2.x of the Azure Native provider, it used API version 2018-09-15.
Example Usage
Policies_CreateOrUpdate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var policy = new AzureNative.DevTestLab.Policy("policy", new()
{
Description = "{policyDescription}",
EvaluatorType = "{policyEvaluatorType}",
FactData = "{policyFactData}",
FactName = "{policyFactName}",
LabName = "{labName}",
Location = "{location}",
Name = "{policyName}",
PolicySetName = "{policySetName}",
ResourceGroupName = "resourceGroupName",
Status = "{policyStatus}",
Tags =
{
{ "tagName1", "tagValue1" },
},
Threshold = "{policyThreshold}",
});
});
Content copied to clipboard
package main
import (
devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devtestlab.NewPolicy(ctx, "policy", &devtestlab.PolicyArgs{
Description: pulumi.String("{policyDescription}"),
EvaluatorType: pulumi.String("{policyEvaluatorType}"),
FactData: pulumi.String("{policyFactData}"),
FactName: pulumi.String("{policyFactName}"),
LabName: pulumi.String("{labName}"),
Location: pulumi.String("{location}"),
Name: pulumi.String("{policyName}"),
PolicySetName: pulumi.String("{policySetName}"),
ResourceGroupName: pulumi.String("resourceGroupName"),
Status: pulumi.String("{policyStatus}"),
Tags: pulumi.StringMap{
"tagName1": pulumi.String("tagValue1"),
},
Threshold: pulumi.String("{policyThreshold}"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.devtestlab.Policy;
import com.pulumi.azurenative.devtestlab.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 policy = new Policy("policy", PolicyArgs.builder()
.description("{policyDescription}")
.evaluatorType("{policyEvaluatorType}")
.factData("{policyFactData}")
.factName("{policyFactName}")
.labName("{labName}")
.location("{location}")
.name("{policyName}")
.policySetName("{policySetName}")
.resourceGroupName("resourceGroupName")
.status("{policyStatus}")
.tags(Map.of("tagName1", "tagValue1"))
.threshold("{policyThreshold}")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:devtestlab:Policy {labName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(description: Output<String>? = null, evaluatorType: Output<Either<String, PolicyEvaluatorType>>? = null, factData: Output<String>? = null, factName: Output<Either<String, PolicyFactName>>? = null, labName: Output<String>? = null, location: Output<String>? = null, name: Output<String>? = null, policySetName: Output<String>? = null, resourceGroupName: Output<String>? = null, status: Output<Either<String, PolicyStatus>>? = null, tags: Output<Map<String, String>>? = null, threshold: Output<String>? = null)
Properties
Link copied to clipboard
The description of the policy.
Link copied to clipboard
The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
Link copied to clipboard
The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
Link copied to clipboard
The name of the policy set.
Link copied to clipboard
The name of the resource group.
Link copied to clipboard
The status of the policy.