A repository of AWS IAM policy templates and examples including customizable CloudFormation and AWS CLI scripts.

EC2
Allows Starting or Stopping an EC2 Instance and Modifying a Security Group

A policy that allows starting or stopping a specific EC2 instance and modifying a specific security group (Programmatically and in the Console).

CloudFormationTerraformAWS CLI
Allows Launching EC2 Instances in a Specific Subnet, Programmatically and in the Console

A policy that allows listing information for all EC2 objects and launching EC2 instances in a specific subnet. This policy also provides the permissions necessary to complete this action on the console.

CloudFormationTerraformAWS CLI
Allows Managing EC2 Security Groups Associated With a Specific VPC, Programmatically and in the Console

A policy that allows managing Amazon EC2 security groups associated with a specific virtual private cloud (VPC). This policy also provides the permissions necessary to complete this action on the console.

CloudFormationTerraformAWS CLI
Allows Full EC2 Access Within a Specific Region, Programmatically and in the Console

A policy hat allows full EC2 access within a specific region. This policy also provides the permissions necessary to complete this action on the console.

CloudFormationTerraformAWS CLI
Allow Users to Launch Approved Images and Use Existing Security Groups Only, Programmatically and in the Console.

An IAM policy that prevents users from creating their own security groups, and allows users to only launch approved AMIs (Amazon Machine Images). Approved images are identified with Tags (Example, Tag Key: Approved, Tag Value: True). This policy provides the permissions necessary to complete this action programmatically or from the console.

CloudFormationTerraformAWS CLI
Allow Starting or Stopping EC2 Instances Based on a User's Username, Programmatically and in the Console.

An IAM policy that allows an IAM user to start or stop EC2 instances, but only if the instance tag Owner has the value of that user's user name. This policy also provides the permissions necessary to complete this action on the console.

CloudFormationTerraformAWS CLI
Limit Terminating EC2 Instances to an IP Address Range

An IAM policy that prevents users from terminating EC2 instances when the request does not come from a specified IP range. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only

CloudFormationTerraformAWS CLI
Require the Use of IMDSv2 When Launching EC2 Instances

An IAM policy that prevents users from launching new EC2 Instances if they are not configured to use the new Instance Metadata Service (IMDSv2)

CloudFormationTerraformAWS CLI
S3
Allows IAM Users Access to Their S3 Home Directory

A policy that allows IAM users to access their own home directory in S3. The home directory is a bucket that includes a home folder and folders for individual users (Programmatically and in the Console).

CloudFormationTerraformAWS CLI
Limits Managing to a Specific S3 Bucket and Denies All Other Actions

A policy that limits managing an S3 bucket by allowing all S3 actions on the specific bucket, but explicitly denying access to every AWS service except Amazon S3. This policy also denies access to actions that can't be performed on an S3 bucket, such as s3:ListAllMyBuckets or s3:GetObject. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
Allows Read and Write Access to a Specific S3 Bucket

A policy that allows Read and Write access to a specific S3 bucket. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
Allows Read and Write Access to a Specific S3 Bucket, Programmatically and in the Console.

A policy that allows Read and Write access to a specific S3 bucket. This policy also provides the permissions necessary to complete this action on the console.

CloudFormationTerraformAWS CLI
Allow users to read objects in a portion of the S3 bucket.

A policy that allows Read access to a specific folder within an S3 bucket. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
Allow users to only drop files to a specific folder within an S3 bucket.

A policy that allows write access to a specific folder within an S3 bucket. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
DynamoDB
Allows Access to a Specific DynamoDB Table

A policy that allows full access to a DynamoDB table with the specified name. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
Allows Access to Specific Columns in a DynamoDB table

A policy that allows access to the specific DynamoDB columns. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
Allow Read-only Access on Items in a Table

An IAM policy that grants permissions for the GetItem and BatchGetItem DynamoDB actions only and thereby sets read-only access to a table. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
Allow Access to a Specific Table and All of Its Indexes

An IAM policy that grants permissions policy grants permissions for all of the DynamoDB actions on a specific table and all of the table's indexes. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
Prevent a User from Purchasing Reserved Capacity Offerings

An IAM policy that allows users to view reserved capacity offerings and current purchases using the AWS Management Console—but new purchases are denied. This policy provides the permissions necessary to complete this action using the AWS Console or AWS API/AWS CLI.

CloudFormationTerraformAWS CLI
Allow Read Access for a DynamoDB Stream Only (Not for the Table)

An IAM policy that grants users permissions to access the streams on a DynamoDB table, but not to the table itself. This policy provides the permissions necessary to complete this action using the AWS API or AWS CLI only.

CloudFormationTerraformAWS CLI
Billing
Allow IAM users to view your billing information

An IAM policy that allows IAM users to view the following Billing and Cost Management console pages, without giving them access to the Account Settings or Reports console pages. This policy also provides the permissions necessary to complete this action programmatically and in the console.

CloudFormationTerraformAWS CLI
Allow IAM users to access the Reports console page

An IAM policy that allows IAM users to access the Reports console page and to view the usage reports that contain account activity information. This policy also provides the permissions necessary to complete this action in the console.

CloudFormationTerraformAWS CLI
Deny IAM users access to the Billing and Cost Management console

An IAM policy that denies IAM users deny an IAM user access to all Billing and Cost Management console pages.

CloudFormationTerraformAWS CLI
Allow IAM users to view the Billing and Cost Management console, except Account Settings

An IAM policy that allows IAM users to view the following Billing and Cost Management console pages, without giving them access to the Account Settings or Reports console pages. This policy also provides the permissions necessary to complete this action programmatically and in the console.

CloudFormationTerraformAWS CLI
Allow IAM users to modify billing information

An IAM policy that allows IAM users to modify the Consolidated Billing, Preferences, and Credits console pages. It also allows an IAM user to view the following Billing and Cost Management console pages: Dashboard, Cost Explorer, Bills, Payment History, Advance Payment.

CloudFormationTerraformAWS CLI
Allow IAM users to create budgets

An IAM policy that allows IAM users to modify the Budget console page. To allow IAM users to create budgets in the Billing and Cost Management console, you must also allow IAM users to view your billing information, create CloudWatch alarms, and create Amazon SNS notifications.

CloudFormationTerraformAWS CLI
Allow IAM users to create, view, or delete an AWS Cost and Usage report

An IAM policy that allows IAM users to create, view, or delete an AWS Cost and Usage report using the API.

CloudFormationTerraformAWS CLI