AWS Identity and Access Management
User Guide

Actions, Resources, and Condition Keys for Amazon CloudWatch Logs

Amazon CloudWatch Logs (service prefix: logs) provides the following service-specific resources, actions, and condition context keys for use in IAM permission policies.

References:

Actions Defined by Amazon CloudWatch Logs

You can specify the following actions in the Action element of an IAM policy statement. By using policies, you define the permissions for anyone performing an operation in AWS. When you use an action in a policy, you usually allow or deny access to the API operation or CLI command with the same name. However, in some cases, a single action controls access to more than one operation. Alternatively, some operations require several different actions. For details about the columns in the following table, see The Actions Table.

Actions Description Access Level Resource Types (*required) Condition Keys Dependent Actions
AssociateKmsKey Associates the specified AWS Key Management Service (AWS KMS) customer master key (CMK) with the specified log group. Write

log-group*

CancelExportTask Cancels an export task if it is in PENDING or RUNNING state Write
CreateExportTask Creates an ExportTask which allows you to efficiently export data from a Log Group to your Amazon S3 bucket Write

log-group*

CreateLogGroup Creates a new log group with the specified name Write
CreateLogStream Creates a new log stream with the specified name Write

log-group*

DeleteDestination Deletes the destination with the specified name and eventually disables all the subscription filters that publish to it Write
DeleteLogGroup Deletes the log group with the specified name and permanently deletes all the archived log events associated with it Write

log-group*

DeleteLogStream Deletes a log stream and permanently deletes all the archived log events associated with it Write

log-group*

log-stream*

DeleteMetricFilter Deletes a metric filter associated with the specified log group Write

log-group*

DeleteResourcePolicy Deletes a resource policy from this account Write
DeleteRetentionPolicy Deletes the retention policy of the specified log group Write

log-group*

DeleteSubscriptionFilter Deletes a subscription filter associated with the specified log group Write

log-group*

DescribeDestinations Returns all the destinations that are associated with the AWS account making the request List
DescribeExportTasks Returns all the export tasks that are associated with the AWS account making the request List
DescribeLogGroups Returns all the log groups that are associated with the AWS account making the request List

log-group*

DescribeLogStreams Returns all the log streams that are associated with the specified log group List

log-group*

DescribeMetricFilters Returns all the metrics filters associated with the specified log group List

log-group*

DescribeResourcePolicies Return all the resource policies in this account. List
DescribeSubscriptionFilters Returns all the subscription filters associated with the specified log group List

log-group*

DisassociateKmsKey Disassociates the associated AWS Key Management Service (AWS KMS) customer master key (CMK) from the specified log group Write

log-group*

FilterLogEvents Retrieves log events, optionally filtered by a filter pattern from the specified log group Read

log-group*

GetLogEvents Retrieves log events from the specified log stream Read

log-group*

log-stream*

ListTagsLogGroup Lists the tags for the specified log group List

log-group*

PutDestination Creates or updates a Destination Write
PutDestinationPolicy Creates or updates an access policy associated with an existing Destination Write
PutLogEvents Uploads a batch of log events to the specified log stream Write

log-group*

log-stream*

PutMetricFilter Creates or updates a metric filter and associates it with the specified log group Write

log-group*

PutResourcePolicy Creates or updates a resource policy allowing other AWS services to put log events to this account Write
PutRetentionPolicy Sets the retention of the specified log group Write

log-group*

PutSubscriptionFilter Creates or updates a subscription filter and associates it with the specified log group Write

log-group*

TagLogGroup Adds or updates the specified tags for the specified log group Write

log-group*

TestMetricFilter Tests the filter pattern of a metric filter against a sample of log event messages Read
UntagLogGroup Removes the specified tags from the specified log group Write

log-group*

Resources Defined by CloudWatch Logs

The following resource types are defined by this service and can be used in the Resource element of IAM permission policy statements. Each action in the Actions table identifies the resource types that can be specified with that action. A resource type can also define which condition keys you can include in a policy. These keys are displayed in the last column of the table. For details about the columns in the following table, see The Resource Types Table.

Resource Types ARN Condition Keys
log-group arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}
log-stream arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:${LogStream}:${LogStreamName}

Condition Keys for Amazon CloudWatch Logs

CloudWatch Logs has no service-specific context keys that can be used in the Condition element of policy statements. For the list of the global context keys that are available to all services, see Available Keys for Conditions in the IAM Policy Reference.