tag_log_group(
log_group_name: LogGroupName,
tags: Tags,
*,
config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> None
The TagLogGroup operation is on the path to deprecation. We recommend that you use TagResource instead.
Adds or updates the specified tags for the specified log group.
To list the tags for a log group, use ListTagsForResource. To remove tags, use UntagResource.
For more information about tags, see Tag Log Groups in Amazon CloudWatch Logs in the Amazon CloudWatch Logs User Guide.
CloudWatch Logs doesn't support IAM policies that prevent users from assigning specified tags to log groups using the aws:Resource/key-name or aws:TagKeys condition keys. For more information about using tags to control access, see Controlling access to Amazon Web Services resources using tags.
Parameters:
-
log_group_name
(LogGroupName)
–
The name of the log group.
-
tags
(Tags)
–
The key-value pairs to use for the tags.
Raises:
Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
| async def tag_log_group(
self,
log_group_name: "capo_cloudwatch_logs.types.log_group_name.LogGroupName",
tags: "capo_cloudwatch_logs.types.tags.Tags",
*,
config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> None:
"""<important> <p>The TagLogGroup operation is on the path to deprecation. We recommend that you use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_TagResource.html">TagResource</a> instead.</p> </important> <p>Adds or updates the specified tags for the specified log group.</p> <p>To list the tags for a log group, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsForResource.html">ListTagsForResource</a>. To remove tags, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p> <p>For more information about tags, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#log-group-tagging">Tag Log Groups in Amazon CloudWatch Logs</a> in the <i>Amazon CloudWatch Logs User Guide</i>.</p> <p>CloudWatch Logs doesn't support IAM policies that prevent users from assigning specified tags to log groups using the <code>aws:Resource/<i>key-name</i> </code> or <code>aws:TagKeys</code> condition keys. For more information about using tags to control access, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html">Controlling access to Amazon Web Services resources using tags</a>.</p>
Args:
log_group_name: <p>The name of the log group.</p>
tags: <p>The key-value pairs to use for the tags.</p>
Raises:
capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatch_logs.types.tag_log_group_request.TagLogGroupRequest]",
) -> AsyncOperationResponse[None]:
import capo_cloudwatch_logs._operations.logs_20140328.tag_log_group
(
output,
http_response,
) = await capo_cloudwatch_logs._operations.logs_20140328.tag_log_group.async_tag_log_group(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagLogGroup")
)
input_: capo_cloudwatch_logs.types.tag_log_group_request.TagLogGroupRequest = {
"log_group_name": log_group_name,
"tags": tags,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|