1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cloudphone
  5. Policy
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cloudphone.Policy

Explore with Pulumi AI

Provides a Cloud Phone Policy resource.

Cloud phone policy.

For information about Cloud Phone Policy and how to use it, see What is Policy.

NOTE: Available since v1.243.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.cloudphone.Policy("default", {
    policyGroupName: "NewPolicyName",
    resolutionWidth: 720,
    lockResolution: "on",
    cameraRedirect: "on",
    resolutionHeight: 1280,
    clipboard: "read",
    netRedirectPolicy: {
        netRedirect: "on",
        customProxy: "on",
        proxyType: "socks5",
        hostAddr: "192.168.12.13",
        port: "8888",
        proxyUserName: "user1",
        proxyPassword: "123456",
    },
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
default = alicloud.cloudphone.Policy("default",
    policy_group_name="NewPolicyName",
    resolution_width=720,
    lock_resolution="on",
    camera_redirect="on",
    resolution_height=1280,
    clipboard="read",
    net_redirect_policy={
        "net_redirect": "on",
        "custom_proxy": "on",
        "proxy_type": "socks5",
        "host_addr": "192.168.12.13",
        "port": "8888",
        "proxy_user_name": "user1",
        "proxy_password": "123456",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudphone"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "terraform-example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_, err := cloudphone.NewPolicy(ctx, "default", &cloudphone.PolicyArgs{
			PolicyGroupName:  pulumi.String("NewPolicyName"),
			ResolutionWidth:  pulumi.Int(720),
			LockResolution:   pulumi.String("on"),
			CameraRedirect:   pulumi.String("on"),
			ResolutionHeight: pulumi.Int(1280),
			Clipboard:        pulumi.String("read"),
			NetRedirectPolicy: &cloudphone.PolicyNetRedirectPolicyArgs{
				NetRedirect:   pulumi.String("on"),
				CustomProxy:   pulumi.String("on"),
				ProxyType:     pulumi.String("socks5"),
				HostAddr:      pulumi.String("192.168.12.13"),
				Port:          pulumi.String("8888"),
				ProxyUserName: pulumi.String("user1"),
				ProxyPassword: pulumi.String("123456"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "terraform-example";
    var @default = new AliCloud.CloudPhone.Policy("default", new()
    {
        PolicyGroupName = "NewPolicyName",
        ResolutionWidth = 720,
        LockResolution = "on",
        CameraRedirect = "on",
        ResolutionHeight = 1280,
        Clipboard = "read",
        NetRedirectPolicy = new AliCloud.cloudPhone.Inputs.PolicyNetRedirectPolicyArgs
        {
            NetRedirect = "on",
            CustomProxy = "on",
            ProxyType = "socks5",
            HostAddr = "192.168.12.13",
            Port = "8888",
            ProxyUserName = "user1",
            ProxyPassword = "123456",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cloudphone.Policy;
import com.pulumi.alicloud.cloudphone.PolicyArgs;
import com.pulumi.alicloud.cloudphone.inputs.PolicyNetRedirectPolicyArgs;
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) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("terraform-example");
        var default_ = new Policy("default", PolicyArgs.builder()
            .policyGroupName("NewPolicyName")
            .resolutionWidth("720")
            .lockResolution("on")
            .cameraRedirect("on")
            .resolutionHeight("1280")
            .clipboard("read")
            .netRedirectPolicy(PolicyNetRedirectPolicyArgs.builder()
                .netRedirect("on")
                .customProxy("on")
                .proxyType("socks5")
                .hostAddr("192.168.12.13")
                .port("8888")
                .proxyUserName("user1")
                .proxyPassword("123456")
                .build())
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
resources:
  default:
    type: alicloud:cloudphone:Policy
    properties:
      policyGroupName: NewPolicyName
      resolutionWidth: '720'
      lockResolution: on
      cameraRedirect: on
      resolutionHeight: '1280'
      clipboard: read
      netRedirectPolicy:
        netRedirect: on
        customProxy: on
        proxyType: socks5
        hostAddr: 192.168.12.13
        port: '8888'
        proxyUserName: user1
        proxyPassword: '123456'
Copy

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: Optional[PolicyArgs] = None,
           opts: Optional[ResourceOptions] = None)

@overload
def Policy(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           camera_redirect: Optional[str] = None,
           clipboard: Optional[str] = None,
           lock_resolution: Optional[str] = None,
           net_redirect_policy: Optional[PolicyNetRedirectPolicyArgs] = None,
           policy_group_name: Optional[str] = None,
           resolution_height: Optional[int] = None,
           resolution_width: Optional[int] = None)
func NewPolicy(ctx *Context, name string, args *PolicyArgs, opts ...ResourceOption) (*Policy, error)
public Policy(string name, PolicyArgs? args = null, CustomResourceOptions? opts = null)
public Policy(String name, PolicyArgs args)
public Policy(String name, PolicyArgs args, CustomResourceOptions options)
type: alicloud:cloudphone:Policy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. 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 policyResource = new AliCloud.CloudPhone.Policy("policyResource", new()
{
    CameraRedirect = "string",
    Clipboard = "string",
    LockResolution = "string",
    NetRedirectPolicy = new AliCloud.cloudPhone.Inputs.PolicyNetRedirectPolicyArgs
    {
        CustomProxy = "string",
        HostAddr = "string",
        NetRedirect = "string",
        Port = "string",
        ProxyPassword = "string",
        ProxyType = "string",
        ProxyUserName = "string",
    },
    PolicyGroupName = "string",
    ResolutionHeight = 0,
    ResolutionWidth = 0,
});
Copy
example, err := cloudphone.NewPolicy(ctx, "policyResource", &cloudphone.PolicyArgs{
	CameraRedirect: pulumi.String("string"),
	Clipboard:      pulumi.String("string"),
	LockResolution: pulumi.String("string"),
	NetRedirectPolicy: &cloudphone.PolicyNetRedirectPolicyArgs{
		CustomProxy:   pulumi.String("string"),
		HostAddr:      pulumi.String("string"),
		NetRedirect:   pulumi.String("string"),
		Port:          pulumi.String("string"),
		ProxyPassword: pulumi.String("string"),
		ProxyType:     pulumi.String("string"),
		ProxyUserName: pulumi.String("string"),
	},
	PolicyGroupName:  pulumi.String("string"),
	ResolutionHeight: pulumi.Int(0),
	ResolutionWidth:  pulumi.Int(0),
})
Copy
var policyResource = new Policy("policyResource", PolicyArgs.builder()
    .cameraRedirect("string")
    .clipboard("string")
    .lockResolution("string")
    .netRedirectPolicy(PolicyNetRedirectPolicyArgs.builder()
        .customProxy("string")
        .hostAddr("string")
        .netRedirect("string")
        .port("string")
        .proxyPassword("string")
        .proxyType("string")
        .proxyUserName("string")
        .build())
    .policyGroupName("string")
    .resolutionHeight(0)
    .resolutionWidth(0)
    .build());
Copy
policy_resource = alicloud.cloudphone.Policy("policyResource",
    camera_redirect="string",
    clipboard="string",
    lock_resolution="string",
    net_redirect_policy={
        "custom_proxy": "string",
        "host_addr": "string",
        "net_redirect": "string",
        "port": "string",
        "proxy_password": "string",
        "proxy_type": "string",
        "proxy_user_name": "string",
    },
    policy_group_name="string",
    resolution_height=0,
    resolution_width=0)
Copy
const policyResource = new alicloud.cloudphone.Policy("policyResource", {
    cameraRedirect: "string",
    clipboard: "string",
    lockResolution: "string",
    netRedirectPolicy: {
        customProxy: "string",
        hostAddr: "string",
        netRedirect: "string",
        port: "string",
        proxyPassword: "string",
        proxyType: "string",
        proxyUserName: "string",
    },
    policyGroupName: "string",
    resolutionHeight: 0,
    resolutionWidth: 0,
});
Copy
type: alicloud:cloudphone:Policy
properties:
    cameraRedirect: string
    clipboard: string
    lockResolution: string
    netRedirectPolicy:
        customProxy: string
        hostAddr: string
        netRedirect: string
        port: string
        proxyPassword: string
        proxyType: string
        proxyUserName: string
    policyGroupName: string
    resolutionHeight: 0
    resolutionWidth: 0
Copy

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:

CameraRedirect string
Whether to turn on local camera redirection.
Clipboard string
Clipboard permissions.
LockResolution string
Whether to lock the resolution.
NetRedirectPolicy Pulumi.AliCloud.cloudPhone.Inputs.PolicyNetRedirectPolicy
Network redirection. See net_redirect_policy below.
PolicyGroupName string
The policy name.
ResolutionHeight int
The height of the resolution. Unit: Pixels.
ResolutionWidth int
The width of the resolution. Unit: Pixels.
CameraRedirect string
Whether to turn on local camera redirection.
Clipboard string
Clipboard permissions.
LockResolution string
Whether to lock the resolution.
NetRedirectPolicy PolicyNetRedirectPolicyArgs
Network redirection. See net_redirect_policy below.
PolicyGroupName string
The policy name.
ResolutionHeight int
The height of the resolution. Unit: Pixels.
ResolutionWidth int
The width of the resolution. Unit: Pixels.
cameraRedirect String
Whether to turn on local camera redirection.
clipboard String
Clipboard permissions.
lockResolution String
Whether to lock the resolution.
netRedirectPolicy PolicyNetRedirectPolicy
Network redirection. See net_redirect_policy below.
policyGroupName String
The policy name.
resolutionHeight Integer
The height of the resolution. Unit: Pixels.
resolutionWidth Integer
The width of the resolution. Unit: Pixels.
cameraRedirect string
Whether to turn on local camera redirection.
clipboard string
Clipboard permissions.
lockResolution string
Whether to lock the resolution.
netRedirectPolicy PolicyNetRedirectPolicy
Network redirection. See net_redirect_policy below.
policyGroupName string
The policy name.
resolutionHeight number
The height of the resolution. Unit: Pixels.
resolutionWidth number
The width of the resolution. Unit: Pixels.
camera_redirect str
Whether to turn on local camera redirection.
clipboard str
Clipboard permissions.
lock_resolution str
Whether to lock the resolution.
net_redirect_policy PolicyNetRedirectPolicyArgs
Network redirection. See net_redirect_policy below.
policy_group_name str
The policy name.
resolution_height int
The height of the resolution. Unit: Pixels.
resolution_width int
The width of the resolution. Unit: Pixels.
cameraRedirect String
Whether to turn on local camera redirection.
clipboard String
Clipboard permissions.
lockResolution String
Whether to lock the resolution.
netRedirectPolicy Property Map
Network redirection. See net_redirect_policy below.
policyGroupName String
The policy name.
resolutionHeight Number
The height of the resolution. Unit: Pixels.
resolutionWidth Number
The width of the resolution. Unit: Pixels.

Outputs

All input properties are implicitly available as output properties. Additionally, the Policy 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 Policy Resource

Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        camera_redirect: Optional[str] = None,
        clipboard: Optional[str] = None,
        lock_resolution: Optional[str] = None,
        net_redirect_policy: Optional[PolicyNetRedirectPolicyArgs] = None,
        policy_group_name: Optional[str] = None,
        resolution_height: Optional[int] = None,
        resolution_width: Optional[int] = None) -> Policy
func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)
public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)
public static Policy get(String name, Output<String> id, PolicyState state, CustomResourceOptions options)
resources:  _:    type: alicloud:cloudphone:Policy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CameraRedirect string
Whether to turn on local camera redirection.
Clipboard string
Clipboard permissions.
LockResolution string
Whether to lock the resolution.
NetRedirectPolicy Pulumi.AliCloud.cloudPhone.Inputs.PolicyNetRedirectPolicy
Network redirection. See net_redirect_policy below.
PolicyGroupName string
The policy name.
ResolutionHeight int
The height of the resolution. Unit: Pixels.
ResolutionWidth int
The width of the resolution. Unit: Pixels.
CameraRedirect string
Whether to turn on local camera redirection.
Clipboard string
Clipboard permissions.
LockResolution string
Whether to lock the resolution.
NetRedirectPolicy PolicyNetRedirectPolicyArgs
Network redirection. See net_redirect_policy below.
PolicyGroupName string
The policy name.
ResolutionHeight int
The height of the resolution. Unit: Pixels.
ResolutionWidth int
The width of the resolution. Unit: Pixels.
cameraRedirect String
Whether to turn on local camera redirection.
clipboard String
Clipboard permissions.
lockResolution String
Whether to lock the resolution.
netRedirectPolicy PolicyNetRedirectPolicy
Network redirection. See net_redirect_policy below.
policyGroupName String
The policy name.
resolutionHeight Integer
The height of the resolution. Unit: Pixels.
resolutionWidth Integer
The width of the resolution. Unit: Pixels.
cameraRedirect string
Whether to turn on local camera redirection.
clipboard string
Clipboard permissions.
lockResolution string
Whether to lock the resolution.
netRedirectPolicy PolicyNetRedirectPolicy
Network redirection. See net_redirect_policy below.
policyGroupName string
The policy name.
resolutionHeight number
The height of the resolution. Unit: Pixels.
resolutionWidth number
The width of the resolution. Unit: Pixels.
camera_redirect str
Whether to turn on local camera redirection.
clipboard str
Clipboard permissions.
lock_resolution str
Whether to lock the resolution.
net_redirect_policy PolicyNetRedirectPolicyArgs
Network redirection. See net_redirect_policy below.
policy_group_name str
The policy name.
resolution_height int
The height of the resolution. Unit: Pixels.
resolution_width int
The width of the resolution. Unit: Pixels.
cameraRedirect String
Whether to turn on local camera redirection.
clipboard String
Clipboard permissions.
lockResolution String
Whether to lock the resolution.
netRedirectPolicy Property Map
Network redirection. See net_redirect_policy below.
policyGroupName String
The policy name.
resolutionHeight Number
The height of the resolution. Unit: Pixels.
resolutionWidth Number
The width of the resolution. Unit: Pixels.

Supporting Types

PolicyNetRedirectPolicy
, PolicyNetRedirectPolicyArgs

CustomProxy string
Whether to manually configure the transparent proxy.
HostAddr string
The transparent proxy IP address. The format is IPv4 address.
NetRedirect string
Whether to enable network redirection.
Port string
Transparent proxy port. The Port value range is 1~ 65535.
ProxyPassword string
The proxy password. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
ProxyType string
Agent protocol type.
ProxyUserName string
The proxy user name. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
CustomProxy string
Whether to manually configure the transparent proxy.
HostAddr string
The transparent proxy IP address. The format is IPv4 address.
NetRedirect string
Whether to enable network redirection.
Port string
Transparent proxy port. The Port value range is 1~ 65535.
ProxyPassword string
The proxy password. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
ProxyType string
Agent protocol type.
ProxyUserName string
The proxy user name. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
customProxy String
Whether to manually configure the transparent proxy.
hostAddr String
The transparent proxy IP address. The format is IPv4 address.
netRedirect String
Whether to enable network redirection.
port String
Transparent proxy port. The Port value range is 1~ 65535.
proxyPassword String
The proxy password. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
proxyType String
Agent protocol type.
proxyUserName String
The proxy user name. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
customProxy string
Whether to manually configure the transparent proxy.
hostAddr string
The transparent proxy IP address. The format is IPv4 address.
netRedirect string
Whether to enable network redirection.
port string
Transparent proxy port. The Port value range is 1~ 65535.
proxyPassword string
The proxy password. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
proxyType string
Agent protocol type.
proxyUserName string
The proxy user name. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
custom_proxy str
Whether to manually configure the transparent proxy.
host_addr str
The transparent proxy IP address. The format is IPv4 address.
net_redirect str
Whether to enable network redirection.
port str
Transparent proxy port. The Port value range is 1~ 65535.
proxy_password str
The proxy password. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
proxy_type str
Agent protocol type.
proxy_user_name str
The proxy user name. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
customProxy String
Whether to manually configure the transparent proxy.
hostAddr String
The transparent proxy IP address. The format is IPv4 address.
netRedirect String
Whether to enable network redirection.
port String
Transparent proxy port. The Port value range is 1~ 65535.
proxyPassword String
The proxy password. The length range is 1~ 256. Chinese characters and white space characters are not allowed.
proxyType String
Agent protocol type.
proxyUserName String
The proxy user name. The length range is 1~ 256. Chinese characters and white space characters are not allowed.

Import

Cloud Phone Policy can be imported using the id, e.g.

$ pulumi import alicloud:cloudphone/policy:Policy example <id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.