Policy

Create a Policy Resource

new Policy(name: string, args?: PolicyArgs, opts?: CustomResourceOptions);
def Policy(resource_name, opts=None, description=None, document=None, force=None, name=None, statements=None, version=None, __props__=None);
func NewPolicy(ctx *Context, name string, args *PolicyArgs, opts ...ResourceOption) (*Policy, error)
public Policy(string name, PolicyArgs? args = null, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

Policy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Policy resource accepts the following input properties:

Description string

Description of the RAM policy. This name can have a string of 1 to 1024 characters.

Document string

Document of the RAM policy. It is required when the statement is not specified.

Force bool

This parameter is used for resource destroy. Default value is false.

Name string

Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen “-”, and must not begin with a hyphen.

Statements List<Pulumi.AliCloud.Ram.Inputs.PolicyStatementArgs>

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Statements of the RAM policy document. It is required when the document is not specified.

Deprecated: Field 'statement' has been deprecated from version 1.49.0, and use field 'document' to replace.

Version string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Version of the RAM policy document. Valid value is 1. Default value is 1.

Deprecated: Field 'version' has been deprecated from version 1.49.0, and use field 'document' to replace.

Description string

Description of the RAM policy. This name can have a string of 1 to 1024 characters.

Document string

Document of the RAM policy. It is required when the statement is not specified.

Force bool

This parameter is used for resource destroy. Default value is false.

Name string

Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen “-”, and must not begin with a hyphen.

Statements []PolicyStatement

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Statements of the RAM policy document. It is required when the document is not specified.

Deprecated: Field 'statement' has been deprecated from version 1.49.0, and use field 'document' to replace.

Version string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Version of the RAM policy document. Valid value is 1. Default value is 1.

Deprecated: Field 'version' has been deprecated from version 1.49.0, and use field 'document' to replace.

description string

Description of the RAM policy. This name can have a string of 1 to 1024 characters.

document string

Document of the RAM policy. It is required when the statement is not specified.

force boolean

This parameter is used for resource destroy. Default value is false.

name string

Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen “-”, and must not begin with a hyphen.

statements PolicyStatement[]

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Statements of the RAM policy document. It is required when the document is not specified.

Deprecated: Field 'statement' has been deprecated from version 1.49.0, and use field 'document' to replace.

version string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Version of the RAM policy document. Valid value is 1. Default value is 1.

Deprecated: Field 'version' has been deprecated from version 1.49.0, and use field 'document' to replace.

description str

Description of the RAM policy. This name can have a string of 1 to 1024 characters.

document str

Document of the RAM policy. It is required when the statement is not specified.

force bool

This parameter is used for resource destroy. Default value is false.

name str

Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen “-”, and must not begin with a hyphen.

statements List[PolicyStatement]

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Statements of the RAM policy document. It is required when the document is not specified.

Deprecated: Field 'statement' has been deprecated from version 1.49.0, and use field 'document' to replace.

version str

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Version of the RAM policy document. Valid value is 1. Default value is 1.

Deprecated: Field 'version' has been deprecated from version 1.49.0, and use field 'document' to replace.

Outputs

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

AttachmentCount int

The policy attachment count.

Id string
The provider-assigned unique ID for this managed resource.
Type string

The policy type.

AttachmentCount int

The policy attachment count.

Id string
The provider-assigned unique ID for this managed resource.
Type string

The policy type.

attachmentCount number

The policy attachment count.

id string
The provider-assigned unique ID for this managed resource.
type string

The policy type.

attachment_count float

The policy attachment count.

id str
The provider-assigned unique ID for this managed resource.
type str

The policy type.

Look up an 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
static get(resource_name, id, opts=None, attachment_count=None, description=None, document=None, force=None, name=None, statements=None, type=None, version=None, __props__=None);
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)
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.

The following state arguments are supported:

AttachmentCount int

The policy attachment count.

Description string

Description of the RAM policy. This name can have a string of 1 to 1024 characters.

Document string

Document of the RAM policy. It is required when the statement is not specified.

Force bool

This parameter is used for resource destroy. Default value is false.

Name string

Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen “-”, and must not begin with a hyphen.

Statements List<Pulumi.AliCloud.Ram.Inputs.PolicyStatementArgs>

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Statements of the RAM policy document. It is required when the document is not specified.

Deprecated: Field 'statement' has been deprecated from version 1.49.0, and use field 'document' to replace.

Type string

The policy type.

Version string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Version of the RAM policy document. Valid value is 1. Default value is 1.

Deprecated: Field 'version' has been deprecated from version 1.49.0, and use field 'document' to replace.

AttachmentCount int

The policy attachment count.

Description string

Description of the RAM policy. This name can have a string of 1 to 1024 characters.

Document string

Document of the RAM policy. It is required when the statement is not specified.

Force bool

This parameter is used for resource destroy. Default value is false.

Name string

Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen “-”, and must not begin with a hyphen.

Statements []PolicyStatement

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Statements of the RAM policy document. It is required when the document is not specified.

Deprecated: Field 'statement' has been deprecated from version 1.49.0, and use field 'document' to replace.

