PutUserPolicy
Adds or updates an inline policy document that is embedded in the specified IAM user.
Request Parameters
For information about the parameters that are common to all actions, See Common Parameters.
PolicyDocument
The policy document.
You must provide policies in JSON format in IAM.
Type: String
Required: Yes
PolicyName
The name of the policy document.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern: [\w+=,.@-]+
Required: Yes
UserName
The name of the user to associate the policy with.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern: [\w+=,.@-]+
Required: Yes
Errors
For information about the errors that are common to all actions, See Common Error Codes.
MalformedPolicyDocument
The request was rejected because the policy document was malformed.
HTTP Status Code: 400
NoSuchEntity
The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
HTTP Status Code: 404
ServiceFailure
The request processing has failed because of an unknown error, exception, or failure.
HTTP Status Code: 500
Examples
Sample Request:
https://msdps3.veritas.com:8443/?Action=PutUserPolicy
&UserName=User1
&PolicyName=ExamplePolicy
&PolicyDocument={"Version":"2012-10-17","Statement":[{"Effect":"Allow",
"Action":["s3:*"],"Resource":["arn:aws:s3:::bkt3/*"]}]}
&Version=2010-05-08
&AUTHPARAMSSample Response:
<?xml version="1.0" encoding="UTF-8"?>
<PutUserPolicyResponse
xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
<ResponseMetadata>
<RequestId>1648451612346994599</RequestId>
</ResponseMetadata>
</PutUserPolicyResponse>