Description: Lists all of the available service-specific resources, actions, and condition keys that can be used in IAM policies to control access to Amazon CloudWatch Logs.

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:

- Learn how to configure this service .

- View a list of the API operations available for this service .

- Learn how to secure this service and its resources by using IAM permission policies.

###### Topics

- Actions defined by Amazon CloudWatch Logs
- Resource types defined by Amazon CloudWatch Logs
- Condition keys for Amazon CloudWatch Logs

## 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 of the Actions table indicates whether each action supports resource-level permissions. If there is no value for this column, you must specify all resources ("*") to which the policy applies 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. If the action has one or more required resources, the caller must have permission to use the action with those resources. Required resources are indicated in the table with an asterisk (*). If you limit resource access with the `Resource` element in an IAM policy, you must include an ARN or pattern for each required resource type. Some actions support multiple resource types. If the resource type is optional (not indicated as required), then you can choose to use one of the optional resource types.

The Condition keys column of the Actions table includes keys that you can specify in a policy statement's `Condition` element. For more information on the condition keys that are associated with resources for the service, see the Condition keys column of the Resource types table.

###### Note

Resource condition keys are listed in the Resource types table. You can find a link to the resource type that applies to an action in the Resource types (*required) column of the Actions table. The resource type in the Resource types table includes the Condition keys column, which are the resource condition keys that apply to an action in the Actions table.

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 |  |  |
CreateDelivery | Grants permission to create a delivery connecting a delivery source to a delivery destination | Write | delivery* |  |
delivery-destination* |  |
delivery-source* |  |
| aws:TagKeys aws:RequestTag/${TagKey} |
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* |  |
CreateLogAnomalyDetector | Grants permission to create a log anomaly detector | Write | log-group* |  |
| aws:TagKeys aws:RequestTag/${TagKey} |
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-stream* |  |
DeleteAccountPolicy | Grants permission to delete a data protection policy attached to an account | Write |  |  |
DeleteDataProtectionPolicy | Grants permission to delete a data protection policy attached to a log group | Write | log-group* |  |
DeleteDelivery | Grants permission to delete a delivery | Write | delivery* |  |
DeleteDeliveryDestination | Grants permission to delete a delivery destination after all associated deliveries are deleted | Write | delivery-destination* |  |
DeleteDeliveryDestinationPolicy | Grants permission to delete a delivery destination policy associated with a delivery destination | Write | delivery-destination* |  |
DeleteDeliverySource | Grants permission to delete a delivery source after all associated deliveries are deleted | Write | delivery-destination* |  |
DeleteDestination | Grants permission to delete the destination with the specified name | Write | destination* |  |
DeleteLogAnomalyDetector | Grants permission to delete a log anomaly detector | Write | anomaly-detector* |  |
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* |  |
DescribeAccountPolicies | Grants permission to retrieve a data protection policy attached to an account | List |  |  |
DescribeDeliveries | Grants permission to retrieve a list of deliveries an account | List |  |  |
DescribeDeliveryDestinations | Grants permission to retrieve a list of delivery destinations an account | List |  |  |
DescribeDeliverySources | Grants permission to retrieve a list of delivery sources in an account | List |  |  |
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 |  |  |
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* |  |
GetDataProtectionPolicy | Grants permission to retrieve a data protection policy attached to a log group | Read | log-group* |  |
GetDelivery | Grants permission to retrieve a single delivery | Read | delivery* |  |
GetDeliveryDestination | Grants permission to retrieve a single delivery destination | Read | delivery-destination* |  |
GetDeliveryDestinationPolicy | Grants permission to retrieve a delivery destination policy attached to a delivery destination | Read | delivery-destination* |  |
GetDeliverySource | Grants permission to retrieve a single delivery source | Read | delivery-source* |  |
GetLogAnomalyDetector | Grants permission to get a log anomaly detector | Read | anomaly-detector* |  |
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 | log-group* |  |
GetQueryResults | Grants permission to return the results from the specified query | Read | log-group* |  |
Link [permission only] | Grants permission to share CloudWatch resources with a monitoring account | Write |  |  |
ListAnomalies | Grants permission to list all anomalies detected in the AWS account making the request | List | anomaly-detector |  |
ListLogAnomalyDetectors | Grants permission to return all the anomaly detectors that are associated with the AWS account making the request | List | log-group |  |
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 | anomaly-detector |  |
delivery |  |
delivery-destination |  |
delivery-source |  |
destination |  |
log-group |  |
ListTagsLogGroup | Grants permission to list the tags for the specified log group | List | log-group* |  |
PutAccountPolicy | Grants permission to attach a data protection policy at account level to detect and redact sensitive information from log events | Write |  |  |
PutDataProtectionPolicy | Grants permission to attach a data protection policy to detect and redact sensitive information from log events | Write | log-group* |  |
PutDeliveryDestination | Grants permission to create/update a delivery destination | Write | delivery-destination* |  |
| aws:TagKeys aws:RequestTag/${TagKey} logs:DeliveryDestinationResourceArn |
PutDeliveryDestinationPolicy | Grants permission to attach a delivery destination policy to a delivery destination | Write | delivery-destination* |  |
PutDeliverySource | Grants permission to create/update a delivery source | Write | delivery-source* |  |
| aws:TagKeys aws:RequestTag/${TagKey} logs:LogGeneratingResourceArns |
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 |  |
StartLiveTail | Grants permission to start a Live Tail session in CloudWatch Logs | Read | log-group* |  |
StartQuery | Grants permission to schedule a query of a log group using CloudWatch Logs Insights | Read | log-group* |  |
StopLiveTail [permission only] | Grants permission to stop a Live Tail session that is in progress | Read |  |  |
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 | anomaly-detector |  |
delivery |  |
delivery-destination |  |
delivery-source |  |
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 |  |  |
Unmask [permission only] | Grants permission to fetch unmasked log events that have been redacted with a data protection policy | Read | log-group* |  |
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 | anomaly-detector |  |
delivery |  |
delivery-destination |  |
delivery-source |  |
destination |  |
log-group |  |
| aws:TagKeys |
UpdateAnomaly | Grants permission to update an anomaly reported by a log anomaly detector | Write | anomaly-detector* |  |
UpdateLogAnomalyDetector | Grants permission to update a log anomaly detector | Write | anomaly-detector* |  |
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 Resource types 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}` | aws:ResourceTag/${TagKey}
destination | `arn:$ { Partition}:logs:$ { Region}:$ { Account}:destination:$ { DestinationName}` | aws:ResourceTag/${TagKey}
delivery-source | `arn:$ { Partition}:logs:$ { Region}:$ { Account}:delivery-source:$ { DeliverySourceName}` | aws:ResourceTag/${TagKey}
delivery | `arn:$ { Partition}:logs:$ { Region}:$ { Account}:delivery:$ { DeliveryName}` | aws:ResourceTag/${TagKey}
delivery-destination | `arn:$ { Partition}:logs:$ { Region}:$ { Account}:delivery-destination:$ { DeliveryDestinationName}` | aws:ResourceTag/${TagKey}
anomaly-detector | `arn:$ { Partition}:logs:$ { Region}:$ { Account}:anomaly-detector:$ { DetectorId}` | 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
logs:DeliveryDestinationResourceArn | Filters access by the Log Destination ARN passed in the request | ARN
logs:LogGeneratingResourceArns | Filters access by the Log Generating Resource ARNs passed in the request | ArrayOfARN

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.