Skip to content

Commit 0eed872

Browse files
author
awstools
committed
feat(client-cloudwatch): Adds support for setting up Contributor Insight rules on logs transformed via Logs Transformation feature.
1 parent b9f691a commit 0eed872

File tree

10 files changed

+167
-35
lines changed

10 files changed

+167
-35
lines changed

clients/client-cloudwatch/src/commands/DeleteAlarmsCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export interface DeleteAlarmsCommandOutput extends __MetadataBearer {}
3232
* However, this total can include no more than one composite alarm. For example, you could
3333
* delete 99 metric alarms and one composite alarms with one operation, but you can't
3434
* delete two composite alarms with one operation.</p>
35-
* <p> If you specify an incorrect alarm name or make any other error in the operation,
36-
* no alarms are deleted. To confirm that alarms were deleted successfully, you can use the
35+
* <p> If you specify any incorrect alarm names, the alarms you specify with correct names are still deleted. Other syntax errors might result
36+
* in no alarms being deleted. To confirm that alarms were deleted successfully, you can use the
3737
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html">DescribeAlarms</a> operation after using <code>DeleteAlarms</code>.</p>
3838
* <note>
3939
* <p>It is possible to create a loop or cycle of composite alarms, where composite

clients/client-cloudwatch/src/commands/DeleteDashboardsCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ export interface DeleteDashboardsCommandOutput extends DeleteDashboardsOutput, _
5353
* @see {@link DeleteDashboardsCommandOutput} for command's `response` shape.
5454
* @see {@link CloudWatchClientResolvedConfig | config} for CloudWatchClient's `config` shape.
5555
*
56+
* @throws {@link ConflictException} (client fault)
57+
* <p>This operation attempted to create a resource that already exists.</p>
58+
*
5659
* @throws {@link DashboardNotFoundError} (client fault)
5760
* <p>The specified dashboard does not exist.</p>
5861
*

clients/client-cloudwatch/src/commands/DescribeInsightRulesCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export interface DescribeInsightRulesCommandOutput extends DescribeInsightRulesO
5252
* // Schema: "STRING_VALUE", // required
5353
* // Definition: "STRING_VALUE", // required
5454
* // ManagedRule: true || false,
55+
* // ApplyOnTransformedLogs: true || false,
5556
* // },
5657
* // ],
5758
* // };

clients/client-cloudwatch/src/commands/PutDashboardCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ export interface PutDashboardCommandOutput extends PutDashboardOutput, __Metadat
7373
* @see {@link PutDashboardCommandOutput} for command's `response` shape.
7474
* @see {@link CloudWatchClientResolvedConfig | config} for CloudWatchClient's `config` shape.
7575
*
76+
* @throws {@link ConflictException} (client fault)
77+
* <p>This operation attempted to create a resource that already exists.</p>
78+
*
7679
* @throws {@link DashboardInvalidInputError} (client fault)
7780
* <p>Some part of the dashboard data is invalid.</p>
7881
*

clients/client-cloudwatch/src/commands/PutInsightRuleCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export interface PutInsightRuleCommandOutput extends PutInsightRuleOutput, __Met
5050
* Value: "STRING_VALUE", // required
5151
* },
5252
* ],
53+
* ApplyOnTransformedLogs: true || false,
5354
* };
5455
* const command = new PutInsightRuleCommand(input);
5556
* const response = await client.send(command);

clients/client-cloudwatch/src/commands/TagResourceCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export interface TagResourceCommandOutput extends TagResourceOutput, __MetadataB
7272
* @throws {@link ConcurrentModificationException} (client fault)
7373
* <p>More than one process tried to modify a resource at the same time.</p>
7474
*
75+
* @throws {@link ConflictException} (client fault)
76+
* <p>This operation attempted to create a resource that already exists.</p>
77+
*
7578
* @throws {@link InternalServiceFault} (server fault)
7679
* <p>Request processing has failed due to some unknown error, exception, or
7780
* failure.</p>

clients/client-cloudwatch/src/commands/UntagResourceCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export interface UntagResourceCommandOutput extends UntagResourceOutput, __Metad
5656
* @throws {@link ConcurrentModificationException} (client fault)
5757
* <p>More than one process tried to modify a resource at the same time.</p>
5858
*
59+
* @throws {@link ConflictException} (client fault)
60+
* <p>This operation attempted to create a resource that already exists.</p>
61+
*
5962
* @throws {@link InternalServiceFault} (server fault)
6063
* <p>Request processing has failed due to some unknown error, exception, or
6164
* failure.</p>

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

