AWS::IAM::UserPolicyAdds or updates an inline policy document that is embedded in the specified IAM user. An IAM user can also have a managed policy attached to it. To attach a managed policy to a user, use [AWS::IAM::User](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html). To create a new managed policy, use [AWS::IAM::ManagedPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-managedpolicy.html). For information about policies, see...
3 configurable properties. 2 required. Click a row to see details.
| Property | Type | Flags |
|---|---|---|
PolicyName | string | RequiredCreate-only |
UserName | string | RequiredCreate-only |
PolicyDocument | object |
A minimal template with required properties and common optional ones.
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::IAM::UserPolicy
Resources:
MyResource:
Type: AWS::IAM::UserPolicy
Properties:
PolicyName: "my-policyname"
UserName: "my-username"Permissions CloudFormation needs in your IAM role to manage this resource.
iam:PutUserPolicyiam:GetUserPolicyiam:GetUserPolicyiam:PutUserPolicyiam:GetUserPolicyiam:DeleteUserPolicyiam:GetUserPolicyEverything you need to know about IAM on one page. HD quality, print-friendly.
Download Free InfographicPolicyNameThese properties cannot be changed after the resource is created. Updating them triggers a replacement.
PolicyNameUserName