AttachUserPolicy
更新時間 2024-09-19 16:53:52
最近更新時間: 2024-09-19 16:53:52
分享文章
本節主要介紹AttachUserPolicy。
此操作用來將指定的策略與指定的IAM用戶關聯。
請求參數
| 名稱 | 描述 | 是否必須 |
|---|---|---|
| Action | AttachUserPolicy。 | 是 |
| Version | 請求版本。 取值 :2010-05-08。默認值為2010-05-08。 |
否 |
| PolicyArn | 權限策略的資源名稱。 類型 :字符串 取值 :20~2048個字符。 |
是 |
| UserName | IAM用戶名。 類型 :字符串 取值 :1~64個字符組成,字符只能包含字母、數字或特殊字符,字母不區分大小寫,特殊字符只能是:下劃線(_)、中劃線(-)、逗號(,)、句點(.)、加號(+)、等號(=)和at符號(@)。 |
是 |
請求示例
將資源名為arn:ctyun:iam::10rc2arpn6306:policy/test_policy0的策略與IAM用戶test_user_2關聯。
POST?/?HTTP/1.1
Host:?oos-cn-iam.ctyunapi.cn
x-amz-content-sha256:?UNSIGNED-PAYLOAD
Authorization: SignatureValue
X-Amz-Date:?20190213T092112Z
Content-type:?application/octet-stream
Content-Length:?131
?
Action=AttachUserPolicy&Version=2010-05-08&UserName=test_user_2&PolicyArn=arn%3Actyun%3Aiam%3A%3A10rc2arpn6306%3Apolicy%2Ftest_policy0
響應示例
HTTP/1.1?200?OK
x-amz-request-id:e5a4b957cdb04d42
Content-Type:text/xml;charset=UTF-8
Content-Length:212
Date:Wed,?13?Feb?2019?09:21:12?GMT
Server:?CTYUN
?
<AttachUserPolicyResponse>
????<ResponseMetadata>
????????<RequestId>e5a4b957cdb04d42</RequestId>
????</ResponseMetadata>
</AttachUserPolicyResponse>