Lines changed: 64 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export interface MetricStat {
261261
* <p>The granularity, in seconds, of the returned data points. For metrics with regular
262262
* resolution, a period can be as short as one minute (60 seconds) and must be a multiple
263263
* of 60. For high-resolution metrics that are collected at intervals of less than one
264-
* minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
264+
* minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution
265265
* metrics are those metrics stored by a <code>PutMetricData</code> call that includes a
266266
* <code>StorageResolution</code> of 1 second.</p>
267267
* <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than
@@ -401,7 +401,7 @@ export interface MetricDataQuery {
401401
* <p>The granularity, in seconds, of the returned data points. For metrics with regular
402402
* resolution, a period can be as short as one minute (60 seconds) and must be a multiple
403403
* of 60. For high-resolution metrics that are collected at intervals of less than one
404-
* minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
404+
* minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution
405405
* metrics are those metrics stored by a <code>PutMetricData</code> operation that includes
406406
* a <code>StorageResolution of 1 second</code>.</p>
407407
* @public
@@ -825,6 +825,28 @@ export class ConcurrentModificationException extends __BaseException {
825825
}
826826
}
827827

828+
/**
829+
* <p>This operation attempted to create a resource that already exists.</p>
830+
* @public
831+
*/
832+
export class ConflictException extends __BaseException {
833+
readonly name: "ConflictException" = "ConflictException";
834+
readonly $fault: "client" = "client";
835+
Message?: string | undefined;
836+
/**
837+
* @internal
838+
*/
839+
constructor(opts: __ExceptionOptionType<ConflictException, __BaseException>) {
840+
super({
841+
name: "ConflictException",
842+
$fault: "client",
843+
...opts,
844+
});
845+
Object.setPrototypeOf(this, ConflictException.prototype);
846+
this.Message = opts.Message;
847+
}
848+
}
849+
828850
/**
829851
* <p>Represents a specific dashboard.</p>
830852
* @public
@@ -1950,6 +1972,13 @@ export interface InsightRule {
19501972
* @public
19511973
*/
19521974
ManagedRule?: boolean | undefined;
1975+
1976+
/**
1977+
* <p>Displays whether the rule is evaluated on the transformed versions of logs, for log groups
1978+
* that have <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html">Log transformation</a> enabled. If this is <code>false</code>, log events are evaluated before they are transformed.</p>
1979+
* @public
1980+
*/
1981+
ApplyOnTransformedLogs?: boolean | undefined;
19531982
}
19541983

