cloudflare logo
Cloudflare v4.15.0, Jan 10 23

cloudflare.DeviceSettingsPolicy

Provides a Cloudflare Device Settings Policy resource. Device policies configure settings applied to WARP devices.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var developerWarpPolicy = new Cloudflare.DeviceSettingsPolicy("developerWarpPolicy", new()
    {
        AccountId = "f037e56e89293a057740de681ac9abbe",
        AllowModeSwitch = true,
        AllowUpdates = true,
        AllowedToLeave = true,
        AutoConnect = 0,
        CaptivePortal = 5,
        Default = false,
        DisableAutoFallback = true,
        Enabled = true,
        Match = "any(identity.groups.name[*] in {\"Developers\"})",
        Name = "Developers WARP settings policy",
        Precedence = 10,
        ServiceModeV2Mode = "warp",
        ServiceModeV2Port = 3000,
        SupportUrl = "https://cloudflare.com",
        SwitchLocked = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v4/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewDeviceSettingsPolicy(ctx, "developerWarpPolicy", &cloudflare.DeviceSettingsPolicyArgs{
			AccountId:           pulumi.String("f037e56e89293a057740de681ac9abbe"),
			AllowModeSwitch:     pulumi.Bool(true),
			AllowUpdates:        pulumi.Bool(true),
			AllowedToLeave:      pulumi.Bool(true),
			AutoConnect:         pulumi.Int(0),
			CaptivePortal:       pulumi.Int(5),
			Default:             pulumi.Bool(false),
			DisableAutoFallback: pulumi.Bool(true),
			Enabled:             pulumi.Bool(true),
			Match:               pulumi.String("any(identity.groups.name[*] in {\"Developers\"})"),
			Name:                pulumi.String("Developers WARP settings policy"),
			Precedence:          pulumi.Int(10),
			ServiceModeV2Mode:   pulumi.String("warp"),
			ServiceModeV2Port:   pulumi.Int(3000),
			SupportUrl:          pulumi.String("https://cloudflare.com"),
			SwitchLocked:        pulumi.Bool(true),
		})
		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.cloudflare.DeviceSettingsPolicy;
import com.pulumi.cloudflare.DeviceSettingsPolicyArgs;
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 developerWarpPolicy = new DeviceSettingsPolicy("developerWarpPolicy", DeviceSettingsPolicyArgs.builder()        
            .accountId("f037e56e89293a057740de681ac9abbe")
            .allowModeSwitch(true)
            .allowUpdates(true)
            .allowedToLeave(true)
            .autoConnect(0)
            .captivePortal(5)
            .default_(false)
            .disableAutoFallback(true)
            .enabled(true)
            .match("any(identity.groups.name[*] in {\"Developers\"})")
            .name("Developers WARP settings policy")
            .precedence(10)
            .serviceModeV2Mode("warp")
            .serviceModeV2Port(3000)
            .supportUrl("https://cloudflare.com")
            .switchLocked(true)
            .build());

    }
}
import pulumi
import pulumi_cloudflare as cloudflare

