# 60 AWS IAM policy examples, each with a least privilege rewrite

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

AWS IAM policy examples based on AWS documentation, each with a plain-English reading, the number of actions it grants on 16 Nov 2026 and a least privilege rewrite. Each example opens in the workbench, where you can change it and watch the counts and the six checks update in your browser, with nothing uploaded.

| Example | Type | Service | Actions granted | Flags |
| --- | --- | --- | --- | --- |
| [IAM policy example: read one S3 bucket](/examples/s3-read-one-bucket/) | identity | s3 | 81 | 0 |
| [IAM policy example: read and write one S3 bucket](/examples/s3-read-write-one-bucket/) | identity | s3 | 180 | 0 |
| [IAM policy example: give each user an S3 home folder](/examples/s3-home-folder-by-username/) | identity | s3 | 181 | 0 |
| [IAM policy example: deny S3 requests without TLS](/examples/s3-deny-non-tls-requests/) | identity | s3 | 180 | 0 |
| [IAM policy example: require KMS encryption on S3 uploads](/examples/s3-put-with-kms-encryption/) | identity | s3 | 40 | 0 |
| [IAM policy example: list S3 buckets in the console](/examples/s3-list-buckets-console/) | identity | s3 | 19 | 0 |
| [IAM policy example: upload to one S3 prefix](/examples/s3-upload-only-prefix/) | identity | s3 | 180 | 0 |
| [IAM policy example: limit S3 access to a VPC endpoint](/examples/s3-access-only-from-vpc-endpoint/) | identity | s3 | 180 | 0 |
| [IAM policy example: read EC2 inventory](/examples/ec2-describe-read-only/) | identity | ec2 | 195 | 0 |
| [IAM policy example: start and stop tagged EC2 instances](/examples/ec2-start-stop-own-tagged-instances/) | identity | ec2 | 834 | 0 |
| [IAM policy example: limit EC2 actions to one Region](/examples/ec2-actions-in-one-region/) | identity | ec2 | 834 | 1 |
| [IAM policy example: launch EC2 instances in one subnet](/examples/ec2-run-instances-in-one-subnet/) | identity | ec2 | 1 | 0 |
| [IAM policy example: snapshot tagged EBS volumes](/examples/ec2-create-snapshots-tagged-volumes/) | identity | ec2 | 3 | 1 |
| [IAM policy example: invoke one Lambda function](/examples/lambda-invoke-one-function/) | identity | lambda | 135 | 1 |
| [IAM policy example: deploy code to one Lambda function](/examples/lambda-deploy-one-function/) | identity | lambda | 15 | 0 |
| [IAM policy example: let a Lambda function write logs](/examples/lambda-execution-role-write-logs/) | identity | logs | 133 | 1 |
| [IAM policy example: let Lambda poll one SQS queue](/examples/lambda-sqs-event-source-permissions/) | identity | sqs | 20 | 1 |
| [IAM policy example: read one DynamoDB table](/examples/dynamodb-read-one-table/) | identity | dynamodb | 34 | 0 |
| [IAM policy example: read and write one DynamoDB table](/examples/dynamodb-crud-one-table/) | identity | dynamodb | 85 | 0 |
| [IAM policy example: limit DynamoDB items to the caller](/examples/dynamodb-leading-keys-per-user/) | identity | dynamodb | 5 | 0 |
| [IAM policy example: read a DynamoDB stream](/examples/dynamodb-read-streams-for-consumer/) | identity | dynamodb | 85 | 0 |
| [IAM policy example: let users manage their own MFA device](/examples/iam-manage-own-mfa-device/) | identity | iam | 10 | 1 |
| [IAM policy example: change your own password and keys](/examples/iam-manage-own-credentials/) | identity | iam | 6 | 0 |
| [IAM policy example: let a user pass one role to Lambda](/examples/iam-pass-one-role-to-lambda/) | identity | iam | 1 | 2 |
| [IAM policy example: let a team create roles under one path](/examples/iam-delegate-role-management-by-path/) | identity | iam | 5 | 0 |
| [IAM policy example: read IAM configuration for an audit](/examples/iam-read-only-audit/) | identity | iam | 73 | 0 |
| [IAM policy example: use one KMS key to encrypt and decrypt](/examples/kms-encrypt-decrypt-one-key/) | identity | kms | 58 | 1 |
| [IAM policy example: use a KMS key only through S3](/examples/kms-use-key-through-s3-only/) | identity | kms | 7 | 0 |
| [IAM policy example: administer KMS keys without using them](/examples/kms-key-administrator-without-use/) | identity | kms | 36 | 1 |
| [IAM policy example: read one Secrets Manager secret](/examples/secretsmanager-read-one-secret/) | identity | secretsmanager | 27 | 1 |
| [IAM policy example: read Secrets Manager secrets by tag](/examples/secretsmanager-read-secrets-by-tag/) | identity | secretsmanager | 5 | 0 |
| [IAM policy example: read a Parameter Store path](/examples/ssm-read-parameter-path/) | identity | ssm | 30 | 0 |
| [IAM policy example: write parameters under a team path](/examples/ssm-write-own-parameter-path/) | identity | ssm | 3 | 0 |
| [IAM policy example: read one CloudWatch Logs group](/examples/logs-read-one-log-group/) | identity | logs | 39 | 0 |
| [IAM policy example: write to one log group](/examples/logs-application-write-logs/) | identity | logs | 133 | 1 |
| [IAM policy example: read CloudTrail events](/examples/cloudtrail-read-recent-events/) | identity | cloudtrail | 66 | 1 |
| [IAM policy example: send messages to one SQS queue](/examples/sqs-send-to-one-queue/) | identity | sqs | 20 | 1 |
| [IAM policy example: consume messages from one SQS queue](/examples/sqs-consume-one-queue/) | identity | sqs | 5 | 0 |
| [IAM policy example: publish to one SNS topic](/examples/sns-publish-to-one-topic/) | identity | sns | 41 | 1 |
| [IAM policy example: put events on one EventBridge bus](/examples/eventbridge-put-events-to-one-bus/) | identity | events | 74 | 1 |
| [IAM policy example: pull images from one ECR repository](/examples/ecr-pull-images-from-one-repository/) | identity | ecr | 65 | 1 |
| [IAM policy example: push images to one ECR repository](/examples/ecr-push-images-to-one-repository/) | identity | ecr | 6 | 0 |
| [IAM policy example: run ECS tasks in one cluster](/examples/ecs-run-tasks-in-one-cluster/) | identity | ecs | 93 | 2 |
| [IAM policy example: read EKS cluster details for kubeconfig](/examples/eks-describe-cluster-for-kubeconfig/) | identity | eks | 74 | 1 |
| [IAM policy example: invoke one Bedrock foundation model](/examples/bedrock-invoke-one-model/) | identity | bedrock | 269 | 1 |
| [IAM policy example: invoke Bedrock models with streaming](/examples/bedrock-invoke-with-streaming/) | identity | bedrock | 3 | 0 |
| [IAM policy example: let EC2 assume a role](/examples/trust-policy-ec2-instance-role/) | trust | sts | 1 | 2 |
| [IAM policy example: let Lambda assume an execution role](/examples/trust-policy-lambda-execution-role/) | trust | sts | 1 | 1 |
| [IAM policy example: cross-account role with external ID](/examples/trust-policy-cross-account-external-id/) | trust | sts | 1 | 0 |
| [IAM policy example: trust GitHub Actions through OIDC](/examples/trust-policy-github-actions-oidc/) | trust | sts | 1 | 0 |
| [IAM policy example: trust one EKS service account](/examples/trust-policy-eks-service-account-irsa/) | trust | sts | 1 | 0 |
| [IAM policy example: trust a service for one resource only](/examples/trust-policy-service-with-source-arn/) | trust | sts | 1 | 1 |
| [IAM policy example: trust a SAML identity provider](/examples/trust-policy-saml-federation/) | trust | sts | 1 | 0 |
| [IAM policy example: trust Identity Center roles](/examples/trust-policy-identity-center-permission-set-role/) | trust | sts | 1 | 1 |
| [IAM policy example: S3 bucket policy for TLS and org](/examples/s3-bucket-policy-enforce-tls-and-organization/) | resource | s3 | 181 | 0 |
| [IAM policy example: write a KMS key policy](/examples/kms-key-policy-account-admin-and-key-user/) | resource | kms | 67 | 2 |
| [IAM policy example: let an SNS topic send to an SQS queue](/examples/sqs-queue-policy-allow-sns-topic/) | resource | sqs | 1 | 0 |
| [IAM policy example: let S3 invoke a Lambda function](/examples/lambda-resource-policy-allow-s3-invoke/) | resource | lambda | 1 | 0 |
| [IAM policy example: SNS topic policy for alarms](/examples/sns-topic-policy-allow-cloudwatch-alarms/) | resource | sns | 1 | 0 |
| [IAM policy example: ECR policy for cross-account pull](/examples/ecr-repository-policy-cross-account-pull/) | resource | ecr | 7 | 0 |

## Related pages

- [AWS IAM actions for the 40 most used services](/actions/)
- [35 AWS managed policies and what each allows](/managed-policies/)
- [Guides](/guides/)

## Sources

- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
