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
statementis 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.
Ali Cloud. Ram. Inputs. Policy Statement Args> (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
documentis not specified.- 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 is1.
- 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
statementis 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
[]Policy
Statement (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
documentis not specified.- 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 is1.
- 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
statementis 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
Policy
Statement[] (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
documentis not specified.- 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 is1.
- 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
statementis 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[Policy
Statement] (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
documentis not specified.- 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 is1.
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:
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): Policystatic 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:
- Attachment
Count 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
statementis 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.
Ali Cloud. Ram. Inputs. Policy Statement Args> (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
documentis not specified.- 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 is1.
- Attachment
Count 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
statementis 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
[]Policy
Statement (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
documentis not specified.- 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 is1.
- attachment
Count 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
statementis 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
Policy
Statement[] (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
documentis not specified.- 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 is1.
- 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
statementis 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[Policy
Statement] (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
documentis not specified.- 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 is1.
Supporting Types
PolicyStatement
- 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 asoss:ListBucketsandecs:Describe*. The${service}can beecs,oss,otsand 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
actionis allowed. Valid values areAllowandDeny.- 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 asacs:ecs:*:*:instance/inst-002andacs:oss:*:1234567890000:mybucket. The${service}can beecs,oss,otsand 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 asoss:ListBucketsandecs:Describe*. The${service}can beecs,oss,otsand 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
actionis allowed. Valid values areAllowandDeny.- 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 asacs:ecs:*:*:instance/inst-002andacs:oss:*:1234567890000:mybucket. The${service}can beecs,oss,otsand 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 asoss:ListBucketsandecs:Describe*. The${service}can beecs,oss,otsand 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
actionis allowed. Valid values areAllowandDeny.- 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 asacs:ecs:*:*:instance/inst-002andacs:oss:*:1234567890000:mybucket. The${service}can beecs,oss,otsand 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 asoss:ListBucketsandecs:Describe*. The${service}can beecs,oss,otsand 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
actionis allowed. Valid values areAllowandDeny.- 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 asacs:ecs:*:*:instance/inst-002andacs:oss:*:1234567890000:mybucket. The${service}can beecs,oss,otsand 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
alicloudTerraform Provider.