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
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 | |||
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 | |||
CreateExportTask | Grants permission to create an ExportTask which allows you to efficiently export data from a Log Group to your Amazon S3 bucket | Write | |||
CreateLogAnomalyDetector | Grants permission to create a log anomaly detector | Write | |||
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 | |||
CreateLogStream | Grants permission to create a new log stream with the specified name | Write | |||
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 | |||
DeleteDelivery | Grants permission to delete a delivery | Write | |||
DeleteDeliveryDestination | Grants permission to delete a delivery destination after all associated deliveries are deleted | Write | |||
DeleteDeliveryDestinationPolicy | Grants permission to delete a delivery destination policy associated with a delivery destination | Write | |||
DeleteDeliverySource | Grants permission to delete a delivery source after all associated deliveries are deleted | Write | |||
DeleteDestination | Grants permission to delete the destination with the specified name | Write | |||
DeleteIndexPolicy | Grants permission to delete an index policy attached to a log group | Write | |||
DeleteIntegration | Grants permission to delete the integration | Write | |||
DeleteLogAnomalyDetector | Grants permission to delete a log anomaly detector | Write | |||
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 | |||
DeleteLogStream | Grants permission to delete a log stream | Write | |||
DeleteMetricFilter | Grants permission to delete a metric filter associated with the specified log group | Write | |||
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 | |||
DeleteSubscriptionFilter | Grants permission to delete a subscription filter associated with the specified log group | Write | |||
DeleteTransformer | Grants permission to delete a transformer associated with the specified log group | Write | |||
DescribeAccountPolicies | Grants permission to retrieve a data protection policy attached to an account | List | |||
DescribeConfigurationTemplates | Grants permission to retrieve a list of configuration templates of available log types | 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 | |||
DescribeFieldIndexes | Grants permission to return all the indexing attributes that are attached with the log groups | List | |||
DescribeIndexPolicies | Grants permission to return all the index policies that are attached with the log groups | 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 | |||
DescribeMetricFilters | Grants permission to return all the metrics filters associated with the specified log group | List | |||
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 | |||
DisassociateKmsKey | Grants permission to disassociate the associated AWS Key Management Service (AWS KMS) customer master key (CMK) from the specified log group | Write | |||
FilterLogEvents | Grants permission to retrieve log events, optionally filtered by a filter pattern from the specified log group | Read | |||
GetDataProtectionPolicy | Grants permission to retrieve a data protection policy attached to a log group | Read | |||
GetDelivery | Grants permission to retrieve a single delivery | Read | |||
GetDeliveryDestination | Grants permission to retrieve a single delivery destination | Read | |||
GetDeliveryDestinationPolicy | Grants permission to retrieve a delivery destination policy attached to a delivery destination | Read | |||
GetDeliverySource | Grants permission to retrieve a single delivery source | Read | |||
GetIntegration | Grants permission to retrieve a single integration | Read | |||
GetLogAnomalyDetector | Grants permission to get a log anomaly detector | Read | |||
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 | |||
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 | |||
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 | |||
GetTransformer | Grants permission to return transformer associated with the specified log group | Read | |||
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 | |||
ListEntitiesForLogGroup [permission only] | Grants permission to retrieve all the entities that are associated with log group | List | |||
ListIntegrations | Grants permission to list all integrations associated with the AWS account making the request | List | |||
ListLogAnomalyDetectors | Grants permission to return all the anomaly detectors that are associated with the AWS account making the request | List | |||
ListLogDeliveries [permission only] | Grants permission to list all the log deliveries for specified account and/or log source | List | |||
ListLogGroupsForEntity [permission only] | Grants permission to retrieve all the log groups that are associated with entity | List | |||
ListLogGroupsForQuery | Grants permission to return all the log groups that are associated with the specified query | List | |||
ListTagsForResource | Grants permission to list the tags for the specified resource | List | |||
ListTagsLogGroup | Grants permission to list the tags for the specified log group | List | |||
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 | |||
PutDeliveryDestination | Grants permission to create/update a delivery destination | Write | |||
PutDeliveryDestinationPolicy | Grants permission to attach a delivery destination policy to a delivery destination | Write | |||
PutDeliverySource | Grants permission to create/update a delivery source | Write | |||
PutDestination | Grants permission to create or update a Destination | Write |
iam:PassRole |
||
PutDestinationPolicy | Grants permission to create or update an access policy associated with an existing Destination | Write | |||
PutIndexPolicy | Grants permission to attach an index policy at log group level to optimize search and query | Write | |||
PutIntegration | Grants permission to create integration between cloudwatch logs and opensearch | Write | |||
PutLogEvents | Grants permission to upload a batch of log events to the specified log stream | Write | |||
PutMetricFilter | Grants permission to create or update a metric filter and associates it with the specified log group | Write | |||
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 | |||
PutSubscriptionFilter | Grants permission to create or update a subscription filter and associates it with the specified log group | Write |
iam:PassRole |
||
PutTransformer | Grants permission to create or update a transformer and associates it with the specified log group | Write | |||
StartLiveTail | Grants permission to start a Live Tail session in CloudWatch Logs | Read | |||
StartQuery | Grants permission to schedule a query of a log group using CloudWatch Logs Insights | Read | |||
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 | |||
TagResource | Grants permission to add or update the specified tags for the specified resource | Tagging | |||
TestMetricFilter | Grants permission to test the filter pattern of a metric filter against a sample of log event messages | Read | |||
TestTransformer | Grants permission to test the transformer 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 | |||
UntagLogGroup | Grants permission to remove the specified tags from the specified log group | Tagging | |||
UntagResource | Grants permission to remove the specified tags from the specified resource | Tagging | |||
UpdateAnomaly | Grants permission to update an anomaly reported by a log anomaly detector | Write | |||
UpdateDeliveryConfiguration | Grants permission to update configuration related to a delivery | Write | |||
UpdateLogAnomalyDetector | Grants permission to update a log anomaly detector | Write | |||
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}
|
|
log-stream |
arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}
|
|
destination |
arn:${Partition}:logs:${Region}:${Account}:destination:${DestinationName}
|
|
delivery-source |
arn:${Partition}:logs:${Region}:${Account}:delivery-source:${DeliverySourceName}
|
|
delivery |
arn:${Partition}:logs:${Region}:${Account}:delivery:${DeliveryName}
|
|
delivery-destination |
arn:${Partition}:logs:${Region}:${Account}:delivery-destination:${DeliveryDestinationName}
|
|
anomaly-detector |
arn:${Partition}:logs:${Region}:${Account}:anomaly-detector:${DetectorId}
|
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 |