IAM policy example: write to one log group, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
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
Allow 133 actions (logs:*) on every resource.
Action or pattern Actions Access levels logs:*133 List 33, Read 26, Write 68, Permissions management 2, Tagging 4
Checks
- High Allows 70 write or permissions-management actions (2 permissions management) on every resource ("Resource": "*"). AWS documentation for this check
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
Allow 2 actions (logs:CreateLogStream, logs:PutLogEvents) on arn:aws:logs:us-east-1:111122223333:log-group:/app/orders:*.
Action or pattern Actions Access levels logs:CreateLogStream1 Write 1 logs:PutLogEvents1 Write 1
Checks
No flags from the six checks.
Related pages
Sources
- Amazon CloudWatch Logs User Guide: managing access, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.