Skip to content

Commit 464cb91

Browse files
author
awstools
committed
feat(client-cloudtrail): This release includes support for importing existing trails into CloudTrail Lake.
1 parent 6e0d3c0 commit 464cb91

File tree

16 files changed

+3518
-280
lines changed

16 files changed

+3518
-280
lines changed

clients/client-cloudtrail/src/CloudTrail.ts

Lines changed: 181 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
GetEventSelectorsCommandInput,
3838
GetEventSelectorsCommandOutput,
3939
} from "./commands/GetEventSelectorsCommand";
40+
import { GetImportCommand, GetImportCommandInput, GetImportCommandOutput } from "./commands/GetImportCommand";
4041
import {
4142
GetInsightSelectorsCommand,
4243
GetInsightSelectorsCommandInput,
@@ -63,6 +64,12 @@ import {
6364
ListEventDataStoresCommandInput,
6465
ListEventDataStoresCommandOutput,
6566
} from "./commands/ListEventDataStoresCommand";
67+
import {
68+
ListImportFailuresCommand,
69+
ListImportFailuresCommandInput,
70+
ListImportFailuresCommandOutput,
71+
} from "./commands/ListImportFailuresCommand";
72+
import { ListImportsCommand, ListImportsCommandInput, ListImportsCommandOutput } from "./commands/ListImportsCommand";
6673
import {
6774
ListPublicKeysCommand,
6875
ListPublicKeysCommandInput,
@@ -92,12 +99,14 @@ import {
9299
RestoreEventDataStoreCommandInput,
93100
RestoreEventDataStoreCommandOutput,
94101
} from "./commands/RestoreEventDataStoreCommand";
102+
import { StartImportCommand, StartImportCommandInput, StartImportCommandOutput } from "./commands/StartImportCommand";
95103
import {
96104
StartLoggingCommand,
97105
StartLoggingCommandInput,
98106
StartLoggingCommandOutput,
99107
} from "./commands/StartLoggingCommand";
100108
import { StartQueryCommand, StartQueryCommandInput, StartQueryCommandOutput } from "./commands/StartQueryCommand";
109+
import { StopImportCommand, StopImportCommandInput, StopImportCommandOutput } from "./commands/StopImportCommand";
101110
import { StopLoggingCommand, StopLoggingCommandInput, StopLoggingCommandOutput } from "./commands/StopLoggingCommand";
102111
import {
103112
UpdateEventDataStoreCommand,
@@ -453,8 +462,21 @@ export class CloudTrail extends CloudTrailClient {
453462
* events.</p>
454463
* </li>
455464
* </ul>
456-
* <p>For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html">Logging Data and Management Events for Trails
457-
* </a> in the <i>CloudTrail User Guide</i>.</p>
465+
* <p>For more information about logging management and data events, see the following topics in the <i>CloudTrail User Guide</i>:</p>
466+
* <ul>
467+
* <li>
468+
* <p>
469+
* <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html">Logging management events for trails
470+
* </a>
471+
* </p>
472+
* </li>
473+
* <li>
474+
* <p>
475+
* <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html">Logging data events for trails
476+
* </a>
477+
* </p>
478+
* </li>
479+
* </ul>
458480
*/
459481
public getEventSelectors(
460482
args: GetEventSelectorsCommandInput,
@@ -485,6 +507,34 @@ export class CloudTrail extends CloudTrailClient {
485507
}
486508
}
487509

510+
/**
511+
* <p>
512+
* Returns information for the specified import.
513+
* </p>
514+
*/
515+
public getImport(args: GetImportCommandInput, options?: __HttpHandlerOptions): Promise<GetImportCommandOutput>;
516+
public getImport(args: GetImportCommandInput, cb: (err: any, data?: GetImportCommandOutput) => void): void;
517+
public getImport(
518+
args: GetImportCommandInput,
519+
options: __HttpHandlerOptions,
520+
cb: (err: any, data?: GetImportCommandOutput) => void
521+
): void;
522+
public getImport(
523+
args: GetImportCommandInput,
524+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetImportCommandOutput) => void),
525+
cb?: (err: any, data?: GetImportCommandOutput) => void
526+
): Promise<GetImportCommandOutput> | void {
527+
const command = new GetImportCommand(args);
528+
if (typeof optionsOrCb === "function") {
529+
this.send(command, optionsOrCb);
530+
} else if (typeof cb === "function") {
531+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
532+
this.send(command, optionsOrCb || {}, cb);
533+
} else {
534+
return this.send(command, optionsOrCb);
535+
}
536+
}
537+
488538
/**
489539
* <p>Describes the settings for the Insights event selectors that you configured for your trail. <code>GetInsightSelectors</code> shows
490540
* if CloudTrail Insights event logging is enabled on the trail, and if it is, which insight types are enabled.
@@ -677,6 +727,68 @@ export class CloudTrail extends CloudTrailClient {
677727
}
678728
}
679729

730+
/**
731+
* <p>
732+
* Returns a list of failures for the specified import.
733+
* </p>
734+
*/
735+
public listImportFailures(
736+
args: ListImportFailuresCommandInput,
737+
options?: __HttpHandlerOptions
738+
): Promise<ListImportFailuresCommandOutput>;
739+
public listImportFailures(
740+
args: ListImportFailuresCommandInput,
741+
cb: (err: any, data?: ListImportFailuresCommandOutput) => void
742+
): void;
743+
public listImportFailures(
744+
args: ListImportFailuresCommandInput,
745+
options: __HttpHandlerOptions,
746+
cb: (err: any, data?: ListImportFailuresCommandOutput) => void
747+
): void;
748+
public listImportFailures(
749+
args: ListImportFailuresCommandInput,
750+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListImportFailuresCommandOutput) => void),
751+
cb?: (err: any, data?: ListImportFailuresCommandOutput) => void
752+
): Promise<ListImportFailuresCommandOutput> | void {
753+
const command = new ListImportFailuresCommand(args);
754+
if (typeof optionsOrCb === "function") {
755+
this.send(command, optionsOrCb);
756+
} else if (typeof cb === "function") {
757+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
758+
this.send(command, optionsOrCb || {}, cb);
759+
} else {
760+
return this.send(command, optionsOrCb);
761+
}
762+
}
763+
764+
/**
765+
* <p>
766+
* Returns information on all imports, or a select set of imports by <code>ImportStatus</code> or <code>Destination</code>.
767+
* </p>
768+
*/
769+
public listImports(args: ListImportsCommandInput, options?: __HttpHandlerOptions): Promise<ListImportsCommandOutput>;
770+
public listImports(args: ListImportsCommandInput, cb: (err: any, data?: ListImportsCommandOutput) => void): void;
771+
public listImports(
772+
args: ListImportsCommandInput,
773+
options: __HttpHandlerOptions,
774+
cb: (err: any, data?: ListImportsCommandOutput) => void
775+
): void;
776+
public listImports(
777+
args: ListImportsCommandInput,
778+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListImportsCommandOutput) => void),
779+
cb?: (err: any, data?: ListImportsCommandOutput) => void
780+
): Promise<ListImportsCommandOutput> | void {
781+
const command = new ListImportsCommand(args);
782+
if (typeof optionsOrCb === "function") {
783+
this.send(command, optionsOrCb);
784+
} else if (typeof cb === "function") {
785+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
786+
this.send(command, optionsOrCb || {}, cb);
787+
} else {
788+
return this.send(command, optionsOrCb);
789+
}
790+
}
791+
680792
/**
681793
* <p>Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.</p>
682794
* <note>
@@ -908,8 +1020,9 @@ export class CloudTrail extends CloudTrailClient {
9081020
* <p>The <code>PutEventSelectors</code> operation must be called from the region in which
9091021
* the trail was created; otherwise, an <code>InvalidHomeRegionException</code> exception is
9101022
* thrown.</p>
911-
* <p>You can configure up to five event selectors for each trail. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html">Logging data and management events for trails
912-
* </a> and <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html">Quotas in CloudTrail</a>
1023+
* <p>You can configure up to five event selectors for each trail. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html">Logging management events for trails
1024+
* </a>, <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html">Logging data events for trails
1025+
* </a>, and <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html">Quotas in CloudTrail</a>
9131026
* in the <i>CloudTrail User Guide</i>.</p>
9141027
* <p>You can add advanced event selectors, and conditions for your advanced
9151028
* event selectors, up to a maximum of 500 values for all conditions and selectors on a trail.
@@ -1043,6 +1156,42 @@ export class CloudTrail extends CloudTrailClient {
10431156
}
10441157
}
10451158

1159+
/**
1160+
* <p>
1161+
* Starts an import of logged trail events from a source S3 bucket to a destination event data store.
1162+
* </p>
1163+
* <p>
1164+
* When you start a new import, the <code>Destinations</code> and
1165+
* <code>ImportSource</code> parameters are required. Before starting a new import, disable any access control lists (ACLs) attached to the source S3 bucket.
1166+
* For more information about disabling ACLs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling ownership of objects and disabling ACLs for your bucket</a>.
1167+
* </p>
1168+
* <p>
1169+
* When you retry an import, the <code>ImportID</code> parameter is required.
1170+
* </p>
1171+
*/
1172+
public startImport(args: StartImportCommandInput, options?: __HttpHandlerOptions): Promise<StartImportCommandOutput>;
1173+
public startImport(args: StartImportCommandInput, cb: (err: any, data?: StartImportCommandOutput) => void): void;
1174+
public startImport(
1175+
args: StartImportCommandInput,
1176+
options: __HttpHandlerOptions,
1177+
cb: (err: any, data?: StartImportCommandOutput) => void
1178+
): void;
1179+
public startImport(
1180+
args: StartImportCommandInput,
1181+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: StartImportCommandOutput) => void),
1182+
cb?: (err: any, data?: StartImportCommandOutput) => void
1183+
): Promise<StartImportCommandOutput> | void {
1184+
const command = new StartImportCommand(args);
1185+
if (typeof optionsOrCb === "function") {
1186+
this.send(command, optionsOrCb);
1187+
} else if (typeof cb === "function") {
1188+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1189+
this.send(command, optionsOrCb || {}, cb);
1190+
} else {
1191+
return this.send(command, optionsOrCb);
1192+
}
1193+
}
1194+
10461195
/**
10471196
* <p>Starts the recording of Amazon Web Services API calls and log file delivery for a trail. For a trail that is enabled in all regions, this operation must be called from the region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.</p>
10481197
*/
@@ -1099,6 +1248,34 @@ export class CloudTrail extends CloudTrailClient {
10991248
}
11001249
}
11011250