developer_warp_policy = cloudflare.DeviceSettingsPolicy("developerWarpPolicy",
    account_id="f037e56e89293a057740de681ac9abbe",
    allow_mode_switch=True,
    allow_updates=True,
    allowed_to_leave=True,
    auto_connect=0,
    captive_portal=5,
    default=False,
    disable_auto_fallback=True,
    enabled=True,
    match="any(identity.groups.name[*] in {\"Developers\"})",
    name="Developers WARP settings policy",
    precedence=10,
    service_mode_v2_mode="warp",
    service_mode_v2_port=3000,
    support_url="https://cloudflare.com",
    switch_locked=True)
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const developerWarpPolicy = new cloudflare.DeviceSettingsPolicy("developerWarpPolicy", {
    accountId: "f037e56e89293a057740de681ac9abbe",
    allowModeSwitch: true,
    allowUpdates: true,
    allowedToLeave: true,
    autoConnect: 0,
    captivePortal: 5,
    "default": false,
    disableAutoFallback: true,
    enabled: true,
    match: "any(identity.groups.name[*] in {\"Developers\"})",
    name: "Developers WARP settings policy",
    precedence: 10,
    serviceModeV2Mode: "warp",
    serviceModeV2Port: 3000,
    supportUrl: "https://cloudflare.com",
    switchLocked: true,
});
resources:
  developerWarpPolicy:
    type: cloudflare:DeviceSettingsPolicy
    properties:
      accountId: f037e56e89293a057740de681ac9abbe
      allowModeSwitch: true
      allowUpdates: true
      allowedToLeave: true
      autoConnect: 0
      captivePortal: 5
      default: false
      disableAutoFallback: true
      enabled: true
      match: any(identity.groups.name[*] in {"Developers"})
      name: Developers WARP settings policy
      precedence: 10
      serviceModeV2Mode: warp
      serviceModeV2Port: 3000
      supportUrl: https://cloudflare.com
      switchLocked: true

Create DeviceSettingsPolicy Resource

new DeviceSettingsPolicy(name: string, args: DeviceSettingsPolicyArgs, opts?: CustomResourceOptions);
@overload
def DeviceSettingsPolicy(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         account_id: Optional[str] = None,
                         allow_mode_switch: Optional[bool] = None,
                         allow_updates: Optional[bool] = None,
                         allowed_to_leave: Optional[bool] = None,
                         auto_connect: Optional[int] = None,
                         captive_portal: Optional[int] = None,
                         default: Optional[bool] = None,
                         disable_auto_fallback: Optional[bool] = None,
                         enabled: Optional[bool] = None,
                         match: Optional[str] = None,
                         name: Optional[str] = None,
                         precedence: Optional[int] = None,
                         service_mode_v2_mode: Optional[str] = None,
                         service_mode_v2_port: Optional[int] = None,
                         support_url: Optional[str] = None,
                         switch_locked: Optional[bool] = None)
@overload
def DeviceSettingsPolicy(resource_name: str,
                         args: DeviceSettingsPolicyArgs,
                         opts: Optional[ResourceOptions] = None)
func NewDeviceSettingsPolicy(ctx *Context, name string, args DeviceSettingsPolicyArgs, opts ...ResourceOption) (*DeviceSettingsPolicy, error)
public DeviceSettingsPolicy(string name, DeviceSettingsPolicyArgs args, CustomResourceOptions? opts = null)
public DeviceSettingsPolicy(String name, DeviceSettingsPolicyArgs args)
public DeviceSettingsPolicy(String name, DeviceSettingsPolicyArgs args, CustomResourceOptions options)
type: cloudflare:DeviceSettingsPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DeviceSettingsPolicyArgs
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 DeviceSettingsPolicyArgs
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 DeviceSettingsPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DeviceSettingsPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DeviceSettingsPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DeviceSettingsPolicy 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 DeviceSettingsPolicy resource accepts the following input properties:

AccountId string

The account identifier to target for the resource.

Name string

Name of the policy.

AllowModeSwitch bool

Whether to allow mode switch for this policy.

AllowUpdates bool

Whether to allow updates under this policy.

AllowedToLeave bool

Whether to allow devices to leave the organization. Defaults to true.

AutoConnect int

The amount of time in minutes to reconnect after having been disabled.

CaptivePortal int

The captive portal value for this policy. Defaults to 180.

Default bool

Whether the policy refers to the default account policy.

DisableAutoFallback bool

Whether to disable auto fallback for this policy.

Enabled bool

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

Match string

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

Precedence int

The precedence of the policy. Lower values indicate higher precedence.

ServiceModeV2Mode string

The service mode. Defaults to warp.

ServiceModeV2Port int

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

SupportUrl string

The support URL that will be opened when sending feedback.

SwitchLocked bool

Enablement of the ZT client switch lock.

