Creates a custom control policy by calling CreateControlPolicy.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
resourcemanager:CreateControlPolicy |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PolicyName |
string |
Yes |
Policy Name of the control policy. Policy Name must be 1 to 128 characters in length, must start with a letter, and can contain letters, digits, and hyphens (-). |
ExampleControlPolicy |
| Description |
string |
No |
The description of the control policy. The description must be 1 to 1,024 characters in length, must start with a letter, and can contain letters, digits, underscores (_), and hyphens (-). |
ExampleControlPolicy |
| EffectScope |
string |
Yes |
The effective scope of the control policy. Valid values: RAM, which indicates that the control policy takes effect only for Resource Access Management (RAM) users or RAM roles. |
RAM |
| PolicyDocument |
string |
Yes |
The content of the control policy. The maximum length is 4,096 characters. For information about the control policy language, see Control policy language. For examples of control policies, see Examples of custom control policies. |
{"Version":"1","Statement":[{"Effect":"Deny","Action":["ram:UpdateRole","ram:DeleteRole","ram:AttachPolicyToRole","ram:DetachPolicyFromRole"],"Resource":"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole"}]} |
| Tag |
array<object> |
No |
The tags of the control policy. |
|
|
object |
No |
The tags of the control policy. |
||
| Key |
string |
No |
The tag key. |
k1 |
| Value |
string |
No |
The tag value. |
v1 |
| ControlPolicyType |
string |
No |
The type of the control policy. Valid values:
Default value: CONTROL_POLICY. |
RESOURCE_CONTROL_POLICY |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| ControlPolicy |
object |
The details of the control policy. |
|
| AttachmentCount |
string |
The number of times the control policy is referenced. |
0 |
| CreateDate |
string |
The time when the control policy was created. The time is displayed in ISO 8601 format, in UTC. |
2021-03-18T09:24:19Z |
| Description |
string |
The description of the control policy. |
ExampleControlPolicy |
| EffectScope |
string |
The effective scope of the control policy. Valid values: RAM, which indicates that the control policy takes effect only for Resource Access Management (RAM) users or RAM roles. |
RAM |
| PolicyId |
string |
The ID of the control policy. |
cp-jExXAqIYkwHN**** |
| PolicyName |
string |
The Policy Name of the control policy. |
ExampleControlPolicy |
| PolicyType |
string |
The type of the control policy. Valid values:
|
Custom |
| UpdateDate |
string |
The time when the control policy was updated. The time is displayed in ISO 8601 format, in UTC. |
2021-03-18T09:24:19Z |
| ControlPolicyType |
string |
The type of the control policy. Valid values:
|
RESOURCE_CONTROL_POLICY |
| RequestId |
string |
The request ID. |
776B05B3-A0B0-464B-A191-F4E1119A94B2 |
Examples
Success response
JSON format
{
"ControlPolicy": {
"AttachmentCount": "0",
"CreateDate": "2021-03-18T09:24:19Z",
"Description": "ExampleControlPolicy",
"EffectScope": "RAM",
"PolicyId": "cp-jExXAqIYkwHN****",
"PolicyName": "ExampleControlPolicy",
"PolicyType": "Custom",
"UpdateDate": "2021-03-18T09:24:19Z",
"ControlPolicyType": "RESOURCE_CONTROL_POLICY"
},
"RequestId": "776B05B3-A0B0-464B-A191-F4E1119A94B2"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 409 | InvalidParameter.PolicyDocument.Length | The maximum length of the policy document is exceeded. It must not exceed 4096 characters. | |
| 409 | ResourceControlPolicyNotEnabled | Resource control policy has not been enabled. | |
| 409 | InvalidResourceControlPolicyEnablementStatus | The resource control policy enablement status is not valid to perform this operation. | |
| 409 | LimitExceeded.ResourceControlPolicy | The resource control policy number exceeds the limit. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.