azure-native.devtestlab.Policy
Explore with Pulumi AI
A Policy. Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 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 * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const policy = new azure_native.devtestlab.Policy("policy", {
    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}",
});
import pulumi
import pulumi_azure_native as azure_native
policy = azure_native.devtestlab.Policy("policy",
    description="{policyDescription}",
    evaluator_type="{policyEvaluatorType}",
    fact_data="{policyFactData}",
    fact_name="{policyFactName}",
    lab_name="{labName}",
    location="{location}",
    name="{policyName}",
    policy_set_name="{policySetName}",
    resource_group_name="resourceGroupName",
    status="{policyStatus}",
    tags={
        "tagName1": "tagValue1",
    },
    threshold="{policyThreshold}")
resources:
  policy:
    type: azure-native:devtestlab:Policy
    properties:
      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}'
Create Policy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);@overload
def Policy(resource_name: str,
           args: PolicyArgs,
           opts: Optional[ResourceOptions] = None)
@overload
def Policy(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           lab_name: Optional[str] = None,
           policy_set_name: Optional[str] = None,
           resource_group_name: Optional[str] = None,
           description: Optional[str] = None,
           evaluator_type: Optional[Union[str, PolicyEvaluatorType]] = None,
           fact_data: Optional[str] = None,
           fact_name: Optional[Union[str, PolicyFactName]] = None,
           location: Optional[str] = None,
           name: Optional[str] = None,
           status: Optional[Union[str, PolicyStatus]] = None,
           tags: Optional[Mapping[str, str]] = None,
           threshold: Optional[str] = None)func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
public Policy(String name, PolicyArgs args)
public Policy(String name, PolicyArgs args, CustomResourceOptions options)
type: azure-native:devtestlab:Policy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplepolicyResourceResourceFromDevtestlab = new AzureNative.DevTestLab.Policy("examplepolicyResourceResourceFromDevtestlab", new()
{
    LabName = "string",
    PolicySetName = "string",
    ResourceGroupName = "string",
    Description = "string",
    EvaluatorType = "string",
    FactData = "string",
    FactName = "string",
    Location = "string",
    Name = "string",
    Status = "string",
    Tags = 
    {
        { "string", "string" },
    },
    Threshold = "string",
});
example, err := devtestlab.NewPolicy(ctx, "examplepolicyResourceResourceFromDevtestlab", &devtestlab.PolicyArgs{
	LabName:           pulumi.String("string"),
	PolicySetName:     pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	Description:       pulumi.String("string"),
	EvaluatorType:     pulumi.String("string"),
	FactData:          pulumi.String("string"),
	FactName:          pulumi.String("string"),
	Location:          pulumi.String("string"),
	Name:              pulumi.String("string"),
	Status:            pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Threshold: pulumi.String("string"),
})
var examplepolicyResourceResourceFromDevtestlab = new Policy("examplepolicyResourceResourceFromDevtestlab", PolicyArgs.builder()
    .labName("string")
    .policySetName("string")
    .resourceGroupName("string")
    .description("string")
    .evaluatorType("string")
    .factData("string")
    .factName("string")
    .location("string")
    .name("string")
    .status("string")
    .tags(Map.of("string", "string"))
    .threshold("string")
    .build());
examplepolicy_resource_resource_from_devtestlab = azure_native.devtestlab.Policy("examplepolicyResourceResourceFromDevtestlab",
    lab_name="string",
    policy_set_name="string",
    resource_group_name="string",
    description="string",
    evaluator_type="string",
    fact_data="string",
    fact_name="string",
    location="string",
    name="string",
    status="string",
    tags={
        "string": "string",
    },
    threshold="string")
const examplepolicyResourceResourceFromDevtestlab = new azure_native.devtestlab.Policy("examplepolicyResourceResourceFromDevtestlab", {
    labName: "string",
    policySetName: "string",
    resourceGroupName: "string",
    description: "string",
    evaluatorType: "string",
    factData: "string",
    factName: "string",
    location: "string",
    name: "string",
    status: "string",
    tags: {
        string: "string",
    },
    threshold: "string",
});
type: azure-native:devtestlab:Policy
properties:
    description: string
    evaluatorType: string
    factData: string
    factName: string
    labName: string
    location: string
    name: string
    policySetName: string
    resourceGroupName: string
    status: string
    tags:
        string: string
    threshold: string