Type string

The policy type.

Version string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Version of the RAM policy document. Valid value is 1. Default value is 1.

Deprecated: Field 'version' has been deprecated from version 1.49.0, and use field 'document' to replace.

attachmentCount number

The policy attachment count.

description string

Description of the RAM policy. This name can have a string of 1 to 1024 characters.

document string

Document of the RAM policy. It is required when the statement is not specified.

force boolean

This parameter is used for resource destroy. Default value is false.

name string

Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen “-”, and must not begin with a hyphen.

statements PolicyStatement[]

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Statements of the RAM policy document. It is required when the document is not specified.

Deprecated: Field 'statement' has been deprecated from version 1.49.0, and use field 'document' to replace.

type string

The policy type.

version string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Version of the RAM policy document. Valid value is 1. Default value is 1.

Deprecated: Field 'version' has been deprecated from version 1.49.0, and use field 'document' to replace.

attachment_count float

The policy attachment count.

description str

Description of the RAM policy. This name can have a string of 1 to 1024 characters.

document str

Document of the RAM policy. It is required when the statement is not specified.

force bool

This parameter is used for resource destroy. Default value is false.

name str

Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen “-”, and must not begin with a hyphen.

statements List[PolicyStatement]

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Statements of the RAM policy document. It is required when the document is not specified.

Deprecated: Field 'statement' has been deprecated from version 1.49.0, and use field 'document' to replace.

type str

The policy type.

version str

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) Version of the RAM policy document. Valid value is 1. Default value is 1.

Deprecated: Field 'version' has been deprecated from version 1.49.0, and use field 'document' to replace.

Supporting Types

PolicyStatement

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Actions List<string>

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) List of operations for the resource. The format of each item in this list is ${service}:${action_name}, such as oss:ListBuckets and ecs:Describe*. The ${service} can be ecs, oss, ots and so on, the ${action_name} refers to the name of an api interface which related to the ${service}.

Effect string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) This parameter indicates whether or not the action is allowed. Valid values are Allow and Deny.

Resources List<string>

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) List of specific objects which will be authorized. The format of each item in this list is acs:${service}:${region}:${account_id}:${relative_id}, such as acs:ecs:*:*:instance/inst-002 and acs:oss:*:1234567890000:mybucket. The ${service} can be ecs, oss, ots and so on, the ${region} is the region info which can use * replace when it is not supplied, the ${account_id} refers to someone’s Alicloud account id or you can use * to replace, the ${relative_id} is the resource description section which related to the ${service}.

Actions []string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) List of operations for the resource. The format of each item in this list is ${service}:${action_name}, such as oss:ListBuckets and ecs:Describe*. The ${service} can be ecs, oss, ots and so on, the ${action_name} refers to the name of an api interface which related to the ${service}.

Effect string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) This parameter indicates whether or not the action is allowed. Valid values are Allow and Deny.

Resources []string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) List of specific objects which will be authorized. The format of each item in this list is acs:${service}:${region}:${account_id}:${relative_id}, such as acs:ecs:*:*:instance/inst-002 and acs:oss:*:1234567890000:mybucket. The ${service} can be ecs, oss, ots and so on, the ${region} is the region info which can use * replace when it is not supplied, the ${account_id} refers to someone’s Alicloud account id or you can use * to replace, the ${relative_id} is the resource description section which related to the ${service}.

actions string[]

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) List of operations for the resource. The format of each item in this list is ${service}:${action_name}, such as oss:ListBuckets and ecs:Describe*. The ${service} can be ecs, oss, ots and so on, the ${action_name} refers to the name of an api interface which related to the ${service}.

effect string

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) This parameter indicates whether or not the action is allowed. Valid values are Allow and Deny.

resources string[]

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) List of specific objects which will be authorized. The format of each item in this list is acs:${service}:${region}:${account_id}:${relative_id}, such as acs:ecs:*:*:instance/inst-002 and acs:oss:*:1234567890000:mybucket. The ${service} can be ecs, oss, ots and so on, the ${region} is the region info which can use * replace when it is not supplied, the ${account_id} refers to someone’s Alicloud account id or you can use * to replace, the ${relative_id} is the resource description section which related to the ${service}.

actions List[str]

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) List of operations for the resource. The format of each item in this list is ${service}:${action_name}, such as oss:ListBuckets and ecs:Describe*. The ${service} can be ecs, oss, ots and so on, the ${action_name} refers to the name of an api interface which related to the ${service}.

effect str

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) This parameter indicates whether or not the action is allowed. Valid values are Allow and Deny.

resources List[str]

(It has been deprecated from version 1.49.0, and use field ‘document’ to replace.) List of specific objects which will be authorized. The format of each item in this list is acs:${service}:${region}:${account_id}:${relative_id}, such as acs:ecs:*:*:instance/inst-002 and acs:oss:*:1234567890000:mybucket. The ${service} can be ecs, oss, ots and so on, the ${region} is the region info which can use * replace when it is not supplied, the ${account_id} refers to someone’s Alicloud account id or you can use * to replace, the ${relative_id} is the resource description section which related to the ${service}.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.