Skip to content

Commit a27f1b4

Browse files
author
awstools
committed
feat(client-cloudwatch-logs): Updated CreateLogAnomalyDetector to accept only kms key arn
1 parent 22ff2bf commit a27f1b4

File tree

5 files changed

+68
-21
lines changed

5 files changed

+68
-21
lines changed

clients/client-cloudwatch-logs/src/commands/FilterLogEventsCommand.ts

+28-6
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,43 @@ export interface FilterLogEventsCommandOutput extends FilterLogEventsResponse, _
2929

3030
/**
3131
* <p>Lists log events from the specified log group. You can list all the log events or filter the results
32-
* using a filter pattern, a time range, and the name of the log stream.</p>
32+
* using one or more of the following:</p>
33+
* <ul>
34+
* <li>
35+
* <p>A filter pattern</p>
36+
* </li>
37+
* <li>
38+
* <p>A time range</p>
39+
* </li>
40+
* <li>
41+
* <p>The log stream name, or a log stream name prefix that matches mutltiple log streams</p>
42+
* </li>
43+
* </ul>
3344
* <p>You must have the <code>logs:FilterLogEvents</code> permission to perform this operation.</p>
3445
* <p>You can specify the log group to search by using either <code>logGroupIdentifier</code> or <code>logGroupName</code>.
3546
* You must include one of these two parameters, but you can't include both.
3647
* </p>
37-
* <p>By default, this operation returns as many log events as can fit in 1 MB (up to 10,000
38-
* log events) or all the events found within the specified time range. If the results include a
39-
* token, that means there are more log events available. You can get additional results by
40-
* specifying the token in a subsequent call. This operation can return empty results while there
41-
* are more log events available through the token.</p>
48+
* <p>
49+
* <code>FilterLogEvents</code> is a paginated operation. Each page returned can contain up to 1 MB of log events or up to 10,000 log events. A returned page might only be partially full, or even empty.
50+
* For example, if the result of a query would return 15,000 log events, the first page isn't guaranteed to have 10,000 log events even if they all fit into 1 MB.</p>
51+
* <p>Partially full or empty pages
52+
* don't necessarily mean that pagination is finished. If the results include a <code>nextToken</code>, there might be more log events available. You can return these additional log events by providing the nextToken in a subsequent
53+
* <code>FilterLogEvents</code> operation. If the results don't include a <code>nextToken</code>, then pagination is finished. </p>
54+
* <note>
55+
* <p>If you set <code>startFromHead</code> to <code>true</code> and you don’t include <code>endTime</code> in your request, you can end up in a situation where the pagination doesn't terminate.
56+
* This can happen when the new log events are being added to the target log streams
57+
* faster than they are being read. This situation is a good use case for the CloudWatch Logs <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs_LiveTail.html">Live Tail</a> feature.</p>
58+
* </note>
4259
* <p>The returned log events are sorted by event timestamp, the timestamp when the event was ingested
4360
* by CloudWatch Logs, and the ID of the <code>PutLogEvents</code> request.</p>
4461
* <p>If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and
4562
* view data from the linked source accounts. For more information, see
4663
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html">CloudWatch cross-account observability</a>.</p>
64+
* <note>
65+
* <p>If you are using <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html">log transformation</a>, the <code>FilterLogEvents</code> operation returns only the original versions of log events, before they
66+
* were transformed. To view the transformed versions, you must use a <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html">CloudWatch Logs query.</a>
67+
* </p>
68+
* </note>
4769
* @example
4870
* Use a bare-bones client and the command you need to make an API call.
4971
* ```javascript

clients/client-cloudwatch-logs/src/commands/GetLogAnomalyDetectorCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface GetLogAnomalyDetectorCommandInput extends GetLogAnomalyDetector
2828
export interface GetLogAnomalyDetectorCommandOutput extends GetLogAnomalyDetectorResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Retrieves information about the log anomaly detector that you specify.</p>
31+
* <p>Retrieves information about the log anomaly detector that you specify. The KMS key ARN detected is valid.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript

clients/client-cloudwatch-logs/src/commands/GetLogEventsCommand.ts

+17-3
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,29 @@ export interface GetLogEventsCommandOutput extends GetLogEventsResponse, __Metad
3030
/**
3131
* <p>Lists log events from the specified log stream. You can list all of the log events or
3232
* filter using a time range.</p>
33-
* <p>By default, this operation returns as many log events as can fit in a response size of 1MB (up to 10,000 log events).
34-
* You can get additional log events by specifying one of the tokens in a subsequent call.
35-
* This operation can return empty results while there are more log events available through the token.</p>
33+
* <p>
34+
* <code>GetLogEvents</code> is a paginated operation. Each page returned can contain up to 1 MB of log events or up to 10,000 log events. A returned page might only be partially full, or even empty.
35+
* For example, if the result of a query would return 15,000 log events, the first page isn't guaranteed to have 10,000 log events even if they all fit into 1 MB.</p>
36+
* <p>Partially full or empty pages
37+
* don't necessarily mean that pagination is finished. As long as the <code>nextBackwardToken</code> or <code>nextForwardToken</code> returned is NOT equal to the <code>nextToken</code>
38+
* that you passed into the API call, there might be more
39+
* log events available. The token that you use depends on the direction you want to move in along the log stream. The returned tokens are never null.</p>
40+
* <note>
41+
* <p>If you set <code>startFromHead</code> to <code>true</code> and you don’t include <code>endTime</code> in your request, you can end up in a situation where the pagination doesn't terminate.
42+
* This can happen when the new log events are being added to the target log streams
43+
* faster than they are being read. This situation is a good use case for the CloudWatch Logs <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs_LiveTail.html">Live Tail</a> feature.</p>
44+
* </note>
3645
* <p>If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and
3746
* view data from the linked source accounts. For more information, see
3847
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html">CloudWatch cross-account observability</a>.</p>
3948
* <p>You can specify the log group to search by using either <code>logGroupIdentifier</code> or <code>logGroupName</code>.
4049
* You must include one of these two parameters, but you can't include both.
4150
* </p>
51+
* <note>
52+
* <p>If you are using <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html">log transformation</a>, the <code>GetLogEvents</code> operation returns only the original versions of log events, before they
53+
* were transformed. To view the transformed versions, you must use a <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html">CloudWatch Logs query.</a>
54+
* </p>
55+
* </note>
4256
* @example
4357
* Use a bare-bones client and the command you need to make an API call.
4458
* ```javascript

clients/client-cloudwatch-logs/src/models/models_0.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ export interface AnomalyDetector {
464464
anomalyDetectorStatus?: AnomalyDetectorStatus | undefined;
465465

466466
/**
467-
* <p>The ID of the KMS key assigned to this anomaly detector, if any.</p>
467+
* <p>The ARN of the KMS key assigned to this anomaly detector, if any.</p>
468468
* @public
469469
*/
470470
kmsKeyId?: string | undefined;
@@ -1195,7 +1195,7 @@ export interface CreateLogAnomalyDetectorRequest {
11951195
* assigned, the anomalies found and the model used by this detector are encrypted at rest with the key. If
11961196
* a key is assigned to an anomaly detector, a user must have permissions for both this key and for the
11971197
* anomaly detector to retrieve information about the anomalies that it finds.</p>
1198-
* <p>For more information about using a KMS key and to see the required IAM
1198+
* <p> Make sure the value provided is a valid KMS key ARN. For more information about using a KMS key and to see the required IAM
11991199
* policy, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsAnomalyDetection-KMS.html">Use a KMS key with an anomaly detector</a>.</p>
12001200
* @public
12011201
*/
@@ -3805,6 +3805,7 @@ export interface FilterLogEventsResponse {
38053805

38063806
/**
38073807
* <p>The token to use when requesting the next set of items. The token expires after 24 hours.</p>
3808+
* <p>If the results don't include a <code>nextToken</code>, then pagination is finished. </p>
38083809
* @public
38093810
*/
38103811
nextToken?: string | undefined;
@@ -4422,7 +4423,7 @@ export interface GetLogAnomalyDetectorResponse {
44224423
anomalyDetectorStatus?: AnomalyDetectorStatus | undefined;
44234424

44244425
/**
4425-
* <p>The ID of the KMS key assigned to this anomaly detector, if any.</p>
4426+
* <p>The ARN of the KMS key assigned to this anomaly detector, if any.</p>
44264427
* @public
44274428
*/
44284429
kmsKeyId?: string | undefined;

0 commit comments

Comments
 (0)