1251+
/**
1252+
* <p>
1253+
* Stops a specified import.
1254+
* </p>
1255+
*/
1256+
public stopImport(args: StopImportCommandInput, options?: __HttpHandlerOptions): Promise<StopImportCommandOutput>;
1257+
public stopImport(args: StopImportCommandInput, cb: (err: any, data?: StopImportCommandOutput) => void): void;
1258+
public stopImport(
1259+
args: StopImportCommandInput,
1260+
options: __HttpHandlerOptions,
1261+
cb: (err: any, data?: StopImportCommandOutput) => void
1262+
): void;
1263+
public stopImport(
1264+
args: StopImportCommandInput,
1265+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: StopImportCommandOutput) => void),
1266+
cb?: (err: any, data?: StopImportCommandOutput) => void
1267+
): Promise<StopImportCommandOutput> | void {
1268+
const command = new StopImportCommand(args);
1269+
if (typeof optionsOrCb === "function") {
1270+
this.send(command, optionsOrCb);
1271+
} else if (typeof cb === "function") {
1272+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1273+
this.send(command, optionsOrCb || {}, cb);
1274+
} else {
1275+
return this.send(command, optionsOrCb);
1276+
}
1277+
}
1278+
11021279
/**
11031280
* <p>Suspends the recording of Amazon Web Services API calls and log file delivery for the specified trail.
11041281
* Under most circumstances, there is no need to use this action. You can update a trail

clients/client-cloudtrail/src/CloudTrailClient.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import { DescribeTrailsCommandInput, DescribeTrailsCommandOutput } from "./comma
7070
import { GetChannelCommandInput, GetChannelCommandOutput } from "./commands/GetChannelCommand";
7171
import { GetEventDataStoreCommandInput, GetEventDataStoreCommandOutput } from "./commands/GetEventDataStoreCommand";
7272
import { GetEventSelectorsCommandInput, GetEventSelectorsCommandOutput } from "./commands/GetEventSelectorsCommand";
73+
import { GetImportCommandInput, GetImportCommandOutput } from "./commands/GetImportCommand";
7374
import {
7475
GetInsightSelectorsCommandInput,
7576
GetInsightSelectorsCommandOutput,
@@ -82,6 +83,8 @@ import {
8283
ListEventDataStoresCommandInput,
8384
ListEventDataStoresCommandOutput,
8485
} from "./commands/ListEventDataStoresCommand";
86+
import { ListImportFailuresCommandInput, ListImportFailuresCommandOutput } from "./commands/ListImportFailuresCommand";
87+
import { ListImportsCommandInput, ListImportsCommandOutput } from "./commands/ListImportsCommand";
8588
import { ListPublicKeysCommandInput, ListPublicKeysCommandOutput } from "./commands/ListPublicKeysCommand";
8689
import { ListQueriesCommandInput, ListQueriesCommandOutput } from "./commands/ListQueriesCommand";
8790
import { ListTagsCommandInput, ListTagsCommandOutput } from "./commands/ListTagsCommand";
@@ -97,8 +100,10 @@ import {
97100
RestoreEventDataStoreCommandInput,
98101
RestoreEventDataStoreCommandOutput,
99102
} from "./commands/RestoreEventDataStoreCommand";
103+
import { StartImportCommandInput, StartImportCommandOutput } from "./commands/StartImportCommand";
100104
import { StartLoggingCommandInput, StartLoggingCommandOutput } from "./commands/StartLoggingCommand";
101105
import { StartQueryCommandInput, StartQueryCommandOutput } from "./commands/StartQueryCommand";
106+
import { StopImportCommandInput, StopImportCommandOutput } from "./commands/StopImportCommand";
102107
import { StopLoggingCommandInput, StopLoggingCommandOutput } from "./commands/StopLoggingCommand";
103108
import {
104109
UpdateEventDataStoreCommandInput,
@@ -119,12 +124,15 @@ export type ServiceInputTypes =
119124
| GetChannelCommandInput
120125
| GetEventDataStoreCommandInput
121126
| GetEventSelectorsCommandInput
127+
| GetImportCommandInput
122128
| GetInsightSelectorsCommandInput
123129
| GetQueryResultsCommandInput
124130
| GetTrailCommandInput
125131
| GetTrailStatusCommandInput
126132
| ListChannelsCommandInput
127133
| ListEventDataStoresCommandInput
134+
| ListImportFailuresCommandInput
135+
| ListImportsCommandInput
128136
| ListPublicKeysCommandInput
129137
| ListQueriesCommandInput
130138
| ListTagsCommandInput
@@ -134,8 +142,10 @@ export type ServiceInputTypes =
134142
| PutInsightSelectorsCommandInput
135143
| RemoveTagsCommandInput
136144
| RestoreEventDataStoreCommandInput
145+
| StartImportCommandInput
137146
| StartLoggingCommandInput
138147
| StartQueryCommandInput
148+
| StopImportCommandInput
139149
| StopLoggingCommandInput
140150
| UpdateEventDataStoreCommandInput
141151
| UpdateTrailCommandInput;
@@ -152,12 +162,15 @@ export type ServiceOutputTypes =
152162
| GetChannelCommandOutput
153163
| GetEventDataStoreCommandOutput
154164
| GetEventSelectorsCommandOutput
165+
| GetImportCommandOutput
155166
| GetInsightSelectorsCommandOutput
156167
| GetQueryResultsCommandOutput
157168
| GetTrailCommandOutput
158169
| GetTrailStatusCommandOutput
159170
| ListChannelsCommandOutput
160171
| ListEventDataStoresCommandOutput
172+
| ListImportFailuresCommandOutput
173+
| ListImportsCommandOutput
161174
| ListPublicKeysCommandOutput
162175
| ListQueriesCommandOutput
163176
| ListTagsCommandOutput
@@ -167,8 +180,10 @@ export type ServiceOutputTypes =
167180
| PutInsightSelectorsCommandOutput
168181
| RemoveTagsCommandOutput
169182
| RestoreEventDataStoreCommandOutput
183+
| StartImportCommandOutput
170184
| StartLoggingCommandOutput
171185
| StartQueryCommandOutput
186+
| StopImportCommandOutput
172187
| StopLoggingCommandOutput
173188
| UpdateEventDataStoreCommandOutput
174189
| UpdateTrailCommandOutput;

clients/client-cloudtrail/src/commands/GetEventSelectorsCommand.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,21 @@ export interface GetEventSelectorsCommandOutput extends GetEventSelectorsRespons
4343
* events.</p>
4444
* </li>
4545
* </ul>
46-
* <p>For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html">Logging Data and Management Events for Trails
47-
* </a> in the <i>CloudTrail User Guide</i>.</p>
46+
* <p>For more information about logging management and data events, see the following topics in the <i>CloudTrail User Guide</i>:</p>
47+
* <ul>
48+
* <li>
49+
* <p>
50+
* <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html">Logging management events for trails
51+
* </a>
52+
* </p>
53+
* </li>
54+
* <li>
55+
* <p>
56+
* <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html">Logging data events for trails
57+
* </a>
58+
* </p>
59+
* </li>
60+
* </ul>
4861
* @example
4962
* Use a bare-bones client and the command you need to make an API call.
5063
* ```javascript

0 commit comments

Comments
 (0)