AccountId string

The account identifier to target for the resource.

Name string

Name of the policy.

AllowModeSwitch bool

Whether to allow mode switch for this policy.

AllowUpdates bool

Whether to allow updates under this policy.

AllowedToLeave bool

Whether to allow devices to leave the organization. Defaults to true.

AutoConnect int

The amount of time in minutes to reconnect after having been disabled.

CaptivePortal int

The captive portal value for this policy. Defaults to 180.

Default bool

Whether the policy refers to the default account policy.

DisableAutoFallback bool

Whether to disable auto fallback for this policy.

Enabled bool

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

Match string

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

Precedence int

The precedence of the policy. Lower values indicate higher precedence.

ServiceModeV2Mode string

The service mode. Defaults to warp.

ServiceModeV2Port int

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

SupportUrl string

The support URL that will be opened when sending feedback.

SwitchLocked bool

Enablement of the ZT client switch lock.

accountId String

The account identifier to target for the resource.

name String

Name of the policy.

allowModeSwitch Boolean

Whether to allow mode switch for this policy.

allowUpdates Boolean

Whether to allow updates under this policy.

allowedToLeave Boolean

Whether to allow devices to leave the organization. Defaults to true.

autoConnect Integer

The amount of time in minutes to reconnect after having been disabled.

captivePortal Integer

The captive portal value for this policy. Defaults to 180.

default_ Boolean

Whether the policy refers to the default account policy.

disableAutoFallback Boolean

Whether to disable auto fallback for this policy.

enabled Boolean

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

match String

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

precedence Integer

The precedence of the policy. Lower values indicate higher precedence.

serviceModeV2Mode String

The service mode. Defaults to warp.

serviceModeV2Port Integer

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

supportUrl String

The support URL that will be opened when sending feedback.

switchLocked Boolean

Enablement of the ZT client switch lock.

accountId string

The account identifier to target for the resource.

name string

Name of the policy.

allowModeSwitch boolean

Whether to allow mode switch for this policy.

allowUpdates boolean

Whether to allow updates under this policy.

allowedToLeave boolean

Whether to allow devices to leave the organization. Defaults to true.

autoConnect number

The amount of time in minutes to reconnect after having been disabled.

captivePortal number

The captive portal value for this policy. Defaults to 180.

default boolean

Whether the policy refers to the default account policy.

disableAutoFallback boolean

Whether to disable auto fallback for this policy.

enabled boolean

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

match string

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

precedence number

The precedence of the policy. Lower values indicate higher precedence.

serviceModeV2Mode string

The service mode. Defaults to warp.

serviceModeV2Port number

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

supportUrl string

The support URL that will be opened when sending feedback.

switchLocked boolean

Enablement of the ZT client switch lock.

account_id str

The account identifier to target for the resource.

name str

Name of the policy.

allow_mode_switch bool

Whether to allow mode switch for this policy.

allow_updates bool

Whether to allow updates under this policy.

allowed_to_leave bool

Whether to allow devices to leave the organization. Defaults to true.

auto_connect int

The amount of time in minutes to reconnect after having been disabled.

captive_portal int

The captive portal value for this policy. Defaults to 180.

default bool

Whether the policy refers to the default account policy.

disable_auto_fallback bool

Whether to disable auto fallback for this policy.

enabled bool

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

match str

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

precedence int

The precedence of the policy. Lower values indicate higher precedence.

service_mode_v2_mode str

The service mode. Defaults to warp.

service_mode_v2_port int

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

support_url str

The support URL that will be opened when sending feedback.

switch_locked bool

Enablement of the ZT client switch lock.

accountId String

The account identifier to target for the resource.

name String

Name of the policy.

allowModeSwitch Boolean

Whether to allow mode switch for this policy.

allowUpdates Boolean

Whether to allow updates under this policy.

allowedToLeave Boolean

Whether to allow devices to leave the organization. Defaults to true.

autoConnect Number

