Attaches a control policy.
Operation description
After a control policy is attached, the folder or member is immediately governed by the control policy. Make sure that the attach operation produces the expected results to avoid disrupting your business.
By default, the system attaches the system policy FullAliyunAccess to folders and members.
A control policy takes effect on the node to which it is attached and all its descendant nodes. For example, a control policy attached to a parent folder also takes effect on its child folders and members.
You can attach a maximum of 10 control policies to each node, such as a folder or a member.
This topic provides an example to show how to attach the custom policy cp-jExXAqIYkwHN**** to the folder fd-ZDNPiT****.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
resourcemanager:AttachControlPolicy |
update |
*ControlPolicy
Account
Folder
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PolicyId |
string |
Yes |
The ID of the control policy. |
cp-jExXAqIYkwHN**** |
| TargetId |
string |
Yes |
The target node. Valid values:
|
fd-ZDNPiT**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| RequestId |
string |
The request ID. |
95060F1D-6990-4645-8920-A81D1BBFE992 |
Examples
Success response
JSON format
{
"RequestId": "95060F1D-6990-4645-8920-A81D1BBFE992"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 404 | EntityNotExists.Target | The specified target does not exist in the resource directory. | The specified target does not exist in the resource directory. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.