Policy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Policy resource accepts the following input properties:
- LabName string
- The name of the lab.
- PolicySet stringName 
- The name of the policy set.
- ResourceGroup stringName 
- The name of the resource group.
- Description string
- The description of the policy.
- EvaluatorType string | Pulumi.Azure Native. Dev Test Lab. Policy Evaluator Type 
- The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- FactData string
- The fact data of the policy.
- FactName string | Pulumi.Azure Native. Dev Test Lab. Policy Fact Name 
- The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
- Location string
- The location of the resource.
- Name string
- The name of the policy.
- Status
string | Pulumi.Azure Native. Dev Test Lab. Policy Status 
- The status of the policy.
- Dictionary<string, string>
- The tags of the resource.
- Threshold string
- The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
- LabName string
- The name of the lab.
- PolicySet stringName 
- The name of the policy set.
- ResourceGroup stringName 
- The name of the resource group.
- Description string
- The description of the policy.
- EvaluatorType string | PolicyEvaluator Type 
- The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- FactData string
- The fact data of the policy.
- FactName string | PolicyFact Name 
- The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
- Location string
- The location of the resource.
- Name string
- The name of the policy.
- Status
string | PolicyStatus 
- The status of the policy.
- map[string]string
- The tags of the resource.
- Threshold string
- The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
- labName String
- The name of the lab.
- policySet StringName 
- The name of the policy set.
- resourceGroup StringName 
- The name of the resource group.
- description String
- The description of the policy.
- evaluatorType String | PolicyEvaluator Type 
- The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- factData String
- The fact data of the policy.
- factName String | PolicyFact Name 
- The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
- location String
- The location of the resource.
- name String
- The name of the policy.
- status
String | PolicyStatus 
- The status of the policy.
- Map<String,String>
- The tags of the resource.
- threshold String
- The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
- labName string
- The name of the lab.
- policySet stringName 
- The name of the policy set.
- resourceGroup stringName 
- The name of the resource group.
- description string
- The description of the policy.
- evaluatorType string | PolicyEvaluator Type 
- The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- factData string
- The fact data of the policy.
- factName string | PolicyFact Name 
- The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
- location string
- The location of the resource.
- name string
- The name of the policy.
- status
string | PolicyStatus 
- The status of the policy.
- {[key: string]: string}
- The tags of the resource.
- threshold string
- The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
- lab_name str
- The name of the lab.
- policy_set_ strname 
- The name of the policy set.
- resource_group_ strname 
- The name of the resource group.
- description str
- The description of the policy.
- evaluator_type str | PolicyEvaluator Type 
- The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- fact_data str
- The fact data of the policy.
- fact_name str | PolicyFact Name 
- The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
- location str
- The location of the resource.
- name str
- The name of the policy.
- status
str | PolicyStatus 
- The status of the policy.
- Mapping[str, str]
- The tags of the resource.
- threshold str
- The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
- labName String
- The name of the lab.
- policySet StringName 
- The name of the policy set.
- resourceGroup StringName 
- The name of the resource group.
- description String
- The description of the policy.
- evaluatorType String | "AllowedValues Policy" | "Max Value Policy" 
- The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- factData String
- The fact data of the policy.
- factName String | "UserOwned Lab Vm Count" | "User Owned Lab Premium Vm Count" | "Lab Vm Count" | "Lab Premium Vm Count" | "Lab Vm Size" | "Gallery Image" | "User Owned Lab Vm Count In Subnet" | "Lab Target Cost" | "Environment Template" | "Schedule Edit Permission" 
- The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
- location String
- The location of the resource.
- name String
- The name of the policy.
- status String | "Enabled" | "Disabled"
- The status of the policy.
- Map<String>
- The tags of the resource.
- threshold String
- The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
- CreatedDate string
- The creation date of the policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- ProvisioningState string
- The provisioning status of the resource.
- Type string
- The type of the resource.
- UniqueIdentifier string
- The unique immutable identifier of a resource (Guid).
- CreatedDate string
- The creation date of the policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- ProvisioningState string
- The provisioning status of the resource.
- Type string
- The type of the resource.
- UniqueIdentifier string
- The unique immutable identifier of a resource (Guid).
- createdDate String
- The creation date of the policy.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioningState String
- The provisioning status of the resource.
- type String
- The type of the resource.
- uniqueIdentifier String
- The unique immutable identifier of a resource (Guid).
- createdDate string
- The creation date of the policy.
- id string
- The provider-assigned unique ID for this managed resource.
- provisioningState string
- The provisioning status of the resource.
- type string
- The type of the resource.
- uniqueIdentifier string
- The unique immutable identifier of a resource (Guid).
- created_date str
- The creation date of the policy.
- id str
- The provider-assigned unique ID for this managed resource.
- provisioning_state str
- The provisioning status of the resource.
- type str
- The type of the resource.
- unique_identifier str
- The unique immutable identifier of a resource (Guid).
- createdDate String
- The creation date of the policy.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioningState String
- The provisioning status of the resource.
- type String
- The type of the resource.
- uniqueIdentifier String
- The unique immutable identifier of a resource (Guid).
Supporting Types
PolicyEvaluatorType, PolicyEvaluatorTypeArgs      
- AllowedValues Policy 
- AllowedValuesPolicy
- MaxValue Policy 
- MaxValuePolicy
- PolicyEvaluator Type Allowed Values Policy 
- AllowedValuesPolicy
- PolicyEvaluator Type Max Value Policy 
- MaxValuePolicy
- AllowedValues Policy 
- AllowedValuesPolicy
- MaxValue Policy 
- MaxValuePolicy
- AllowedValues Policy 
- AllowedValuesPolicy
- MaxValue Policy 
- MaxValuePolicy
- ALLOWED_VALUES_POLICY
- AllowedValuesPolicy
- MAX_VALUE_POLICY
- MaxValuePolicy
- "AllowedValues Policy" 
- AllowedValuesPolicy
- "MaxValue Policy" 
- MaxValuePolicy
PolicyFactName, PolicyFactNameArgs      
- UserOwned Lab Vm Count 
- UserOwnedLabVmCount
- UserOwned Lab Premium Vm Count 
- UserOwnedLabPremiumVmCount
- LabVm Count 
- LabVmCount
- LabPremium Vm Count 
- LabPremiumVmCount
- LabVm Size 
- LabVmSize
- GalleryImage 
- GalleryImage
- UserOwned Lab Vm Count In Subnet 
- UserOwnedLabVmCountInSubnet
- LabTarget Cost 
- LabTargetCost
- EnvironmentTemplate 
- EnvironmentTemplate
- ScheduleEdit Permission 
- ScheduleEditPermission
- PolicyFact Name User Owned Lab Vm Count 
- UserOwnedLabVmCount
- PolicyFact Name User Owned Lab Premium Vm Count 
- UserOwnedLabPremiumVmCount
- PolicyFact Name Lab Vm Count 
- LabVmCount
- PolicyFact Name Lab Premium Vm Count 
- LabPremiumVmCount
- PolicyFact Name Lab Vm Size 
- LabVmSize
- PolicyFact Name Gallery Image 
- GalleryImage
- PolicyFact Name User Owned Lab Vm Count In Subnet 
- UserOwnedLabVmCountInSubnet
- PolicyFact Name Lab Target Cost 
- LabTargetCost
- PolicyFact Name Environment Template 
- EnvironmentTemplate
- PolicyFact Name Schedule Edit Permission 
- ScheduleEditPermission
- UserOwned Lab Vm Count 
- UserOwnedLabVmCount
- UserOwned Lab Premium Vm Count 
- UserOwnedLabPremiumVmCount
- LabVm Count 
- LabVmCount
- LabPremium Vm Count 
- LabPremiumVmCount
- LabVm Size 
- LabVmSize
- GalleryImage 
- GalleryImage
- UserOwned Lab Vm Count In Subnet 
- UserOwnedLabVmCountInSubnet
- LabTarget Cost 
- LabTargetCost
- EnvironmentTemplate 
- EnvironmentTemplate
- ScheduleEdit Permission 
- ScheduleEditPermission
- UserOwned Lab Vm Count 
- UserOwnedLabVmCount
- UserOwned Lab Premium Vm Count 
- UserOwnedLabPremiumVmCount
- LabVm Count 
- LabVmCount
- LabPremium Vm Count 
- LabPremiumVmCount
- LabVm Size 
- LabVmSize
- GalleryImage 
- GalleryImage
- UserOwned Lab Vm Count In Subnet 
- UserOwnedLabVmCountInSubnet
- LabTarget Cost 
- LabTargetCost
- EnvironmentTemplate 
- EnvironmentTemplate
- ScheduleEdit Permission 
- ScheduleEditPermission
- USER_OWNED_LAB_VM_COUNT
- UserOwnedLabVmCount
- USER_OWNED_LAB_PREMIUM_VM_COUNT
- UserOwnedLabPremiumVmCount
- LAB_VM_COUNT
- LabVmCount
- LAB_PREMIUM_VM_COUNT
- LabPremiumVmCount
- LAB_VM_SIZE
- LabVmSize
- GALLERY_IMAGE
- GalleryImage
- USER_OWNED_LAB_VM_COUNT_IN_SUBNET
- UserOwnedLabVmCountInSubnet
- LAB_TARGET_COST
- LabTargetCost
- ENVIRONMENT_TEMPLATE
- EnvironmentTemplate
- SCHEDULE_EDIT_PERMISSION
- ScheduleEditPermission
- "UserOwned Lab Vm Count" 
- UserOwnedLabVmCount
- "UserOwned Lab Premium Vm Count" 
- UserOwnedLabPremiumVmCount
- "LabVm Count" 
- LabVmCount
- "LabPremium Vm Count" 
- LabPremiumVmCount
- "LabVm Size" 
- LabVmSize
- "GalleryImage" 
- GalleryImage
- "UserOwned Lab Vm Count In Subnet" 
- UserOwnedLabVmCountInSubnet
- "LabTarget Cost" 
- LabTargetCost
- "EnvironmentTemplate" 
- EnvironmentTemplate
- "ScheduleEdit Permission" 
- ScheduleEditPermission
PolicyStatus, PolicyStatusArgs    
- Enabled
- Enabled
- Disabled
- Disabled
- PolicyStatus Enabled 
- Enabled
- PolicyStatus Disabled 
- Disabled
- Enabled
- Enabled
- Disabled
- Disabled
- Enabled
- Enabled
- Disabled
- Disabled
- ENABLED
- Enabled
- DISABLED
- Disabled
- "Enabled"
- Enabled
- "Disabled"
- Disabled
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} 
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0