AWS Fundamentals Logo
AWS Fundamentals
AWS::IAM::UserPolicy

IAM UserPolicy

Adds 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...

Properties

3 configurable properties. 2 required. Click a row to see details.

Filter:
PropertyTypeFlags
PolicyName
string
RequiredCreate-only
UserName
string
RequiredCreate-only
PolicyDocument
object

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::IAM::UserPolicy

Resources:
  MyResource:
    Type: AWS::IAM::UserPolicy
    Properties:
      PolicyName: "my-policyname"
      UserName: "my-username"

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

create

iam:PutUserPolicyiam:GetUserPolicy

read

iam:GetUserPolicy

update

iam:PutUserPolicyiam:GetUserPolicy

delete

iam:DeleteUserPolicyiam:GetUserPolicy

Get the IAM Cheat Sheet

Everything you need to know about IAM on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

ServiceIAM
Properties3
Required2
TaggingNot supported
Primary IDPolicyName

Supported Operations

CreateReadUpdateDelete

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

PolicyNameUserName

External Links