19551984
/**
@@ -2615,8 +2644,8 @@ export interface GetMetricDataInput {
26152644
* clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p>
26162645
* </li>
26172646
* </ul>
2618-
* <p>If you set <code>Period</code> to 5, 10, or 30, the start time of your request is
2619-
* rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second
2647+
* <p>If you set <code>Period</code> to 5, 10, 20, or 30, the start time of your request is
2648+
* rounded down to the nearest time that corresponds to even 5-, 10-, 20-, or 30-second
26202649
* divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the
26212650
* previous 10-second period, the start time of your request is rounded down and you
26222651
* receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous
@@ -2851,8 +2880,8 @@ export interface GetMetricStatisticsInput {
28512880
* clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p>
28522881
* </li>
28532882
* </ul>
2854-
* <p>If you set <code>Period</code> to 5, 10, or 30, the start time of your request is
2855-
* rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second
2883+
* <p>If you set <code>Period</code> to 5, 10, 20, or 30, the start time of your request is
2884+
* rounded down to the nearest time that corresponds to even 5-, 10-, 20-, or 30-second
28562885
* divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the
28572886
* previous 10-second period, the start time of your request is rounded down and you
28582887
* receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous
@@ -2875,7 +2904,7 @@ export interface GetMetricStatisticsInput {
28752904
* <p>The granularity, in seconds, of the returned data points. For metrics with regular
28762905
* resolution, a period can be as short as one minute (60 seconds) and must be a multiple
28772906
* of 60. For high-resolution metrics that are collected at intervals of less than one
2878-
* minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
2907+
* minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution
28792908
* metrics are those metrics stored by a <code>PutMetricData</code> call that includes a
28802909
* <code>StorageResolution</code> of 1 second.</p>
28812910
* <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than
@@ -3386,8 +3415,8 @@ export interface ListMetricsInput {
33863415
MetricName?: string | undefined;
33873416

33883417
/**
3389-
* <p>The dimensions to filter against. Only the dimensions that match exactly will be
3390-
* returned.</p>
3418+
* <p>The dimensions to filter against. Only the dimension with names that match exactly will be
3419+
* returned. If you specify one dimension name and a metric has that dimension and also other dimensions, it will be returned.</p>
33913420
* @public
33923421
*/
33933422
Dimensions?: DimensionFilter[] | undefined;
@@ -3803,7 +3832,7 @@ export interface PutCompositeAlarmInput {
38033832
* <b>Start a Amazon Q Developer operational investigation</b>
38043833
* </p>
38053834
* <p>
3806-
* <code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>ingestigation-group-id</i>
3835+
* <code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i>
38073836
* </code>
38083837
* </p>
38093838
* @public
@@ -4099,6 +4128,22 @@ export interface PutInsightRuleInput {
40994128
* @public
41004129
*/
41014130
Tags?: Tag[] | undefined;
4131+
4132+
/**
4133+
* <p>Specify <code>true</code> to have this rule evalute log events after they have been transformed by
4134+
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html">Log transformation</a>. If you specify <code>true</code>, then the log events in log groups that have transformers will
4135+
* be evaluated by Contributor Insights after being transformed. Log groups that don't have
4136+
* transformers will still have their original log events evaluated by Contributor Insights.</p>
4137+
* <p>The default is <code>false</code>
4138+
* </p>
4139+
* <note>
4140+
* <p>If a log group has a transformer, and transformation fails for some log events, those log events won't be evaluated by
4141+
* Contributor Insights. For information about investigating log transformation failures, see
4142+
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Transformation-Errors-Metrics.html">Transformation metrics and errors</a>.</p>
4143+
* </note>
4144+
* @public
4145+
*/
4146+
ApplyOnTransformedLogs?: boolean | undefined;
41024147
}
41034148

41044149
/**
@@ -4420,7 +4465,7 @@ export interface PutMetricAlarmInput {
44204465
* <b>Start a Amazon Q Developer operational investigation</b>
44214466
* </p>
44224467
* <p>
4423-
* <code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>ingestigation-group-id</i>
4468+
* <code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i>
44244469
* </code>
44254470
* </p>
44264471
* @public
@@ -4647,24 +4692,24 @@ export interface PutMetricAlarmInput {
46474692

46484693
/**
46494694
* <p>The length, in seconds, used each time the metric specified in
4650-
* <code>MetricName</code> is evaluated. Valid values are 10, 30, and any multiple of
4695+
* <code>MetricName</code> is evaluated. Valid values are 10, 20, 30, and any multiple of
46514696
* 60.</p>
46524697
* <p>
46534698
* <code>Period</code> is required for alarms based on static thresholds. If you are
46544699
* creating an alarm based on a metric math expression, you specify the period for each
46554700
* metric within the objects in the <code>Metrics</code> array.</p>
4656-
* <p>Be sure to specify 10 or 30 only for metrics that are stored by a
4701+
* <p>Be sure to specify 10, 20, or 30 only for metrics that are stored by a
46574702
* <code>PutMetricData</code> call with a <code>StorageResolution</code> of 1. If you
4658-
* specify a period of 10 or 30 for a metric that does not have sub-minute resolution, the
4703+
* specify a period of 10, 20, or 30 for a metric that does not have sub-minute resolution, the
46594704
* alarm still attempts to gather data at the period rate that you specify. In this case,
46604705
* it does not receive data for the attempts that do not correspond to a one-minute data
4661-
* resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10
4706+
* resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10, 20,
46624707
* or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than
46634708
* other alarms. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch
46644709
* Pricing</a>.</p>
4665-
* <p>An alarm's total current evaluation period can be no longer than one day, so
4666-
* <code>Period</code> multiplied by <code>EvaluationPeriods</code> cannot be more than
4667-
* 86,400 seconds.</p>
4710+
* <p>An alarm's total current evaluation period can be no longer than seven days, so
4711+
* <code>Period</code> multiplied by <code>EvaluationPeriods</code> can't be more than
4712+
* 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).</p>
46684713
* @public
46694714
*/
46704715
Period?: number | undefined;
@@ -4695,8 +4740,6 @@ export interface PutMetricAlarmInput {
46954740
* you are setting an alarm that requires that a number of consecutive data points be
46964741
* breaching to trigger the alarm, this value specifies that number. If you are setting an
46974742
* "M out of N" alarm, this value is the N.</p>
4698-
* <p>An alarm's total current evaluation period can be no longer than one day, so this
4699-
* number multiplied by <code>Period</code> cannot be more than 86,400 seconds.</p>
47004743
* @public
47014744
*/
47024745
EvaluationPeriods: number | undefined;
@@ -4887,7 +4930,7 @@ export interface PutMetricDataInput {
48874930
* </li>
48884931
* </ul>
48894932
* <p>For details of the requirements for specifying an entity, see
4890-
* <a href="https://docs.aws.amazon.com/adding-your-own-related-telemetry.html">How
4933+
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/adding-your-own-related-telemetry.html">How
48914934
* to add related information to telemetry</a> in the
48924935
* <i>CloudWatch User Guide</i>.</p>
48934936
* </li>

clients/client-cloudwatch/src/protocols/Aws_query.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ import {
110110
AnomalyDetectorType,
111111
CompositeAlarm,
112112
ConcurrentModificationException,
113+
ConflictException,
113114
DashboardEntry,
114115
DashboardInvalidInputError,
115116
DashboardValidationMessage,
@@ -1639,6 +1640,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
16391640
case "ResourceNotFoundException":
16401641
case "com.amazonaws.cloudwatch#ResourceNotFoundException":
16411642
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1643+
case "ConflictException":
1644+
case "com.amazonaws.cloudwatch#ConflictException":
1645+
throw await de_ConflictExceptionRes(parsedOutput, context);
16421646
case "InvalidNextToken":
16431647
case "com.amazonaws.cloudwatch#InvalidNextToken":
16441648
throw await de_InvalidNextTokenRes(parsedOutput, context);
@@ -1683,6 +1687,19 @@ const de_ConcurrentModificationExceptionRes = async (
16831687
return __decorateServiceException(exception, body);
16841688
};
16851689

1690+
/**
1691+
* deserializeAws_queryConflictExceptionRes
1692+
*/
1693+
const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise<ConflictException> => {
1694+
const body = parsedOutput.body;
1695+
const deserialized: any = de_ConflictException(body.Error, context);
1696+
const exception = new ConflictException({
1697+
$metadata: deserializeMetadata(parsedOutput),
1698+
...deserialized,
1699+
});
1700+
return __decorateServiceException(exception, body);
1701+
};
1702+
16861703
/**
16871704
* deserializeAws_queryDashboardInvalidInputErrorRes
16881705
*/
@@ -3396,6 +3413,9 @@ const se_PutInsightRuleInput = (input: PutInsightRuleInput, context: __SerdeCont
33963413
entries[loc] = value;
33973414
});
33983415
}
3416+
if (input[_AOTL] != null) {
3417+
entries[_AOTL] = input[_AOTL];
3418+
}
33993419
return entries;
34003420
};
34013421

@@ -4105,6 +4125,17 @@ const de_ConcurrentModificationException = (output: any, context: __SerdeContext
41054125
return contents;
41064126
};
41074127

4128+
/**
4129+
* deserializeAws_queryConflictException
4130+
*/
4131+
const de_ConflictException = (output: any, context: __SerdeContext): ConflictException => {
4132+
const contents: any = {};
4133+
if (output[_Mes] != null) {
4134+
contents[_Mes] = __expectString(output[_Mes]);
4135+
}
4136+
return contents;
4137+
};
4138+
41084139
/**
41094140
* deserializeAws_queryDashboardEntries
41104141
*/
@@ -4583,6 +4614,9 @@ const de_InsightRule = (output: any, context: __SerdeContext): InsightRule => {
45834614
if (output[_MRana] != null) {
45844615
contents[_MRana] = __parseBoolean(output[_MRana]);
45854616
}
4617+
if (output[_AOTL] != null) {
4618+
contents[_AOTL] = __parseBoolean(output[_AOTL]);
4619+
}
45864620
return contents;
45874621
};
45884622

@@ -5676,6 +5710,7 @@ const _AI = "AccountId";
56765710
const _AN = "AlarmNames";
56775711
const _ANP = "AlarmNamePrefix";
56785712
const _ANl = "AlarmName";
5713+
const _AOTL = "ApplyOnTransformedLogs";
56795714
const _AP = "ActionPrefix";
56805715
const _AR = "AlarmRule";
56815716
const _AS = "AdditionalStatistics";

0 commit comments

Comments
 (0)