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.
Other available API versions: 2016-05-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 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}")
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}",
});
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
The Policy resource accepts the following input properties:
- Lab
Name string - The name of the lab.
- Policy
Set stringName - The name of the policy set.
- Resource
Group stringName - The name of the resource group.
- Description string
- The description of the policy.
- Evaluator
Type string | Pulumi.Azure Native. Dev Test Lab. Policy Evaluator Type - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- Fact
Data string - The fact data of the policy.
- Fact
Name 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).
- Lab
Name string - The name of the lab.
- Policy
Set stringName - The name of the policy set.
- Resource
Group stringName - The name of the resource group.
- Description string
- The description of the policy.
- Evaluator
Type string | PolicyEvaluator Type - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- Fact
Data string - The fact data of the policy.
- Fact
Name 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 | Policy
Status - 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).
- lab
Name String - The name of the lab.
- policy
Set StringName - The name of the policy set.
- resource
Group StringName - The name of the resource group.
- description String
- The description of the policy.
- evaluator
Type String | PolicyEvaluator Type - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- fact
Data String - The fact data of the policy.
- fact
Name 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 | Policy
Status - 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).
- lab
Name string - The name of the lab.
- policy
Set stringName - The name of the policy set.
- resource
Group stringName - The name of the resource group.
- description string
- The description of the policy.
- evaluator
Type string | PolicyEvaluator Type - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- fact
Data string - The fact data of the policy.
- fact
Name 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 | Policy
Status - 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 | Policy
Status - 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).
- lab
Name String - The name of the lab.
- policy
Set StringName - The name of the policy set.
- resource
Group StringName - The name of the resource group.
- description String
- The description of the policy.
- evaluator
Type String | "AllowedValues Policy" | "Max Value Policy" - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
- fact
Data String - The fact data of the policy.
- fact
Name 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:
- Created
Date string - The creation date of the policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Provisioning
State string - The provisioning status of the resource.
- Type string
- The type of the resource.
- Unique
Identifier string - The unique immutable identifier of a resource (Guid).
- Created
Date string - The creation date of the policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Provisioning
State string - The provisioning status of the resource.
- Type string
- The type of the resource.
- Unique
Identifier string - The unique immutable identifier of a resource (Guid).
- created
Date String - The creation date of the policy.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioning
State String - The provisioning status of the resource.
- type String
- The type of the resource.
- unique
Identifier String - The unique immutable identifier of a resource (Guid).
- created
Date string - The creation date of the policy.
- id string
- The provider-assigned unique ID for this managed resource.
- provisioning
State string - The provisioning status of the resource.
- type string
- The type of the resource.
- unique
Identifier 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).
- created
Date String - The creation date of the policy.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioning
State String - The provisioning status of the resource.
- type String
- The type of the resource.
- unique
Identifier String - The unique immutable identifier of a resource (Guid).
Supporting Types
PolicyEvaluatorType, PolicyEvaluatorTypeArgs
- Allowed
Values Policy - AllowedValuesPolicy
- Max
Value Policy - MaxValuePolicy
- Policy
Evaluator Type Allowed Values Policy - AllowedValuesPolicy
- Policy
Evaluator Type Max Value Policy - MaxValuePolicy
- Allowed
Values Policy - AllowedValuesPolicy
- Max
Value Policy - MaxValuePolicy
- Allowed
Values Policy - AllowedValuesPolicy
- Max
Value Policy - MaxValuePolicy
- ALLOWED_VALUES_POLICY
- AllowedValuesPolicy
- MAX_VALUE_POLICY
- MaxValuePolicy
- "Allowed
Values Policy" - AllowedValuesPolicy
- "Max
Value Policy" - MaxValuePolicy
PolicyFactName, PolicyFactNameArgs
- 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
- Policy
Fact Name User Owned Lab Vm Count - UserOwnedLabVmCount
- Policy
Fact Name User Owned Lab Premium Vm Count - UserOwnedLabPremiumVmCount
- Policy
Fact Name Lab Vm Count - LabVmCount
- Policy
Fact Name Lab Premium Vm Count - LabPremiumVmCount
- Policy
Fact Name Lab Vm Size - LabVmSize
- Policy
Fact Name Gallery Image - GalleryImage
- Policy
Fact Name User Owned Lab Vm Count In Subnet - UserOwnedLabVmCountInSubnet
- Policy
Fact Name Lab Target Cost - LabTargetCost
- Policy
Fact Name Environment Template - EnvironmentTemplate
- Policy
Fact Name Schedule Edit 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
- 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
- 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
- "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
PolicyStatus, PolicyStatusArgs
- Enabled
- Enabled
- Disabled
- Disabled
- Policy
Status Enabled - Enabled
- Policy
Status 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