The amount of time in minutes to reconnect after having been disabled.

captivePortal Number

The captive portal value for this policy. Defaults to 180.

default Boolean

Whether the policy refers to the default account policy.

disableAutoFallback Boolean

Whether to disable auto fallback for this policy.

enabled Boolean

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

match String

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

precedence Number

The precedence of the policy. Lower values indicate higher precedence.

serviceModeV2Mode String

The service mode. Defaults to warp.

serviceModeV2Port Number

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

supportUrl String

The support URL that will be opened when sending feedback.

switchLocked Boolean

Enablement of the ZT client switch lock.

Outputs

All input properties are implicitly available as output properties. Additionally, the DeviceSettingsPolicy resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing DeviceSettingsPolicy Resource

Get an existing DeviceSettingsPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DeviceSettingsPolicyState, opts?: CustomResourceOptions): DeviceSettingsPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        allow_mode_switch: Optional[bool] = None,
        allow_updates: Optional[bool] = None,
        allowed_to_leave: Optional[bool] = None,
        auto_connect: Optional[int] = None,
        captive_portal: Optional[int] = None,
        default: Optional[bool] = None,
        disable_auto_fallback: Optional[bool] = None,
        enabled: Optional[bool] = None,
        match: Optional[str] = None,
        name: Optional[str] = None,
        precedence: Optional[int] = None,
        service_mode_v2_mode: Optional[str] = None,
        service_mode_v2_port: Optional[int] = None,
        support_url: Optional[str] = None,
        switch_locked: Optional[bool] = None) -> DeviceSettingsPolicy
