Skip to content

Commit cf73137

Browse files
author
awstools
committed
feat(client-cloudwatch-logs): Updates to support CloudWatch Logs data protection and CloudWatch cross-account observability
1 parent ccd70b0 commit cf73137

31 files changed

+2220
-723
lines changed

clients/client-cloudwatch-logs/README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,23 @@ AWS SDK for JavaScript CloudWatchLogs Client for Node.js, Browser and React Nati
1111

1212
<p>You can use Amazon CloudWatch Logs to monitor, store, and access your log files from
1313
EC2 instances, CloudTrail, and other sources. You can then retrieve the associated
14-
log data from CloudWatch Logs using the CloudWatch console, CloudWatch Logs commands in the
15-
Amazon Web Services CLI, CloudWatch Logs API, or CloudWatch Logs SDK.</p>
14+
log data from CloudWatch Logs using the CloudWatch console. Alternatively, you can use
15+
CloudWatch Logs commands in the Amazon Web Services CLI, CloudWatch Logs API, or CloudWatch
16+
Logs SDK.</p>
1617
<p>You can use CloudWatch Logs to:</p>
1718
<ul>
1819
<li>
1920
<p>
20-
<b>Monitor logs from EC2 instances in real-time</b>: You
21+
<b>Monitor logs from EC2 instances in real time</b>: You
2122
can use CloudWatch Logs to monitor applications and systems using log data. For example,
22-
CloudWatch Logs can track the number of errors that occur in your application logs and
23-
send you a notification whenever the rate of errors exceeds a threshold that you specify.
24-
CloudWatch Logs uses your log data for monitoring so no code changes are required. For
25-
example, you can monitor application logs for specific literal terms (such as
26-
"NullReferenceException") or count the number of occurrences of a literal term at a
27-
particular position in log data (such as "404" status codes in an Apache access log). When
28-
the term you are searching for is found, CloudWatch Logs reports the data to a CloudWatch
29-
metric that you specify.</p>
23+
CloudWatch Logs can track the number of errors that occur in your application logs. Then,
24+
it can send you a notification whenever the rate of errors exceeds a threshold that you
25+
specify. CloudWatch Logs uses your log data for monitoring so no code changes are
26+
required. For example, you can monitor application logs for specific literal terms (such
27+
as "NullReferenceException"). You can also count the number of occurrences of a literal
28+
term at a particular position in log data (such as "404" status codes in an Apache access
29+
log). When the term you are searching for is found, CloudWatch Logs reports the data to a
30+
CloudWatch metric that you specify.</p>
3031
</li>
3132
<li>
3233
<p>
@@ -38,9 +39,9 @@ captured by CloudTrail. You can use the notification to perform troubleshooting.
3839
<p>
3940
<b>Archive log data</b>: You can use CloudWatch Logs to
4041
store your log data in highly durable storage. You can change the log retention setting so
41-
that any log events older than this setting are automatically deleted. The CloudWatch Logs
42-
agent makes it easy to quickly send both rotated and non-rotated log data off of a host
43-
and into the log service. You can then access the raw log data when you need it.</p>
42+
that any log events earlier than this setting are automatically deleted. The CloudWatch
43+
Logs agent helps to quickly send both rotated and non-rotated log data off of a host and
44+
into the log service. You can then access the raw log data when you need it.</p>
4445
</li>
4546
</ul>
4647

clients/client-cloudwatch-logs/src/CloudWatchLogs.ts

Lines changed: 274 additions & 114 deletions
Large diffs are not rendered by default.

clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ import { CancelExportTaskCommandInput, CancelExportTaskCommandOutput } from "./c
5252
import { CreateExportTaskCommandInput, CreateExportTaskCommandOutput } from "./commands/CreateExportTaskCommand";
5353
import { CreateLogGroupCommandInput, CreateLogGroupCommandOutput } from "./commands/CreateLogGroupCommand";
5454
import { CreateLogStreamCommandInput, CreateLogStreamCommandOutput } from "./commands/CreateLogStreamCommand";
55+
import {
56+
DeleteDataProtectionPolicyCommandInput,
57+
DeleteDataProtectionPolicyCommandOutput,
58+
} from "./commands/DeleteDataProtectionPolicyCommand";
5559
import { DeleteDestinationCommandInput, DeleteDestinationCommandOutput } from "./commands/DeleteDestinationCommand";
5660
import { DeleteLogGroupCommandInput, DeleteLogGroupCommandOutput } from "./commands/DeleteLogGroupCommand";
5761
import { DeleteLogStreamCommandInput, DeleteLogStreamCommandOutput } from "./commands/DeleteLogStreamCommand";
@@ -101,6 +105,10 @@ import {
101105
} from "./commands/DescribeSubscriptionFiltersCommand";
102106
import { DisassociateKmsKeyCommandInput, DisassociateKmsKeyCommandOutput } from "./commands/DisassociateKmsKeyCommand";
103107
import { FilterLogEventsCommandInput, FilterLogEventsCommandOutput } from "./commands/FilterLogEventsCommand";
108+
import {
109+
GetDataProtectionPolicyCommandInput,
110+
GetDataProtectionPolicyCommandOutput,
111+
} from "./commands/GetDataProtectionPolicyCommand";
104112
import { GetLogEventsCommandInput, GetLogEventsCommandOutput } from "./commands/GetLogEventsCommand";
105113
import { GetLogGroupFieldsCommandInput, GetLogGroupFieldsCommandOutput } from "./commands/GetLogGroupFieldsCommand";
106114
import { GetLogRecordCommandInput, GetLogRecordCommandOutput } from "./commands/GetLogRecordCommand";
@@ -110,6 +118,10 @@ import {
110118
ListTagsForResourceCommandOutput,
111119
} from "./commands/ListTagsForResourceCommand";
112120
import { ListTagsLogGroupCommandInput, ListTagsLogGroupCommandOutput } from "./commands/ListTagsLogGroupCommand";
121+
import {
122+
PutDataProtectionPolicyCommandInput,
123+
PutDataProtectionPolicyCommandOutput,
124+
} from "./commands/PutDataProtectionPolicyCommand";
113125
import { PutDestinationCommandInput, PutDestinationCommandOutput } from "./commands/PutDestinationCommand";
114126
import {
115127
PutDestinationPolicyCommandInput,
@@ -145,6 +157,7 @@ export type ServiceInputTypes =
145157
| CreateExportTaskCommandInput
146158
| CreateLogGroupCommandInput
147159
| CreateLogStreamCommandInput
160+
| DeleteDataProtectionPolicyCommandInput
148161
| DeleteDestinationCommandInput
149162
| DeleteLogGroupCommandInput
150163
| DeleteLogStreamCommandInput
@@ -164,12 +177,14 @@ export type ServiceInputTypes =
164177
| DescribeSubscriptionFiltersCommandInput
165178
| DisassociateKmsKeyCommandInput
166179
| FilterLogEventsCommandInput
180+
| GetDataProtectionPolicyCommandInput
167181
| GetLogEventsCommandInput
168182
| GetLogGroupFieldsCommandInput
169183
| GetLogRecordCommandInput
170184
| GetQueryResultsCommandInput
171185
| ListTagsForResourceCommandInput
172186
| ListTagsLogGroupCommandInput
187+
| PutDataProtectionPolicyCommandInput
173188
| PutDestinationCommandInput
174189
| PutDestinationPolicyCommandInput
175190
| PutLogEventsCommandInput
@@ -192,6 +207,7 @@ export type ServiceOutputTypes =
192207
| CreateExportTaskCommandOutput
193208
| CreateLogGroupCommandOutput
194209
| CreateLogStreamCommandOutput
210+
| DeleteDataProtectionPolicyCommandOutput
195211
| DeleteDestinationCommandOutput
196212
| DeleteLogGroupCommandOutput
197213
| DeleteLogStreamCommandOutput
@@ -211,12 +227,14 @@ export type ServiceOutputTypes =
211227
| DescribeSubscriptionFiltersCommandOutput
212228
| DisassociateKmsKeyCommandOutput
213229
| FilterLogEventsCommandOutput
230+
| GetDataProtectionPolicyCommandOutput
214231
| GetLogEventsCommandOutput
215232
| GetLogGroupFieldsCommandOutput
216233
| GetLogRecordCommandOutput
217234
| GetQueryResultsCommandOutput
218235
| ListTagsForResourceCommandOutput
219236
| ListTagsLogGroupCommandOutput
237+
| PutDataProtectionPolicyCommandOutput
220238
| PutDestinationCommandOutput
221239
| PutDestinationPolicyCommandOutput
222240
| PutLogEventsCommandOutput
@@ -385,22 +403,23 @@ export interface CloudWatchLogsClientResolvedConfig extends CloudWatchLogsClient
385403
/**
386404
* <p>You can use Amazon CloudWatch Logs to monitor, store, and access your log files from
387405
* EC2 instances, CloudTrail, and other sources. You can then retrieve the associated
388-
* log data from CloudWatch Logs using the CloudWatch console, CloudWatch Logs commands in the
389-
* Amazon Web Services CLI, CloudWatch Logs API, or CloudWatch Logs SDK.</p>
406+
* log data from CloudWatch Logs using the CloudWatch console. Alternatively, you can use
407+
* CloudWatch Logs commands in the Amazon Web Services CLI, CloudWatch Logs API, or CloudWatch
408+
* Logs SDK.</p>
390409
* <p>You can use CloudWatch Logs to:</p>
391410
* <ul>
392411
* <li>
393412
* <p>
394-
* <b>Monitor logs from EC2 instances in real-time</b>: You
413+
* <b>Monitor logs from EC2 instances in real time</b>: You
395414
* can use CloudWatch Logs to monitor applications and systems using log data. For example,
396-
* CloudWatch Logs can track the number of errors that occur in your application logs and
397-
* send you a notification whenever the rate of errors exceeds a threshold that you specify.
398-
* CloudWatch Logs uses your log data for monitoring so no code changes are required. For
399-
* example, you can monitor application logs for specific literal terms (such as
400-
* "NullReferenceException") or count the number of occurrences of a literal term at a
401-
* particular position in log data (such as "404" status codes in an Apache access log). When
402-
* the term you are searching for is found, CloudWatch Logs reports the data to a CloudWatch
403-
* metric that you specify.</p>
415+
* CloudWatch Logs can track the number of errors that occur in your application logs. Then,
416+
* it can send you a notification whenever the rate of errors exceeds a threshold that you
417+
* specify. CloudWatch Logs uses your log data for monitoring so no code changes are
418+
* required. For example, you can monitor application logs for specific literal terms (such
419+
* as "NullReferenceException"). You can also count the number of occurrences of a literal
420+
* term at a particular position in log data (such as "404" status codes in an Apache access
421+
* log). When the term you are searching for is found, CloudWatch Logs reports the data to a
422+
* CloudWatch metric that you specify.</p>
404423
* </li>
405424
* <li>
406425
* <p>
@@ -412,9 +431,9 @@ export interface CloudWatchLogsClientResolvedConfig extends CloudWatchLogsClient
412431
* <p>
413432
* <b>Archive log data</b>: You can use CloudWatch Logs to
414433
* store your log data in highly durable storage. You can change the log retention setting so
415-
* that any log events older than this setting are automatically deleted. The CloudWatch Logs
416-
* agent makes it easy to quickly send both rotated and non-rotated log data off of a host
417-
* and into the log service. You can then access the raw log data when you need it.</p>
434+
* that any log events earlier than this setting are automatically deleted. The CloudWatch
435+
* Logs agent helps to quickly send both rotated and non-rotated log data off of a host and
436+
* into the log service. You can then access the raw log data when you need it.</p>
418437
* </li>
419438
* </ul>
420439
*/

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,20 @@ export interface AssociateKmsKeyCommandInput extends AssociateKmsKeyRequest {}
2424
export interface AssociateKmsKeyCommandOutput extends __MetadataBearer {}
2525

2626
/**
27-
* <p>Associates the specified Key Management Service customer master key (CMK) with the specified log group.</p>
28-
* <p>Associating an KMS CMK with a log group overrides any existing associations between the log group and a CMK.
29-
* After a CMK is associated with a log group, all newly ingested data for the log group is encrypted using the CMK.
30-
* This association is stored as long as the data encrypted with the CMK is still within CloudWatch Logs.
31-
* This enables CloudWatch Logs to decrypt this data whenever it is requested.</p>
27+
* <p>Associates the specified KMS key with the specified log
28+
* group.</p>
29+
* <p>Associating a KMS key with a log group overrides any existing
30+
* 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
31+
* using the KMS key. This association is stored as long as the data encrypted
32+
* with the KMS keyis still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.</p>
3233
* <important>
33-
* <p>CloudWatch Logs supports only symmetric CMKs. Do not use an associate an asymmetric CMK
34-
* with your log group. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric
35-
* Keys</a>.</p>
34+
* <p>CloudWatch Logs supports only symmetric KMS keys. Do not use an associate
35+
* 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
36+
* Symmetric and Asymmetric Keys</a>.</p>
3637
* </important>
3738
* <p>It can take up to 5 minutes for this operation to take effect.</p>
38-
* <p>If you attempt to associate a CMK with a log group but the CMK does not exist or the
39-
* CMK is disabled, you receive an <code>InvalidParameterException</code> error. </p>
39+
* <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
40+
* <code>InvalidParameterException</code> error. </p>
4041
* @example
4142
* Use a bare-bones client and the command you need to make an API call.
4243
* ```javascript

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,26 @@ export interface CreateExportTaskCommandInput extends CreateExportTaskRequest {}
2929
export interface CreateExportTaskCommandOutput extends CreateExportTaskResponse, __MetadataBearer {}
3030

3131
/**
32-
* <p>Creates an export task, which allows you to efficiently export data from a
33-
* log group to an Amazon S3 bucket. When you perform a <code>CreateExportTask</code>
34-
* operation, you must use credentials that have permission to write to the S3 bucket
35-
* that you specify as the destination.</p>
36-
* <p>Exporting log data to Amazon S3 buckets that are encrypted by KMS is
37-
* supported. Exporting
38-
* log data to Amazon S3 buckets that have S3 Object Lock enabled with a retention period is also supported.</p>
32+
* <p>Creates an export task so that you can efficiently export data from a log group to an
33+
* Amazon S3 bucket. When you perform a <code>CreateExportTask</code> operation, you must use
34+
* credentials that have permission to write to the S3 bucket that you specify as the
35+
* destination.</p>
36+
* <p>Exporting log data to S3 buckets that are encrypted by KMS is supported.
37+
* Exporting log data to Amazon S3 buckets that have S3 Object Lock enabled with a
38+
* retention period is also supported.</p>
3939
* <p>Exporting to S3 buckets that are encrypted with AES-256 is supported. </p>
4040
* <p>This is an asynchronous call. If all the required information is provided, this
4141
* operation initiates an export task and responds with the ID of the task. After the task has started,
4242
* you can use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeExportTasks.html">DescribeExportTasks</a> to get the status of the export task. Each account can
4343
* only have one active (<code>RUNNING</code> or <code>PENDING</code>) export task at a time.
4444
* To cancel an export task, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CancelExportTask.html">CancelExportTask</a>.</p>
4545
* <p>You can export logs from multiple log groups or multiple time ranges to the same S3
46-
* bucket. To separate out log data for each export task, you can specify a prefix to be used as
47-
* the Amazon S3 key prefix for all exported objects.</p>
46+
* bucket. To separate log data for each export task, specify a prefix to be used as the Amazon
47+
* S3 key prefix for all exported objects.</p>
4848
*
4949
* <note>
50-
* <p>Time-based sorting on chunks of log data inside an exported file is not guaranteed. You can sort the
51-
* exported log fild data by using Linux utilities.</p>
50+
* <p>Time-based sorting on chunks of log data inside an exported file is not guaranteed. You can
51+
* sort the exported log field data by using Linux utilities.</p>
5252
* </note>
5353
* @example
5454
* Use a bare-bones client and the command you need to make an API call.

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export interface CreateLogGroupCommandOutput extends __MetadataBearer {}
2828
* <p>You must use the following guidelines when naming a log group:</p>
2929
* <ul>
3030
* <li>
31-
* <p>Log group names must be unique within a region for an Amazon Web Services account.</p>
31+
* <p>Log group names must be unique within a Region for an Amazon Web Services
32+
* account.</p>
3233
* </li>
3334
* <li>
3435
* <p>Log group names can be between 1 and 512 characters long.</p>
@@ -38,18 +39,19 @@ export interface CreateLogGroupCommandOutput extends __MetadataBearer {}
3839
* '/' (forward slash), '.' (period), and '#' (number sign)</p>
3940
* </li>
4041
* </ul>
41-
* <p>When you create a log group, by default the log events in the log group never expire. To set
42-
* a retention policy so that events expire and are deleted after a specified time, use
43-
* <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutRetentionPolicy.html">PutRetentionPolicy</a>.</p>
44-
* <p>If you associate a Key Management Service customer master key (CMK) with the log group, ingested data is encrypted using the CMK.
45-
* This association is stored as long as the data encrypted with the CMK is still within CloudWatch Logs.
46-
* This enables CloudWatch Logs to decrypt this data whenever it is requested.</p>
47-
* <p>If you attempt to associate a CMK with the log group but the CMK does not exist or the
48-
* CMK is disabled, you receive an <code>InvalidParameterException</code> error. </p>
42+
* <p>When you create a log group, by default the log events in the log group do not expire.
43+
* To set a retention policy so that events expire and are deleted after a specified time, use
44+
* <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutRetentionPolicy.html">PutRetentionPolicy</a>.</p>
45+
* <p>If you associate an KMS key with the log group, ingested data is
46+
* encrypted using the KMS key. This association is stored as long as the data
47+
* encrypted with the KMS key is still within CloudWatch Logs. This enables
48+
* CloudWatch Logs to decrypt this data whenever it is requested.</p>
49+
* <p>If you attempt to associate a KMS key with the log group but the KMS keydoes not exist or the KMS key is disabled, you receive an
50+
* <code>InvalidParameterException</code> error. </p>
4951
* <important>
50-
* <p>CloudWatch Logs supports only symmetric CMKs. Do not associate an asymmetric CMK with
51-
* your log group. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric
52-
* Keys</a>.</p>
52+
* <p>CloudWatch Logs supports only symmetric KMS keys. Do not associate an
53+
* 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
54+
* Symmetric and Asymmetric Keys</a>.</p>
5355
* </important>
5456
* @example
5557
* Use a bare-bones client and the command you need to make an API call.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface CreateLogStreamCommandOutput extends __MetadataBearer {}
3838
* <p>Log stream names can be between 1 and 512 characters long.</p>
3939
* </li>
4040
* <li>
41-
* <p>The ':' (colon) and '*' (asterisk) characters are not allowed.</p>
41+
* <p>Don't use ':' (colon) or '*' (asterisk) characters.</p>
4242
* </li>
4343
* </ul>
4444
* @example

0 commit comments

Comments
 (0)