Policy

class Policy : KotlinCustomResource

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}",
});
});
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
})
}
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());
}
}

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}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val createdDate: Output<String>

The creation date of the policy.

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

The description of the policy.

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

The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).

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

The fact data of the policy.

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

The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>?

The location of the resource.

Link copied to clipboard
val name: Output<String>

The name of the resource.

Link copied to clipboard

The provisioning status of the resource.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val status: Output<String>?

The status of the policy.

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

The tags of the resource.

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

The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).

Link copied to clipboard
val type: Output<String>

The type of the resource.

Link copied to clipboard

The unique immutable identifier of a resource (Guid).

Link copied to clipboard
val urn: Output<String>