func GetDeviceSettingsPolicy(ctx *Context, name string, id IDInput, state *DeviceSettingsPolicyState, opts ...ResourceOption) (*DeviceSettingsPolicy, error)
public static DeviceSettingsPolicy Get(string name, Input<string> id, DeviceSettingsPolicyState? state, CustomResourceOptions? opts = null)
public static DeviceSettingsPolicy get(String name, Output<String> id, DeviceSettingsPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountId string

The account identifier to target for the resource.

AllowModeSwitch bool

Whether to allow mode switch for this policy.

AllowUpdates bool

Whether to allow updates under this policy.

AllowedToLeave bool

Whether to allow devices to leave the organization. Defaults to true.

AutoConnect int

The amount of time in minutes to reconnect after having been disabled.

CaptivePortal int

The captive portal value for this policy. Defaults to 180.

Default bool

Whether the policy refers to the default account policy.

DisableAutoFallback bool

Whether to disable auto fallback for this policy.

Enabled bool

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

Match string

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

Name string

Name of the policy.

Precedence int

The precedence of the policy. Lower values indicate higher precedence.

ServiceModeV2Mode string

The service mode. Defaults to warp.

ServiceModeV2Port int

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

SupportUrl string

The support URL that will be opened when sending feedback.

SwitchLocked bool

Enablement of the ZT client switch lock.

AccountId string

The account identifier to target for the resource.

AllowModeSwitch bool

Whether to allow mode switch for this policy.

AllowUpdates bool

Whether to allow updates under this policy.

AllowedToLeave bool

Whether to allow devices to leave the organization. Defaults to true.

AutoConnect int

The amount of time in minutes to reconnect after having been disabled.

CaptivePortal int

The captive portal value for this policy. Defaults to 180.

Default bool

Whether the policy refers to the default account policy.

DisableAutoFallback bool

Whether to disable auto fallback for this policy.

Enabled bool

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

Match string

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

Name string

Name of the policy.

Precedence int

The precedence of the policy. Lower values indicate higher precedence.

ServiceModeV2Mode string

The service mode. Defaults to warp.

ServiceModeV2Port int

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

SupportUrl string

The support URL that will be opened when sending feedback.

SwitchLocked bool

Enablement of the ZT client switch lock.

accountId String

The account identifier to target for the resource.

allowModeSwitch Boolean

Whether to allow mode switch for this policy.

allowUpdates Boolean

Whether to allow updates under this policy.

allowedToLeave Boolean

Whether to allow devices to leave the organization. Defaults to true.

autoConnect Integer

The amount of time in minutes to reconnect after having been disabled.

captivePortal Integer

The captive portal value for this policy. Defaults to 180.

default_ Boolean

Whether the policy refers to the default account policy.

disableAutoFallback Boolean

Whether to disable auto fallback for this policy.

enabled Boolean

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

match String

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

name String

Name of the policy.

precedence Integer

The precedence of the policy. Lower values indicate higher precedence.

serviceModeV2Mode String

The service mode. Defaults to warp.

serviceModeV2Port Integer

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

supportUrl String

The support URL that will be opened when sending feedback.

switchLocked Boolean

Enablement of the ZT client switch lock.

accountId string

The account identifier to target for the resource.

allowModeSwitch boolean

Whether to allow mode switch for this policy.

allowUpdates boolean

Whether to allow updates under this policy.

allowedToLeave boolean

Whether to allow devices to leave the organization. Defaults to true.

autoConnect number

The amount of time in minutes to reconnect after having been disabled.

captivePortal number

The captive portal value for this policy. Defaults to 180.

default boolean

Whether the policy refers to the default account policy.

disableAutoFallback boolean

Whether to disable auto fallback for this policy.

enabled boolean

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

match string

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

name string

Name of the policy.

precedence number

The precedence of the policy. Lower values indicate higher precedence.

serviceModeV2Mode string

The service mode. Defaults to warp.

serviceModeV2Port number

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

supportUrl string

The support URL that will be opened when sending feedback.

switchLocked boolean

Enablement of the ZT client switch lock.

account_id str

The account identifier to target for the resource.

allow_mode_switch bool

Whether to allow mode switch for this policy.

allow_updates bool

Whether to allow updates under this policy.

allowed_to_leave bool

Whether to allow devices to leave the organization. Defaults to true.

auto_connect int

The amount of time in minutes to reconnect after having been disabled.

captive_portal int

The captive portal value for this policy. Defaults to 180.

default bool

Whether the policy refers to the default account policy.

disable_auto_fallback bool

Whether to disable auto fallback for this policy.

enabled bool

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

match str

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

name str

Name of the policy.

precedence int

The precedence of the policy. Lower values indicate higher precedence.

service_mode_v2_mode str

The service mode. Defaults to warp.

service_mode_v2_port int

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

support_url str

The support URL that will be opened when sending feedback.

switch_locked bool

Enablement of the ZT client switch lock.

accountId String

The account identifier to target for the resource.

allowModeSwitch Boolean

Whether to allow mode switch for this policy.

allowUpdates Boolean

Whether to allow updates under this policy.

allowedToLeave Boolean

Whether to allow devices to leave the organization. Defaults to true.

autoConnect Number

The amount of time in minutes to reconnect after having been disabled.

captivePortal Number

The captive portal value for this policy. Defaults to 180.

default Boolean

Whether the policy refers to the default account policy.

disableAutoFallback Boolean

Whether to disable auto fallback for this policy.

enabled Boolean

Whether the policy is enabled (cannot be set for default policies). Defaults to true.

match String

Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.

name String

Name of the policy.

precedence Number

The precedence of the policy. Lower values indicate higher precedence.

serviceModeV2Mode String

The service mode. Defaults to warp.

serviceModeV2Port Number

The port to use for the proxy service mode. Required when using service_mode_v2_mode.

supportUrl String

The support URL that will be opened when sending feedback.

switchLocked Boolean

Enablement of the ZT client switch lock.

Import

For default device settings policies you must use “default” as the policy ID.

 $ pulumi import cloudflare:index/deviceSettingsPolicy:DeviceSettingsPolicy example <account_id>/<device_policy_id>

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes

This Pulumi package is based on the cloudflare Terraform Provider.