Skip to content
IAM Policy Generator

IAM policy example: write to one log group, with a least privilege rewrite

Allows an application role to create log streams and put events in one CloudWatch Logs group and nothing else. The original allows logs:* on every log group. The rewrite lists two actions on one group and its streams. The names and the account ID 111122223333 are AWS documentation placeholders.

Open the workbench ยท All examples

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "WriteLogs",
      "Effect": "Allow",
      "Action": "logs:*",
      "Resource": "*"
    }
  ]
}

What it allows

  • Allows every CloudWatch Logs action on every group.

What it allows

  1. Allow 133 actions (logs:*) on every resource.

    Action or patternActionsAccess levels
    logs:*133List 33, Read 26, Write 68, Permissions management 2, Tagging 4

Checks

The action logs:* covers 133 actions, including deleting groups and changing retention.

Least privilege rewrite

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "WriteOneGroup",
      "Effect": "Allow",
      "Action": [
        "logs:CreateLogStream",
        "logs:PutLogEvents"
      ],
      "Resource": "arn:aws:logs:us-east-1:111122223333:log-group:/app/orders:*"
    }
  ]
}

The rewrite lets the application write only to the /app/orders group. Deleting groups and reading other logs are removed.

What it allows

  1. Allow 2 actions (logs:CreateLogStream, logs:PutLogEvents) on arn:aws:logs:us-east-1:111122223333:log-group:/app/orders:*.

    Action or patternActionsAccess levels
    logs:CreateLogStream1Write 1
    logs:PutLogEvents1Write 1

Checks

No flags from the six checks.

Sources

  1. Amazon CloudWatch Logs User Guide: managing access, read 16 Nov 2026
  2. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.