@aws-sdk/client-cloudwatch-logs 3.363.0 → 3.368.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2506,6 +2506,7 @@ const de_DescribeMetricFiltersResponse = (output, context) => {
2506
2506
  };
2507
2507
  const de_GetQueryResultsResponse = (output, context) => {
2508
2508
  return (0, smithy_client_1.take)(output, {
2509
+ encryptionKey: smithy_client_1.expectString,
2509
2510
  results: smithy_client_1._json,
2510
2511
  statistics: (_) => de_QueryStatistics(_, context),
2511
2512
  status: smithy_client_1.expectString,
@@ -2399,6 +2399,7 @@ const de_DescribeMetricFiltersResponse = (output, context) => {
2399
2399
  };
2400
2400
  const de_GetQueryResultsResponse = (output, context) => {
2401
2401
  return take(output, {
2402
+ encryptionKey: __expectString,
2402
2403
  results: _json,
2403
2404
  statistics: (_) => de_QueryStatistics(_, context),
2404
2405
  status: __expectString,
@@ -23,17 +23,47 @@ export interface AssociateKmsKeyCommandOutput extends __MetadataBearer {
23
23
  }
24
24
  /**
25
25
  * @public
26
- * <p>Associates the specified KMS key with the specified log
27
- * group.</p>
28
- * <p>Associating a KMS key with a log group overrides any existing
26
+ * <p>Associates the specified KMS key with either one log group in the account, or with all stored
27
+ * CloudWatch Logs query insights results in the account.</p>
28
+ * <p>When you use <code>AssociateKmsKey</code>, you specify either the <code>logGroupName</code> parameter
29
+ * or the <code>resourceIdentifier</code> parameter. You can't specify both of those parameters in the same operation.</p>
30
+ * <ul>
31
+ * <li>
32
+ * <p>Specify the <code>logGroupName</code> parameter to cause all log events stored in the log group to
33
+ * be encrypted with that key. Only the log events ingested after the key is associated are encrypted with that key.</p>
34
+ * <p>Associating a KMS key with a log group overrides any existing
29
35
  * associations between the log group and a KMS key. After a KMS key is associated with a log group, all newly ingested data for the log group is encrypted
30
36
  * using the KMS key. This association is stored as long as the data encrypted
31
- * with the KMS keyis still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.</p>
37
+ * with the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.</p>
38
+ * <p>Associating
39
+ * a key with a log group does not cause the results of queries of that log group to be encrypted with that key. To have query
40
+ * results encrypted with a KMS key, you must use an <code>AssociateKmsKey</code> operation with the <code>resourceIdentifier</code>
41
+ * parameter that specifies a <code>query-result</code> resource. </p>
42
+ * </li>
43
+ * <li>
44
+ * <p>Specify the <code>resourceIdentifier</code> parameter with a <code>query-result</code> resource,
45
+ * to use that key to encrypt the stored results of all future
46
+ * <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html">StartQuery</a>
47
+ * operations in the account. The response from a
48
+ * <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html">GetQueryResults</a>
49
+ * operation will still return
50
+ * the query results in plain text.</p>
51
+ * <p>Even if you have not associated a key with your query results, the query results are encrypted when stored,
52
+ * using the default CloudWatch Logs method.</p>
53
+ * <p>If you run a query from a monitoring account that queries logs in a source account, the
54
+ * query results key from the monitoring account, if any, is used.</p>
55
+ * </li>
56
+ * </ul>
32
57
  * <important>
58
+ * <p>If you delete the key that is used to encrypt log events or log group query results,
59
+ * then all the associated stored log events or query results that were encrypted with that key
60
+ * will be unencryptable and unusable.</p>
61
+ * </important>
62
+ * <note>
33
63
  * <p>CloudWatch Logs supports only symmetric KMS keys. Do not use an associate
34
- * an asymmetric KMS key with your log group. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using
64
+ * an asymmetric KMS key with your log group or query results. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using
35
65
  * Symmetric and Asymmetric Keys</a>.</p>
36
- * </important>
66
+ * </note>
37
67
  * <p>It can take up to 5 minutes for this operation to take effect.</p>
38
68
  * <p>If you attempt to associate a KMS key with a log group but the KMS key does not exist or the KMS key is disabled, you receive an
39
69
  * <code>InvalidParameterException</code> error. </p>
@@ -44,8 +74,9 @@ export interface AssociateKmsKeyCommandOutput extends __MetadataBearer {
44
74
  * // const { CloudWatchLogsClient, AssociateKmsKeyCommand } = require("@aws-sdk/client-cloudwatch-logs"); // CommonJS import
45
75
  * const client = new CloudWatchLogsClient(config);
46
76
  * const input = { // AssociateKmsKeyRequest
47
- * logGroupName: "STRING_VALUE", // required
77
+ * logGroupName: "STRING_VALUE",
48
78
  * kmsKeyId: "STRING_VALUE", // required
79
+ * resourceIdentifier: "STRING_VALUE",
49
80
  * };
50
81
  * const command = new AssociateKmsKeyCommand(input);
51
82
  * const response = await client.send(command);
@@ -23,12 +23,29 @@ export interface DisassociateKmsKeyCommandOutput extends __MetadataBearer {
23
23
  }
24
24
  /**
25
25
  * @public
26
- * <p>Disassociates the associated KMS key from the specified log
27
- * group.</p>
28
- * <p>After the KMS key is disassociated from the log group, CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data
29
- * remains encrypted, and CloudWatch Logs requires permissions for the KMS key
30
- * whenever the encrypted data is requested.</p>
31
- * <p>Note that it can take up to 5 minutes for this operation to take effect.</p>
26
+ * <p>Disassociates the specified KMS key from the specified log
27
+ * group or from all CloudWatch Logs Insights query results in the account.</p>
28
+ * <p>When you use <code>DisassociateKmsKey</code>, you specify either the <code>logGroupName</code> parameter
29
+ * or the <code>resourceIdentifier</code> parameter. You can't specify both of those parameters in the same operation.</p>
30
+ * <ul>
31
+ * <li>
32
+ * <p>Specify the <code>logGroupName</code> parameter to stop using the KMS key
33
+ * to encrypt future log events ingested and stored in the log group. Instead, they will be
34
+ * encrypted with the default CloudWatch Logs method. The log events that were ingested
35
+ * while the key was associated with the log group are still encrypted with that key.
36
+ * Therefore, CloudWatch Logs will need permissions for the key whenever that data is
37
+ * accessed.</p>
38
+ * </li>
39
+ * <li>
40
+ * <p>Specify the <code>resourceIdentifier</code> parameter with the <code>query-result</code>
41
+ * resource to stop using the KMS key to encrypt the results of all
42
+ * future <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html">StartQuery</a>
43
+ * operations in the account. They will instead be encrypted with the default CloudWatch Logs method. The results from queries that ran while the key was associated with
44
+ * the account are still encrypted with that key. Therefore, CloudWatch Logs will need
45
+ * permissions for the key whenever that data is accessed.</p>
46
+ * </li>
47
+ * </ul>
48
+ * <p>It can take up to 5 minutes for this operation to take effect.</p>
32
49
  * @example
33
50
  * Use a bare-bones client and the command you need to make an API call.
34
51
  * ```javascript
@@ -36,7 +53,8 @@ export interface DisassociateKmsKeyCommandOutput extends __MetadataBearer {
36
53
  * // const { CloudWatchLogsClient, DisassociateKmsKeyCommand } = require("@aws-sdk/client-cloudwatch-logs"); // CommonJS import
37
54
  * const client = new CloudWatchLogsClient(config);
38
55
  * const input = { // DisassociateKmsKeyRequest
39
- * logGroupName: "STRING_VALUE", // required
56
+ * logGroupName: "STRING_VALUE",
57
+ * resourceIdentifier: "STRING_VALUE",
40
58
  * };
41
59
  * const command = new DisassociateKmsKeyCommand(input);
42
60
  * const response = await client.send(command);
@@ -62,6 +62,7 @@ export interface GetQueryResultsCommandOutput extends GetQueryResultsResponse, _
62
62
  * // bytesScanned: Number("double"),
63
63
  * // },
64
64
  * // status: "Scheduled" || "Running" || "Complete" || "Failed" || "Cancelled" || "Timeout" || "Unknown",
65
+ * // encryptionKey: "STRING_VALUE",
65
66
  * // };
66
67
  *
67
68
  * ```
@@ -35,7 +35,8 @@ export interface PutSubscriptionFilterCommandOutput extends __MetadataBearer {
35
35
  * filter, for same-account delivery.</p>
36
36
  * </li>
37
37
  * <li>
38
- * <p>A logical destination that belongs to a different account, for cross-account delivery.</p>
38
+ * <p>A logical destination created with <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestination.html">PutDestination</a> that belongs to a different account, for cross-account delivery.
39
+ * We currently support Kinesis Data Streams and Kinesis Data Firehose as logical destinations.</p>
39
40
  * </li>
40
41
  * <li>
41
42
  * <p>An Amazon Kinesis Data Firehose delivery stream that belongs to the same account as
@@ -26,6 +26,15 @@ export interface StartQueryCommandOutput extends StartQueryResponse, __MetadataB
26
26
  * <p>Schedules a query of a log group using CloudWatch Logs Insights. You specify the log group
27
27
  * and time range to query and the query string to use.</p>
28
28
  * <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p>
29
+ * <p>After you run a query using <code>StartQuery</code>, the query results are stored by CloudWatch Logs.
30
+ * You can use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html">GetQueryResults</a> to retrieve
31
+ * the results of a query, using the <code>queryId</code> that <code>StartQuery</code> returns.
32
+ * </p>
33
+ * <p>If you have associated a KMS key with the query results in this account,
34
+ * then
35
+ * <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html">StartQuery</a> uses that key to
36
+ * encrypt the results when it stores them. If no key is associated with query results, the query results are
37
+ * encrypted with the default CloudWatch Logs encryption method.</p>
29
38
  * <p>Queries time out after 60 minutes of runtime. If your queries are timing out, reduce the
30
39
  * time range being searched or partition your query into a number of queries.</p>
31
40
  * <p>If you are using CloudWatch cross-account observability, you can use this operation in a
@@ -59,14 +59,45 @@ export interface AccountPolicy {
59
59
  export interface AssociateKmsKeyRequest {
60
60
  /**
61
61
  * <p>The name of the log group.</p>
62
+ * <p>In your <code>AssociateKmsKey</code> operation,
63
+ * you must specify either the <code>resourceIdentifier</code> parameter or the <code>logGroup</code> parameter,
64
+ * but you can't specify both.</p>
62
65
  */
63
- logGroupName: string | undefined;
66
+ logGroupName?: string;
64
67
  /**
65
68
  * <p>The Amazon Resource Name (ARN) of the KMS key to use when encrypting log
66
69
  * data. This must be a symmetric KMS key. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms">Amazon Resource Names</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric
67
70
  * Keys</a>.</p>
68
71
  */
69
72
  kmsKeyId: string | undefined;
73
+ /**
74
+ * <p>Specifies the target for this operation. You must specify one of the following:</p>
75
+ * <ul>
76
+ * <li>
77
+ * <p>Specify the following ARN to have future <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html">GetQueryResults</a>
78
+ * operations in this account encrypt the results
79
+ * with the specified KMS key. Replace
80
+ * <i>REGION</i> and <i>ACCOUNT_ID</i> with your Region and account ID.</p>
81
+ * <p>
82
+ * <code>arn:aws:logs:<i>REGION</i>:<i>ACCOUNT_ID</i>:query-result:*</code>
83
+ * </p>
84
+ * </li>
85
+ * <li>
86
+ * <p>Specify the ARN of a log group to have CloudWatch Logs use the KMS key
87
+ * to encrypt log events that are ingested and stored by that log group. The log group ARN must be in
88
+ * the following format. Replace
89
+ * <i>REGION</i> and <i>ACCOUNT_ID</i> with your Region and account ID.</p>
90
+ * <p>
91
+ * <code>arn:aws:logs:<i>REGION</i>:<i>ACCOUNT_ID</i>:log-group:<i>LOG_GROUP_NAME</i>
92
+ * </code>
93
+ * </p>
94
+ * </li>
95
+ * </ul>
96
+ * <p>In your <code>AssociateKmsKey</code> operation,
97
+ * you must specify either the <code>resourceIdentifier</code> parameter or the <code>logGroup</code> parameter,
98
+ * but you can't specify both.</p>
99
+ */
100
+ resourceIdentifier?: string;
70
101
  }
71
102
  /**
72
103
  * @public
@@ -1328,8 +1359,39 @@ export interface DescribeSubscriptionFiltersResponse {
1328
1359
  export interface DisassociateKmsKeyRequest {
1329
1360
  /**
1330
1361
  * <p>The name of the log group.</p>
1362
+ * <p>In your <code>DisassociateKmsKey</code> operation,
1363
+ * you must specify either the <code>resourceIdentifier</code> parameter or the <code>logGroup</code> parameter,
1364
+ * but you can't specify both.</p>
1331
1365
  */
1332
- logGroupName: string | undefined;
1366
+ logGroupName?: string;
1367
+ /**
1368
+ * <p>Specifies the target for this operation. You must specify one of the following:</p>
1369
+ * <ul>
1370
+ * <li>
1371
+ * <p>Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key
1372
+ * to encrypt log events that are ingested and stored by that log group. After you run this operation, CloudWatch Logs
1373
+ * encrypts ingested log events with the default CloudWatch Logs method. The log group ARN must be in
1374
+ * the following format. Replace
1375
+ * <i>REGION</i> and <i>ACCOUNT_ID</i> with your Region and account ID.</p>
1376
+ * <p>
1377
+ * <code>arn:aws:logs:<i>REGION</i>:<i>ACCOUNT_ID</i>:log-group:<i>LOG_GROUP_NAME</i>
1378
+ * </code>
1379
+ * </p>
1380
+ * </li>
1381
+ * <li>
1382
+ * <p>Specify the following ARN to stop using this key to encrypt the results of future <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html">StartQuery</a>
1383
+ * operations in this account. Replace
1384
+ * <i>REGION</i> and <i>ACCOUNT_ID</i> with your Region and account ID.</p>
1385
+ * <p>
1386
+ * <code>arn:aws:logs:<i>REGION</i>:<i>ACCOUNT_ID</i>:query-result:*</code>
1387
+ * </p>
1388
+ * </li>
1389
+ * </ul>
1390
+ * <p>In your <code>DisssociateKmsKey</code> operation,
1391
+ * you must specify either the <code>resourceIdentifier</code> parameter or the <code>logGroup</code> parameter,
1392
+ * but you can't specify both.</p>
1393
+ */
1394
+ resourceIdentifier?: string;
1333
1395
  }
1334
1396
  /**
1335
1397
  * @public
@@ -1625,9 +1687,9 @@ export interface GetLogGroupFieldsRequest {
1625
1687
  */
1626
1688
  logGroupName?: string;
1627
1689
  /**
1628
- * <p>The time to set as the center of the query. If you specify <code>time</code>, the 15
1629
- * minutes before this time are queries. If you omit <code>time</code>, the 8 minutes before and
1630
- * 8 minutes after this time are searched.</p>
1690
+ * <p>The time to set as the center of the query. If you specify <code>time</code>, the 8 minutes before and
1691
+ * 8 minutes after this time are searched. If you omit <code>time</code>, the most recent 15 minutes
1692
+ * up to the current time are searched.</p>
1631
1693
  * <p>The <code>time</code> value is specified as epoch time, which is the number of seconds
1632
1694
  * since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
1633
1695
  */
@@ -1755,9 +1817,9 @@ export interface GetQueryResultsResponse {
1755
1817
  */
1756
1818
  results?: ResultField[][];
1757
1819
  /**
1758
- * <p>Includes the number of log events scanned by the query, the number of log events that matched the
1759
- * query criteria, and the total number of bytes in the log events that were scanned. These values
1760
- * reflect the full raw results of the query.</p>
1820
+ * <p>Includes the number of log events scanned by the query, the number of log events that
1821
+ * matched the query criteria, and the total number of bytes in the scanned log events. These
1822
+ * values reflect the full raw results of the query.</p>
1761
1823
  */
1762
1824
  statistics?: QueryStatistics;
1763
1825
  /**
@@ -1768,6 +1830,13 @@ export interface GetQueryResultsResponse {
1768
1830
  * reduce the time range being searched or partition your query into a number of queries.</p>
1769
1831
  */
1770
1832
  status?: QueryStatus | string;
1833
+ /**
1834
+ * <p>If you associated an KMS key with the CloudWatch Logs Insights
1835
+ * query results in this account, this field displays the ARN of the key that's used to encrypt
1836
+ * the query results when <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html">StartQuery</a> stores
1837
+ * them.</p>
1838
+ */
1839
+ encryptionKey?: string;
1771
1840
  }
1772
1841
  /**
1773
1842
  * @public
@@ -1903,9 +1972,9 @@ export interface PutAccountPolicyRequest {
1903
1972
  */
1904
1973
  policyType: PolicyType | string | undefined;
1905
1974
  /**
1906
- * <p>Currently the only valid value for this parameter is <code>GLOBAL</code>, which specifies that the data
1975
+ * <p>Currently the only valid value for this parameter is <code>ALL</code>, which specifies that the data
1907
1976
  * protection policy applies to all log groups in the account. If you omit this parameter, the default
1908
- * of <code>GLOBAL</code> is used.</p>
1977
+ * of <code>ALL</code> is used.</p>
1909
1978
  */
1910
1979
  scope?: Scope | string;
1911
1980
  }
@@ -2372,20 +2441,18 @@ export interface StartQueryRequest {
2372
2441
  /**
2373
2442
  * <p>The log group on which to perform the query.</p>
2374
2443
  * <note>
2375
- * <p>A <code>StartQuery</code> operation must include exactly one
2376
- * of the following parameters:
2377
- * <code>logGroupName</code>, <code>logGroupNames</code> or <code>logGroupIdentifiers</code>.
2378
- * </p>
2444
+ * <p>A <code>StartQuery</code> operation must include exactly one of the following
2445
+ * parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or
2446
+ * <code>logGroupIdentifiers</code>. </p>
2379
2447
  * </note>
2380
2448
  */
2381
2449
  logGroupName?: string;
2382
2450
  /**
2383
2451
  * <p>The list of log groups to be queried. You can include up to 50 log groups.</p>
2384
2452
  * <note>
2385
- * <p>A <code>StartQuery</code> operation must include exactly one
2386
- * of the following parameters:
2387
- * <code>logGroupName</code>, <code>logGroupNames</code> or <code>logGroupIdentifiers</code>.
2388
- * </p>
2453
+ * <p>A <code>StartQuery</code> operation must include exactly one of the following
2454
+ * parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or
2455
+ * <code>logGroupIdentifiers</code>. </p>
2389
2456
  * </note>
2390
2457
  */
2391
2458
  logGroupNames?: string[];
@@ -2395,10 +2462,8 @@ export interface StartQueryRequest {
2395
2462
  * in a source account and you're using a monitoring account, you must specify the ARN of the log
2396
2463
  * group here. The query definition must also be defined in the monitoring account.</p>
2397
2464
  * <p>If you specify an ARN, the ARN can't end with an asterisk (*).</p>
2398
- * <p>A <code>StartQuery</code> operation must include exactly one
2399
- * of the following parameters:
2400
- * <code>logGroupName</code>, <code>logGroupNames</code> or <code>logGroupIdentifiers</code>.
2401
- * </p>
2465
+ * <p>A <code>StartQuery</code> operation must include exactly one of the following parameters:
2466
+ * <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. </p>
2402
2467
  */
2403
2468
  logGroupIdentifiers?: string[];
2404
2469
  /**
@@ -17,8 +17,9 @@ export interface AccountPolicy {
17
17
  accountId?: string;
18
18
  }
19
19
  export interface AssociateKmsKeyRequest {
20
- logGroupName: string | undefined;
20
+ logGroupName?: string;
21
21
  kmsKeyId: string | undefined;
22
+ resourceIdentifier?: string;
22
23
  }
23
24
  export declare class InvalidParameterException extends __BaseException {
24
25
  readonly name: "InvalidParameterException";
@@ -404,7 +405,8 @@ export interface DescribeSubscriptionFiltersResponse {
404
405
  nextToken?: string;
405
406
  }
406
407
  export interface DisassociateKmsKeyRequest {
407
- logGroupName: string | undefined;
408
+ logGroupName?: string;
409
+ resourceIdentifier?: string;
408
410
  }
409
411
  export interface FilteredLogEvent {
410
412
  logStreamName?: string;
@@ -499,6 +501,7 @@ export interface GetQueryResultsResponse {
499
501
  results?: ResultField[][];
500
502
  statistics?: QueryStatistics;
501
503
  status?: QueryStatus | string;
504
+ encryptionKey?: string;
502
505
  }
503
506
  export interface InputLogEvent {
504
507
  timestamp: number | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloudwatch-logs",
3
3
  "description": "AWS SDK for JavaScript Cloudwatch Logs Client for Node.js, Browser and React Native",
4
- "version": "3.363.0",
4
+ "version": "3.368.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",