Skip to content

Commit 16516c3

Browse files
Updated CreateLogAnomalyDetector to accept only kms key arn
1 parent 0fbcfa8 commit 16516c3

17 files changed

+742
-128
lines changed

generator/ServiceModels/logs/logs-2014-03-28.api.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,7 @@
16601660
"detectorName":{"shape":"DetectorName"},
16611661
"evaluationFrequency":{"shape":"EvaluationFrequency"},
16621662
"filterPattern":{"shape":"FilterPattern"},
1663-
"kmsKeyId":{"shape":"KmsKeyId"},
1663+
"kmsKeyId":{"shape":"DetectorKmsKeyArn"},
16641664
"anomalyVisibilityTime":{"shape":"AnomalyVisibilityTime"},
16651665
"tags":{"shape":"Tags"}
16661666
}
@@ -2320,6 +2320,11 @@
23202320
"type":"list",
23212321
"member":{"shape":"Destination"}
23222322
},
2323+
"DetectorKmsKeyArn":{
2324+
"type":"string",
2325+
"max":256,
2326+
"pattern":"^arn:aws[a-z\\-]*:kms:[-a-z0-9]*:[0-9]*:key/[-a-z0-9]*$"
2327+
},
23232328
"DetectorName":{
23242329
"type":"string",
23252330
"min":1

generator/ServiceModels/logs/logs-2014-03-28.docs.json

Lines changed: 12 additions & 7 deletions
Large diffs are not rendered by default.

generator/ServiceModels/logs/logs-2014-03-28.normal.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@
680680
{"shape":"ResourceNotFoundException"},
681681
{"shape":"ServiceUnavailableException"}
682682
],
683-
"documentation":"<p>Lists log events from the specified log group. You can list all the log events or filter the results using a filter pattern, a time range, and the name of the log stream.</p> <p>You must have the <code>logs:FilterLogEvents</code> permission to perform this operation.</p> <p>You can specify the log group to search by using either <code>logGroupIdentifier</code> or <code>logGroupName</code>. You must include one of these two parameters, but you can't include both. </p> <p>By default, this operation returns as many log events as can fit in 1 MB (up to 10,000 log events) or all the events found within the specified time range. If the results include a token, that means there are more log events available. You can get additional results by specifying the token in a subsequent call. This operation can return empty results while there are more log events available through the token.</p> <p>The returned log events are sorted by event timestamp, the timestamp when the event was ingested by CloudWatch Logs, and the ID of the <code>PutLogEvents</code> request.</p> <p>If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html\">CloudWatch cross-account observability</a>.</p>"
683+
"documentation":"<p>Lists log events from the specified log group. You can list all the log events or filter the results using one or more of the following:</p> <ul> <li> <p>A filter pattern</p> </li> <li> <p>A time range</p> </li> <li> <p>The log stream name, or a log stream name prefix that matches mutltiple log streams</p> </li> </ul> <p>You must have the <code>logs:FilterLogEvents</code> permission to perform this operation.</p> <p>You can specify the log group to search by using either <code>logGroupIdentifier</code> or <code>logGroupName</code>. You must include one of these two parameters, but you can't include both. </p> <p> <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. 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> <p>Partially full or empty pages 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 <code>FilterLogEvents</code> operation. If the results don't include a <code>nextToken</code>, then pagination is finished. </p> <note> <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. This can happen when the new log events are being added to the target log streams 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> </note> <p>The returned log events are sorted by event timestamp, the timestamp when the event was ingested by CloudWatch Logs, and the ID of the <code>PutLogEvents</code> request.</p> <p>If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html\">CloudWatch cross-account observability</a>.</p> <note> <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 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> </p> </note>"
684684
},
685685
"GetDataProtectionPolicy":{
686686
"name":"GetDataProtectionPolicy",
@@ -793,7 +793,7 @@
793793
{"shape":"ServiceUnavailableException"},
794794
{"shape":"OperationAbortedException"}
795795
],
796-
"documentation":"<p>Retrieves information about the log anomaly detector that you specify.</p>"
796+
"documentation":"<p>Retrieves information about the log anomaly detector that you specify. The KMS key ARN detected is valid.</p>"
797797
},
798798
"GetLogEvents":{
799799
"name":"GetLogEvents",
@@ -808,7 +808,7 @@
808808
{"shape":"ResourceNotFoundException"},
809809
{"shape":"ServiceUnavailableException"}
810810
],
811-
"documentation":"<p>Lists log events from the specified log stream. You can list all of the log events or filter using a time range.</p> <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). You can get additional log events by specifying one of the tokens in a subsequent call. This operation can return empty results while there are more log events available through the token.</p> <p>If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html\">CloudWatch cross-account observability</a>.</p> <p>You can specify the log group to search by using either <code>logGroupIdentifier</code> or <code>logGroupName</code>. You must include one of these two parameters, but you can't include both. </p>"
811+
"documentation":"<p>Lists log events from the specified log stream. You can list all of the log events or filter using a time range.</p> <p> <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. 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> <p>Partially full or empty pages 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> that you passed into the API call, there might be more 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> <note> <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. This can happen when the new log events are being added to the target log streams 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> </note> <p>If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html\">CloudWatch cross-account observability</a>.</p> <p>You can specify the log group to search by using either <code>logGroupIdentifier</code> or <code>logGroupName</code>. You must include one of these two parameters, but you can't include both. </p> <note> <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 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> </p> </note>"
812812
},
813813
"GetLogGroupFields":{
814814
"name":"GetLogGroupFields",
@@ -1663,7 +1663,7 @@
16631663
},
16641664
"kmsKeyId":{
16651665
"shape":"KmsKeyId",
1666-
"documentation":"<p>The ID of the KMS key assigned to this anomaly detector, if any.</p>"
1666+
"documentation":"<p>The ARN of the KMS key assigned to this anomaly detector, if any.</p>"
16671667
},
16681668
"creationTimeStamp":{
16691669
"shape":"EpochMillis",
@@ -2011,8 +2011,8 @@
20112011
"documentation":"<p>You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html\">Filter and Pattern Syntax</a>.</p>"
20122012
},
20132013
"kmsKeyId":{
2014-
"shape":"KmsKeyId",
2015-
"documentation":"<p>Optionally assigns a KMS key to secure this anomaly detector and its findings. If a key is assigned, the anomalies found and the model used by this detector are encrypted at rest with the key. If a key is assigned to an anomaly detector, a user must have permissions for both this key and for the anomaly detector to retrieve information about the anomalies that it finds.</p> <p>For more information about using a KMS key and to see the required IAM 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>"
2014+
"shape":"DetectorKmsKeyArn",
2015+
"documentation":"<p>Optionally assigns a KMS key to secure this anomaly detector and its findings. If a key is assigned, the anomalies found and the model used by this detector are encrypted at rest with the key. If a key is assigned to an anomaly detector, a user must have permissions for both this key and for the anomaly detector to retrieve information about the anomalies that it finds.</p> <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 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>"
20162016
},
20172017
"anomalyVisibilityTime":{
20182018
"shape":"AnomalyVisibilityTime",
@@ -3101,6 +3101,11 @@
31013101
"type":"list",
31023102
"member":{"shape":"Destination"}
31033103
},
3104+
"DetectorKmsKeyArn":{
3105+
"type":"string",
3106+
"max":256,
3107+
"pattern":"^arn:aws[a-z\\-]*:kms:[-a-z0-9]*:[0-9]*:key/[-a-z0-9]*$"
3108+
},
31043109
"DetectorName":{
31053110
"type":"string",
31063111
"min":1
@@ -3454,7 +3459,7 @@
34543459
},
34553460
"nextToken":{
34563461
"shape":"NextToken",
3457-
"documentation":"<p>The token to use when requesting the next set of items. The token expires after 24 hours.</p>"
3462+
"documentation":"<p>The token to use when requesting the next set of items. The token expires after 24 hours.</p> <p>If the results don't include a <code>nextToken</code>, then pagination is finished. </p>"
34583463
}
34593464
}
34603465
},
@@ -3681,7 +3686,7 @@
36813686
},
36823687
"kmsKeyId":{
36833688
"shape":"KmsKeyId",
3684-
"documentation":"<p>The ID of the KMS key assigned to this anomaly detector, if any.</p>"
3689+
"documentation":"<p>The ARN of the KMS key assigned to this anomaly detector, if any.</p>"
36853690
},
36863691
"creationTimeStamp":{
36873692
"shape":"EpochMillis",

sdk/code-analysis/ServiceAnalysis/CloudWatchLogs/Generated/PropertyValueRules.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
<property-value-rule>
8585
<property>Amazon.CloudWatchLogs.Model.CreateLogAnomalyDetectorRequest.KmsKeyId</property>
8686
<max>256</max>
87+
<pattern>^arn:aws[a-z\-]*:kms:[-a-z0-9]*:[0-9]*:key/[-a-z0-9]*$</pattern>
8788
</property-value-rule>
8889
<property-value-rule>
8990
<property>Amazon.CloudWatchLogs.Model.CreateLogAnomalyDetectorResponse.AnomalyDetectorArn</property>

sdk/src/Services/CloudWatchLogs/Generated/Model/AnomalyDetector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ internal bool IsSetFilterPattern()
180180
/// <summary>
181181
/// Gets and sets the property KmsKeyId.
182182
/// <para>
183-
/// The ID of the KMS key assigned to this anomaly detector, if any.
183+
/// The ARN of the KMS key assigned to this anomaly detector, if any.
184184
/// </para>
185185
/// </summary>
186186
[AWSProperty(Max=256)]

sdk/src/Services/CloudWatchLogs/Generated/Model/CreateLogAnomalyDetectorRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ internal bool IsSetFilterPattern()
181181
/// </para>
182182
///
183183
/// <para>
184-
/// For more information about using a KMS key and to see the required IAM policy, see
185-
/// <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsAnomalyDetection-KMS.html">Use
184+
/// Make sure the value provided is a valid KMS key ARN. For more information about using
185+
/// a KMS key and to see the required IAM policy, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsAnomalyDetection-KMS.html">Use
186186
/// a KMS key with an anomaly detector</a>.
187187
/// </para>
188188
/// </summary>

sdk/src/Services/CloudWatchLogs/Generated/Model/FilterLogEventsRequest.cs

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,21 @@ namespace Amazon.CloudWatchLogs.Model
3232
/// <summary>
3333
/// Container for the parameters to the FilterLogEvents operation.
3434
/// Lists log events from the specified log group. You can list all the log events or
35-
/// filter the results using a filter pattern, a time range, and the name of the log stream.
35+
/// filter the results using one or more of the following:
3636
///
37-
///
37+
/// <ul> <li>
38+
/// <para>
39+
/// A filter pattern
40+
/// </para>
41+
/// </li> <li>
42+
/// <para>
43+
/// A time range
44+
/// </para>
45+
/// </li> <li>
46+
/// <para>
47+
/// The log stream name, or a log stream name prefix that matches mutltiple log streams
48+
/// </para>
49+
/// </li> </ul>
3850
/// <para>
3951
/// You must have the <c>logs:FilterLogEvents</c> permission to perform this operation.
4052
/// </para>
@@ -46,14 +58,31 @@ namespace Amazon.CloudWatchLogs.Model
4658
/// </para>
4759
///
4860
/// <para>
49-
/// By default, this operation returns as many log events as can fit in 1 MB (up to 10,000
50-
/// log events) or all the events found within the specified time range. If the results
51-
/// include a token, that means there are more log events available. You can get additional
52-
/// results by specifying the token in a subsequent call. This operation can return empty
53-
/// results while there are more log events available through the token.
61+
/// <c>FilterLogEvents</c> is a paginated operation. Each page returned can contain up
62+
/// to 1 MB of log events or up to 10,000 log events. A returned page might only be partially
63+
/// full, or even empty. For example, if the result of a query would return 15,000 log
64+
/// events, the first page isn't guaranteed to have 10,000 log events even if they all
65+
/// fit into 1 MB.
5466
/// </para>
5567
///
5668
/// <para>
69+
/// Partially full or empty pages don't necessarily mean that pagination is finished.
70+
/// If the results include a <c>nextToken</c>, there might be more log events available.
71+
/// You can return these additional log events by providing the nextToken in a subsequent
72+
/// <c>FilterLogEvents</c> operation. If the results don't include a <c>nextToken</c>,
73+
/// then pagination is finished.
74+
/// </para>
75+
/// <note>
76+
/// <para>
77+
/// If you set <c>startFromHead</c> to <c>true</c> and you don’t include <c>endTime</c>
78+
/// in your request, you can end up in a situation where the pagination doesn't terminate.
79+
/// This can happen when the new log events are being added to the target log streams
80+
/// faster than they are being read. This situation is a good use case for the CloudWatch
81+
/// Logs <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs_LiveTail.html">Live
82+
/// Tail</a> feature.
83+
/// </para>
84+
/// </note>
85+
/// <para>
5786
/// The returned log events are sorted by event timestamp, the timestamp when the event
5887
/// was ingested by CloudWatch Logs, and the ID of the <c>PutLogEvents</c> request.
5988
/// </para>
@@ -64,6 +93,15 @@ namespace Amazon.CloudWatchLogs.Model
6493
/// see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html">CloudWatch
6594
/// cross-account observability</a>.
6695
/// </para>
96+
/// <note>
97+
/// <para>
98+
/// If you are using <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html">log
99+
/// transformation</a>, the <c>FilterLogEvents</c> operation returns only the original
100+
/// versions of log events, before they were transformed. To view the transformed versions,
101+
/// you must use a <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html">CloudWatch
102+
/// Logs query.</a>
103+
/// </para>
104+
/// </note>
67105
/// </summary>
68106
public partial class FilterLogEventsRequest : AmazonCloudWatchLogsRequest
69107
{

sdk/src/Services/CloudWatchLogs/Generated/Model/FilterLogEventsResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ internal bool IsSetEvents()
6262
/// The token to use when requesting the next set of items. The token expires after 24
6363
/// hours.
6464
/// </para>
65+
///
66+
/// <para>
67+
/// If the results don't include a <c>nextToken</c>, then pagination is finished.
68+
/// </para>
6569
/// </summary>
6670
[AWSProperty(Min=1)]
6771
public string NextToken

sdk/src/Services/CloudWatchLogs/Generated/Model/GetLogAnomalyDetectorRequest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ namespace Amazon.CloudWatchLogs.Model
3131
{
3232
/// <summary>
3333
/// Container for the parameters to the GetLogAnomalyDetector operation.
34-
/// Retrieves information about the log anomaly detector that you specify.
34+
/// Retrieves information about the log anomaly detector that you specify. The KMS key
35+
/// ARN detected is valid.
3536
/// </summary>
3637
public partial class GetLogAnomalyDetectorRequest : AmazonCloudWatchLogsRequest
3738
{

sdk/src/Services/CloudWatchLogs/Generated/Model/GetLogAnomalyDetectorResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ internal bool IsSetFilterPattern()
163163
/// <summary>
164164
/// Gets and sets the property KmsKeyId.
165165
/// <para>
166-
/// The ID of the KMS key assigned to this anomaly detector, if any.
166+
/// The ARN of the KMS key assigned to this anomaly detector, if any.
167167
/// </para>
168168
/// </summary>
169169
[AWSProperty(Max=256)]

0 commit comments

Comments
 (0)