Actions, resources, and condition keys for Amazon CloudWatch Logs - Service Authorization Reference

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. Use policies to grant permissions to perform 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.

The Resource types column indicates whether each action supports resource-level permissions. If there is no value for this column, you must specify all resources ("*") in the Resource element of your policy statement. If the column includes a resource type, then you can specify an ARN of that type in a statement with that action. Required resources are indicated in the table with an asterisk (*). If you specify a resource-level permission ARN in a statement using this action, then it must be of this type. Some actions support multiple resource types. If the resource type is optional (not indicated as required), then you can choose to use one but not the other.

For details about the columns in the following table, see Actions table.

Actions Description Access level Resource types (*required) Condition keys Dependent actions
AssociateKmsKey Grants permission to associate the specified AWS Key Management Service (AWS KMS) customer master key (CMK) with the specified log group Write

log-group*

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

log-group*

CreateLogDelivery [permission only] Grants permission to create the log delivery Write
CreateLogGroup Grants permission to create a new log group with the specified name Write

log-group*

aws:TagKeys

aws:RequestTag/${TagKey}

CreateLogStream Grants permission to create a new log stream with the specified name Write

log-group*

DeleteDestination Grants permission to delete the destination with the specified name Write

destination*

DeleteLogDelivery [permission only] Grants permission to delete the log delivery information for specified log delivery Write
DeleteLogGroup Grants permission to delete the log group with the specified name Write

log-group*

DeleteLogStream Grants permission to delete a log stream Write

log-stream*

DeleteMetricFilter Grants permission to delete a metric filter associated with the specified log group Write

log-group*

DeleteQueryDefinition Grants permission to delete a saved CloudWatch Logs Insights query definition Write
DeleteResourcePolicy Grants permission to delete a resource policy from this account Permissions management
DeleteRetentionPolicy Grants permission to delete the retention policy of the specified log group Write

log-group*

DeleteSubscriptionFilter Grants permission to delete a subscription filter associated with the specified log group Write

log-group*

DescribeDestinations Grants permission to return all the destinations that are associated with the AWS account making the request List
DescribeExportTasks Grants permission to return all the export tasks that are associated with the AWS account making the request List
DescribeLogGroups Grants permission to return all the log groups that are associated with the AWS account making the request List

log-group*

DescribeLogStreams Grants permission to return all the log streams that are associated with the specified log group List

log-group*

DescribeMetricFilters Grants permission to return all the metrics filters associated with the specified log group List

log-group*

DescribeQueries Grants permission to return a list of CloudWatch Logs Insights queries that are scheduled, executing, or have been executed recently in this account List
DescribeQueryDefinitions Grants permission to return a paginated list of your saved CloudWatch Logs Insights query definitions List
DescribeResourcePolicies Grants permission to return all the resource policies in this account List
DescribeSubscriptionFilters Grants permission to return all the subscription filters associated with the specified log group List

log-group*

DisassociateKmsKey Grants permission to disassociate the associated AWS Key Management Service (AWS KMS) customer master key (CMK) from the specified log group Write

log-group*

FilterLogEvents Grants permission to retrieve log events, optionally filtered by a filter pattern from the specified log group Read

log-group*

GetLogDelivery [permission only] Grants permission to get the log delivery information for specified log delivery Read
GetLogEvents Grants permission to retrieve log events from the specified log stream Read

log-stream*

GetLogGroupFields Grants permission to return a list of the fields that are included in log events in the specified log group, along with the percentage of log events that contain each field Read

log-group*

GetLogRecord Grants permission to retrieve all the fields and values of a single log event Read
GetQueryResults Grants permission to return the results from the specified query Read
ListLogDeliveries [permission only] Grants permission to list all the log deliveries for specified account and/or log source List
ListTagsForResource Grants permission to list the tags for the specified resource List

destination

log-group

ListTagsLogGroup Grants permission to list the tags for the specified log group List

log-group*

PutDestination Grants permission to create or update a Destination Write

destination*

iam:PassRole

aws:TagKeys

aws:RequestTag/${TagKey}

PutDestinationPolicy Grants permission to create or update an access policy associated with an existing Destination Write

destination*

PutLogEvents Grants permission to upload a batch of log events to the specified log stream Write

log-stream*

PutMetricFilter Grants permission to create or update a metric filter and associates it with the specified log group Write

log-group*

PutQueryDefinition Grants permission to create or update a query definition Write
PutResourcePolicy Grants permission to create or update a resource policy allowing other AWS services to put log events to this account Permissions management
PutRetentionPolicy Grants permission to set the retention of the specified log group Write

log-group*

PutSubscriptionFilter Grants permission to create or update a subscription filter and associates it with the specified log group Write

log-group*

iam:PassRole

destination

StartQuery Grants permission to schedule a query of a log group using CloudWatch Logs Insights Read

log-group*

StopQuery Grants permission to stop a CloudWatch Logs Insights query that is in progress Read
TagLogGroup Grants permission to add or update the specified tags for the specified log group Tagging

log-group*

aws:TagKeys

aws:RequestTag/${TagKey}

TagResource Grants permission to add or update the specified tags for the specified resource Tagging

destination

log-group

aws:TagKeys

aws:RequestTag/${TagKey}

TestMetricFilter Grants permission to test the filter pattern of a metric filter against a sample of log event messages Read
UntagLogGroup Grants permission to remove the specified tags from the specified log group Tagging

log-group*

aws:TagKeys

UntagResource Grants permission to remove the specified tags from the specified resource Tagging

destination

log-group

aws:TagKeys

UpdateLogDelivery [permission only] Grants permission to update the log delivery information for specified log delivery Write

Resource types defined by Amazon 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 Resource types table.

Resource types ARN Condition keys
log-group arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}

aws:ResourceTag/${TagKey}

log-stream arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}
destination arn:${Partition}:logs:${Region}:${Account}:destination:${DestinationName}

aws:ResourceTag/${TagKey}

Condition keys for Amazon CloudWatch Logs

Amazon CloudWatch Logs defines the following condition keys that can be used in the Condition element of an IAM policy. You can use these keys to further refine the conditions under which the policy statement applies. For details about the columns in the following table, see Condition keys table.

To view the global condition keys that are available to all services, see Available global condition keys.

Condition keys Description Type
aws:RequestTag/${TagKey} Filters access by the tags that are passed in the request String
aws:ResourceTag/${TagKey} Filters access by the tags associated with the resource String
aws:TagKeys Filters access by the tag keys that are passed in the request ArrayOfString