Creates a custom access control policy.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PolicyName | string | Yes | The name of the access control policy. The name must be 1 to 128 characters in length. The name can contain letters, digits, and hyphens (-) and must start with a letter. | ExampleControlPolicy |
Description | string | No | The description of the access control policy. The description must be 1 to 1,024 characters in length. The description can contain letters, digits, underscores (_), and hyphens (-) and must start with a letter. | ExampleControlPolicy |
EffectScope | string | Yes | The effective scope of the access control policy. The value RAM indicates that the access control policy takes effect only for RAM users and RAM roles. | RAM |
PolicyDocument | string | Yes | The document of the access control policy. The document can be a maximum of 4,096 characters in length. For more information about the languages of access control policies, see Languages of access control policies. For more information about the examples of access control policies, see Examples of custom access control policies. | {"Version":"1","Statement":[{"Effect":"Deny","Action":["ram:UpdateRole","ram:DeleteRole","ram:AttachPolicyToRole","ram:DetachPolicyFromRole"],"Resource":"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole"}]} |
Response parameters
Examples
Sample success responses
JSON
format
{
"ControlPolicy": {
"UpdateDate": "2021-03-18T09:24:19Z",
"Description": "ExampleControlPolicy",
"EffectScope": "RAM",
"AttachmentCount": "0",
"PolicyName": "ExampleControlPolicy",
"PolicyId": "cp-jExXAqIYkwHN****",
"CreateDate": "2021-03-18T09:24:19Z",
"PolicyType": "Custom"
},
"RequestId": "776B05B3-A0B0-464B-A191-F4E1119A94B2"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
409 | InvalidParameter.PolicyDocument.Length | The maximum length of the policy document is exceeded. It must not exceed 4096 characters. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|