@aws-sdk/client-controltower 3.427.0 → 3.429.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.
- package/README.md +52 -12
- package/dist-cjs/ControlTower.js +2 -0
- package/dist-cjs/commands/GetEnabledControlCommand.js +51 -0
- package/dist-cjs/commands/index.js +1 -0
- package/dist-cjs/models/models_0.js +12 -1
- package/dist-cjs/protocols/Aws_restJson1.js +68 -1
- package/dist-es/ControlTower.js +2 -0
- package/dist-es/commands/GetEnabledControlCommand.js +47 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/models/models_0.js +11 -0
- package/dist-es/protocols/Aws_restJson1.js +65 -0
- package/dist-types/ControlTower.d.ts +51 -12
- package/dist-types/ControlTowerClient.d.ts +47 -14
- package/dist-types/commands/DisableControlCommand.d.ts +7 -6
- package/dist-types/commands/EnableControlCommand.d.ts +8 -6
- package/dist-types/commands/GetControlOperationCommand.d.ts +6 -4
- package/dist-types/commands/GetEnabledControlCommand.d.ts +121 -0
- package/dist-types/commands/ListEnabledControlsCommand.d.ts +14 -3
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/index.d.ts +44 -12
- package/dist-types/models/models_0.d.ts +234 -16
- package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
- package/dist-types/ts3.4/ControlTower.d.ts +17 -0
- package/dist-types/ts3.4/ControlTowerClient.d.ts +6 -0
- package/dist-types/ts3.4/commands/GetEnabledControlCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +44 -2
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
- package/package.json +31 -31
package/README.md
CHANGED
|
@@ -6,22 +6,31 @@
|
|
|
6
6
|
|
|
7
7
|
AWS SDK for JavaScript ControlTower Client for Node.js, Browser and React Native.
|
|
8
8
|
|
|
9
|
-
<p>These interfaces allow you to apply the AWS library of pre-defined
|
|
10
|
-
organizational units, programmatically. In
|
|
9
|
+
<p>These interfaces allow you to apply the AWS library of pre-defined
|
|
10
|
+
<i>controls</i> to your organizational units, programmatically. In AWS Control Tower, the terms "control" and "guardrail" are synonyms. .</p>
|
|
11
11
|
<p>To call these APIs, you'll need to know:</p>
|
|
12
12
|
<ul>
|
|
13
13
|
<li>
|
|
14
|
-
<p>the <code>
|
|
15
|
-
guardrail--you are targeting,</p>
|
|
14
|
+
<p>the <code>controlIdentifier</code> for the control--or guardrail--you are targeting.</p>
|
|
16
15
|
</li>
|
|
17
16
|
<li>
|
|
18
|
-
<p>
|
|
17
|
+
<p>the ARN associated with the target organizational unit (OU), which we call the <code>targetIdentifier</code>.</p>
|
|
19
18
|
</li>
|
|
20
19
|
</ul>
|
|
21
20
|
<p>
|
|
22
|
-
<b>To get the <code>
|
|
21
|
+
<b>To get the <code>controlIdentifier</code> for your AWS Control Tower
|
|
22
|
+
control:</b>
|
|
23
23
|
</p>
|
|
24
|
-
<p>The <code>
|
|
24
|
+
<p>The <code>controlIdentifier</code> is an ARN that is specified for each
|
|
25
|
+
control. You can view the <code>controlIdentifier</code> in the console on the <b>Control details</b> page, as well as in the documentation.</p>
|
|
26
|
+
<p>The <code>controlIdentifier</code> is unique in each AWS Region for each control. You can
|
|
27
|
+
find the <code>controlIdentifier</code> for each Region and control in the <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html">Tables of control metadata</a> in the <i>AWS Control Tower User Guide.</i>
|
|
28
|
+
</p>
|
|
29
|
+
<p>A quick-reference list of control identifers for the AWS Control Tower legacy <i>Strongly recommended</i> and
|
|
30
|
+
<i>Elective</i> controls is given in <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html">Resource identifiers for
|
|
31
|
+
APIs and guardrails</a> in the <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html">Controls reference guide section</a>
|
|
32
|
+
of the <i>AWS Control Tower User Guide</i>. Remember that <i>Mandatory</i> controls
|
|
33
|
+
cannot be added or removed.</p>
|
|
25
34
|
<note>
|
|
26
35
|
<p>
|
|
27
36
|
<b>ARN format:</b>
|
|
@@ -35,8 +44,9 @@ guardrail--you are targeting,</p>
|
|
|
35
44
|
</p>
|
|
36
45
|
</note>
|
|
37
46
|
<p>
|
|
38
|
-
<b>To get the
|
|
47
|
+
<b>To get the <code>targetIdentifier</code>:</b>
|
|
39
48
|
</p>
|
|
49
|
+
<p>The <code>targetIdentifier</code> is the ARN for an OU.</p>
|
|
40
50
|
<p>In the AWS Organizations console, you can find the ARN for the OU on the <b>Organizational unit details</b> page associated with that OU.</p>
|
|
41
51
|
<note>
|
|
42
52
|
<p>
|
|
@@ -52,17 +62,32 @@ guardrail--you are targeting,</p>
|
|
|
52
62
|
<ul>
|
|
53
63
|
<li>
|
|
54
64
|
<p>
|
|
55
|
-
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-
|
|
65
|
+
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html">Control API input and output examples with CLI</a>
|
|
66
|
+
</p>
|
|
67
|
+
</li>
|
|
68
|
+
<li>
|
|
69
|
+
<p>
|
|
70
|
+
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/enable-controls.html">Enable controls with CloudFormation</a>
|
|
56
71
|
</p>
|
|
57
72
|
</li>
|
|
58
73
|
<li>
|
|
59
74
|
<p>
|
|
60
|
-
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/
|
|
75
|
+
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html">Control metadata tables</a>
|
|
61
76
|
</p>
|
|
62
77
|
</li>
|
|
63
78
|
<li>
|
|
64
79
|
<p>
|
|
65
|
-
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/
|
|
80
|
+
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html">List of identifiers for legacy controls</a>
|
|
81
|
+
</p>
|
|
82
|
+
</li>
|
|
83
|
+
<li>
|
|
84
|
+
<p>
|
|
85
|
+
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/controls.html">Controls reference guide</a>
|
|
86
|
+
</p>
|
|
87
|
+
</li>
|
|
88
|
+
<li>
|
|
89
|
+
<p>
|
|
90
|
+
<a href="https://docs.aws.amazon.com/controltower/latest/userguide/controls-reference.html">Controls library groupings</a>
|
|
66
91
|
</p>
|
|
67
92
|
</li>
|
|
68
93
|
<li>
|
|
@@ -76,7 +101,14 @@ guardrail--you are targeting,</p>
|
|
|
76
101
|
<p>
|
|
77
102
|
<b>Recording API Requests</b>
|
|
78
103
|
</p>
|
|
79
|
-
<p>AWS Control Tower supports AWS CloudTrail, a service that records AWS API calls for your
|
|
104
|
+
<p>AWS Control Tower supports AWS CloudTrail, a service that records AWS API calls for your
|
|
105
|
+
AWS account and delivers log files to an Amazon S3 bucket. By using information collected by
|
|
106
|
+
CloudTrail, you can determine which requests the AWS Control Tower service received, who made
|
|
107
|
+
the request and when, and so on. For more about AWS Control Tower and its support for
|
|
108
|
+
CloudTrail, see <a href="https://docs.aws.amazon.com/controltower/latest/userguide/logging-using-cloudtrail.html">Logging AWS Control Tower
|
|
109
|
+
Actions with AWS CloudTrail</a> in the AWS Control Tower User Guide. To learn more about
|
|
110
|
+
CloudTrail, including how to turn it on and find your log files, see the AWS CloudTrail User
|
|
111
|
+
Guide.</p>
|
|
80
112
|
|
|
81
113
|
## Installing
|
|
82
114
|
|
|
@@ -296,6 +328,14 @@ GetControlOperation
|
|
|
296
328
|
|
|
297
329
|
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/classes/getcontroloperationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/getcontroloperationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/getcontroloperationcommandoutput.html)
|
|
298
330
|
|
|
331
|
+
</details>
|
|
332
|
+
<details>
|
|
333
|
+
<summary>
|
|
334
|
+
GetEnabledControl
|
|
335
|
+
</summary>
|
|
336
|
+
|
|
337
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/classes/getenabledcontrolcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/getenabledcontrolcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-controltower/interfaces/getenabledcontrolcommandoutput.html)
|
|
338
|
+
|
|
299
339
|
</details>
|
|
300
340
|
<details>
|
|
301
341
|
<summary>
|
package/dist-cjs/ControlTower.js
CHANGED
|
@@ -5,12 +5,14 @@ const smithy_client_1 = require("@smithy/smithy-client");
|
|
|
5
5
|
const DisableControlCommand_1 = require("./commands/DisableControlCommand");
|
|
6
6
|
const EnableControlCommand_1 = require("./commands/EnableControlCommand");
|
|
7
7
|
const GetControlOperationCommand_1 = require("./commands/GetControlOperationCommand");
|
|
8
|
+
const GetEnabledControlCommand_1 = require("./commands/GetEnabledControlCommand");
|
|
8
9
|
const ListEnabledControlsCommand_1 = require("./commands/ListEnabledControlsCommand");
|
|
9
10
|
const ControlTowerClient_1 = require("./ControlTowerClient");
|
|
10
11
|
const commands = {
|
|
11
12
|
DisableControlCommand: DisableControlCommand_1.DisableControlCommand,
|
|
12
13
|
EnableControlCommand: EnableControlCommand_1.EnableControlCommand,
|
|
13
14
|
GetControlOperationCommand: GetControlOperationCommand_1.GetControlOperationCommand,
|
|
15
|
+
GetEnabledControlCommand: GetEnabledControlCommand_1.GetEnabledControlCommand,
|
|
14
16
|
ListEnabledControlsCommand: ListEnabledControlsCommand_1.ListEnabledControlsCommand,
|
|
15
17
|
};
|
|
16
18
|
class ControlTower extends ControlTowerClient_1.ControlTowerClient {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetEnabledControlCommand = exports.$Command = void 0;
|
|
4
|
+
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
const types_1 = require("@smithy/types");
|
|
9
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
10
|
+
class GetEnabledControlCommand extends smithy_client_1.Command {
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
constructor(input) {
|
|
20
|
+
super();
|
|
21
|
+
this.input = input;
|
|
22
|
+
}
|
|
23
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
24
|
+
this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
|
|
25
|
+
this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, GetEnabledControlCommand.getEndpointParameterInstructions()));
|
|
26
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
27
|
+
const { logger } = configuration;
|
|
28
|
+
const clientName = "ControlTowerClient";
|
|
29
|
+
const commandName = "GetEnabledControlCommand";
|
|
30
|
+
const handlerExecutionContext = {
|
|
31
|
+
logger,
|
|
32
|
+
clientName,
|
|
33
|
+
commandName,
|
|
34
|
+
inputFilterSensitiveLog: (_) => _,
|
|
35
|
+
outputFilterSensitiveLog: (_) => _,
|
|
36
|
+
[types_1.SMITHY_CONTEXT_KEY]: {
|
|
37
|
+
service: "AWSControlTowerApis",
|
|
38
|
+
operation: "GetEnabledControl",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
const { requestHandler } = configuration;
|
|
42
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
43
|
+
}
|
|
44
|
+
serialize(input, context) {
|
|
45
|
+
return (0, Aws_restJson1_1.se_GetEnabledControlCommand)(input, context);
|
|
46
|
+
}
|
|
47
|
+
deserialize(output, context) {
|
|
48
|
+
return (0, Aws_restJson1_1.de_GetEnabledControlCommand)(output, context);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.GetEnabledControlCommand = GetEnabledControlCommand;
|
|
@@ -4,4 +4,5 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./DisableControlCommand"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./EnableControlCommand"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./GetControlOperationCommand"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./GetEnabledControlCommand"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./ListEnabledControlsCommand"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ControlOperationStatus = exports.ControlOperationType = exports.ValidationException = exports.ThrottlingException = exports.ServiceQuotaExceededException = exports.ResourceNotFoundException = exports.InternalServerException = exports.ConflictException = exports.AccessDeniedException = void 0;
|
|
3
|
+
exports.EnablementStatus = exports.DriftStatus = exports.ControlOperationStatus = exports.ControlOperationType = exports.ValidationException = exports.ThrottlingException = exports.ServiceQuotaExceededException = exports.ResourceNotFoundException = exports.InternalServerException = exports.ConflictException = exports.AccessDeniedException = void 0;
|
|
4
4
|
const ControlTowerServiceException_1 = require("./ControlTowerServiceException");
|
|
5
5
|
class AccessDeniedException extends ControlTowerServiceException_1.ControlTowerServiceException {
|
|
6
6
|
constructor(opts) {
|
|
@@ -109,3 +109,14 @@ exports.ControlOperationStatus = {
|
|
|
109
109
|
IN_PROGRESS: "IN_PROGRESS",
|
|
110
110
|
SUCCEEDED: "SUCCEEDED",
|
|
111
111
|
};
|
|
112
|
+
exports.DriftStatus = {
|
|
113
|
+
DRIFTED: "DRIFTED",
|
|
114
|
+
IN_SYNC: "IN_SYNC",
|
|
115
|
+
NOT_CHECKING: "NOT_CHECKING",
|
|
116
|
+
UNKNOWN: "UNKNOWN",
|
|
117
|
+
};
|
|
118
|
+
exports.EnablementStatus = {
|
|
119
|
+
FAILED: "FAILED",
|
|
120
|
+
SUCCEEDED: "SUCCEEDED",
|
|
121
|
+
UNDER_CHANGE: "UNDER_CHANGE",
|
|
122
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_ListEnabledControlsCommand = exports.de_GetControlOperationCommand = exports.de_EnableControlCommand = exports.de_DisableControlCommand = exports.se_ListEnabledControlsCommand = exports.se_GetControlOperationCommand = exports.se_EnableControlCommand = exports.se_DisableControlCommand = void 0;
|
|
3
|
+
exports.de_ListEnabledControlsCommand = exports.de_GetEnabledControlCommand = exports.de_GetControlOperationCommand = exports.de_EnableControlCommand = exports.de_DisableControlCommand = exports.se_ListEnabledControlsCommand = exports.se_GetEnabledControlCommand = exports.se_GetControlOperationCommand = exports.se_EnableControlCommand = exports.se_DisableControlCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
6
|
const ControlTowerServiceException_1 = require("../models/ControlTowerServiceException");
|
|
@@ -70,6 +70,27 @@ const se_GetControlOperationCommand = async (input, context) => {
|
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
72
|
exports.se_GetControlOperationCommand = se_GetControlOperationCommand;
|
|
73
|
+
const se_GetEnabledControlCommand = async (input, context) => {
|
|
74
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
75
|
+
const headers = {
|
|
76
|
+
"content-type": "application/json",
|
|
77
|
+
};
|
|
78
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/get-enabled-control";
|
|
79
|
+
let body;
|
|
80
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
81
|
+
enabledControlIdentifier: [],
|
|
82
|
+
}));
|
|
83
|
+
return new protocol_http_1.HttpRequest({
|
|
84
|
+
protocol,
|
|
85
|
+
hostname,
|
|
86
|
+
port,
|
|
87
|
+
method: "POST",
|
|
88
|
+
headers,
|
|
89
|
+
path: resolvedPath,
|
|
90
|
+
body,
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
exports.se_GetEnabledControlCommand = se_GetEnabledControlCommand;
|
|
73
94
|
const se_ListEnabledControlsCommand = async (input, context) => {
|
|
74
95
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
75
96
|
const headers = {
|
|
@@ -243,6 +264,52 @@ const de_GetControlOperationCommandError = async (output, context) => {
|
|
|
243
264
|
});
|
|
244
265
|
}
|
|
245
266
|
};
|
|
267
|
+
const de_GetEnabledControlCommand = async (output, context) => {
|
|
268
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
269
|
+
return de_GetEnabledControlCommandError(output, context);
|
|
270
|
+
}
|
|
271
|
+
const contents = (0, smithy_client_1.map)({
|
|
272
|
+
$metadata: deserializeMetadata(output),
|
|
273
|
+
});
|
|
274
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
275
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
276
|
+
enabledControlDetails: smithy_client_1._json,
|
|
277
|
+
});
|
|
278
|
+
Object.assign(contents, doc);
|
|
279
|
+
return contents;
|
|
280
|
+
};
|
|
281
|
+
exports.de_GetEnabledControlCommand = de_GetEnabledControlCommand;
|
|
282
|
+
const de_GetEnabledControlCommandError = async (output, context) => {
|
|
283
|
+
const parsedOutput = {
|
|
284
|
+
...output,
|
|
285
|
+
body: await parseErrorBody(output.body, context),
|
|
286
|
+
};
|
|
287
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
288
|
+
switch (errorCode) {
|
|
289
|
+
case "AccessDeniedException":
|
|
290
|
+
case "com.amazonaws.controltower#AccessDeniedException":
|
|
291
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
292
|
+
case "InternalServerException":
|
|
293
|
+
case "com.amazonaws.controltower#InternalServerException":
|
|
294
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
295
|
+
case "ResourceNotFoundException":
|
|
296
|
+
case "com.amazonaws.controltower#ResourceNotFoundException":
|
|
297
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
298
|
+
case "ThrottlingException":
|
|
299
|
+
case "com.amazonaws.controltower#ThrottlingException":
|
|
300
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
301
|
+
case "ValidationException":
|
|
302
|
+
case "com.amazonaws.controltower#ValidationException":
|
|
303
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
304
|
+
default:
|
|
305
|
+
const parsedBody = parsedOutput.body;
|
|
306
|
+
return throwDefaultError({
|
|
307
|
+
output,
|
|
308
|
+
parsedBody,
|
|
309
|
+
errorCode,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
};
|
|
246
313
|
const de_ListEnabledControlsCommand = async (output, context) => {
|
|
247
314
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
248
315
|
return de_ListEnabledControlsCommandError(output, context);
|
package/dist-es/ControlTower.js
CHANGED
|
@@ -2,12 +2,14 @@ import { createAggregatedClient } from "@smithy/smithy-client";
|
|
|
2
2
|
import { DisableControlCommand, } from "./commands/DisableControlCommand";
|
|
3
3
|
import { EnableControlCommand, } from "./commands/EnableControlCommand";
|
|
4
4
|
import { GetControlOperationCommand, } from "./commands/GetControlOperationCommand";
|
|
5
|
+
import { GetEnabledControlCommand, } from "./commands/GetEnabledControlCommand";
|
|
5
6
|
import { ListEnabledControlsCommand, } from "./commands/ListEnabledControlsCommand";
|
|
6
7
|
import { ControlTowerClient } from "./ControlTowerClient";
|
|
7
8
|
const commands = {
|
|
8
9
|
DisableControlCommand,
|
|
9
10
|
EnableControlCommand,
|
|
10
11
|
GetControlOperationCommand,
|
|
12
|
+
GetEnabledControlCommand,
|
|
11
13
|
ListEnabledControlsCommand,
|
|
12
14
|
};
|
|
13
15
|
export class ControlTower extends ControlTowerClient {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
import { de_GetEnabledControlCommand, se_GetEnabledControlCommand } from "../protocols/Aws_restJson1";
|
|
6
|
+
export { $Command };
|
|
7
|
+
export class GetEnabledControlCommand extends $Command {
|
|
8
|
+
static getEndpointParameterInstructions() {
|
|
9
|
+
return {
|
|
10
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
11
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
12
|
+
Region: { type: "builtInParams", name: "region" },
|
|
13
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
constructor(input) {
|
|
17
|
+
super();
|
|
18
|
+
this.input = input;
|
|
19
|
+
}
|
|
20
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
21
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
22
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, GetEnabledControlCommand.getEndpointParameterInstructions()));
|
|
23
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
24
|
+
const { logger } = configuration;
|
|
25
|
+
const clientName = "ControlTowerClient";
|
|
26
|
+
const commandName = "GetEnabledControlCommand";
|
|
27
|
+
const handlerExecutionContext = {
|
|
28
|
+
logger,
|
|
29
|
+
clientName,
|
|
30
|
+
commandName,
|
|
31
|
+
inputFilterSensitiveLog: (_) => _,
|
|
32
|
+
outputFilterSensitiveLog: (_) => _,
|
|
33
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
34
|
+
service: "AWSControlTowerApis",
|
|
35
|
+
operation: "GetEnabledControl",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const { requestHandler } = configuration;
|
|
39
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
40
|
+
}
|
|
41
|
+
serialize(input, context) {
|
|
42
|
+
return se_GetEnabledControlCommand(input, context);
|
|
43
|
+
}
|
|
44
|
+
deserialize(output, context) {
|
|
45
|
+
return de_GetEnabledControlCommand(output, context);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -99,3 +99,14 @@ export const ControlOperationStatus = {
|
|
|
99
99
|
IN_PROGRESS: "IN_PROGRESS",
|
|
100
100
|
SUCCEEDED: "SUCCEEDED",
|
|
101
101
|
};
|
|
102
|
+
export const DriftStatus = {
|
|
103
|
+
DRIFTED: "DRIFTED",
|
|
104
|
+
IN_SYNC: "IN_SYNC",
|
|
105
|
+
NOT_CHECKING: "NOT_CHECKING",
|
|
106
|
+
UNKNOWN: "UNKNOWN",
|
|
107
|
+
};
|
|
108
|
+
export const EnablementStatus = {
|
|
109
|
+
FAILED: "FAILED",
|
|
110
|
+
SUCCEEDED: "SUCCEEDED",
|
|
111
|
+
UNDER_CHANGE: "UNDER_CHANGE",
|
|
112
|
+
};
|
|
@@ -64,6 +64,26 @@ export const se_GetControlOperationCommand = async (input, context) => {
|
|
|
64
64
|
body,
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
export const se_GetEnabledControlCommand = async (input, context) => {
|
|
68
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
69
|
+
const headers = {
|
|
70
|
+
"content-type": "application/json",
|
|
71
|
+
};
|
|
72
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/get-enabled-control";
|
|
73
|
+
let body;
|
|
74
|
+
body = JSON.stringify(take(input, {
|
|
75
|
+
enabledControlIdentifier: [],
|
|
76
|
+
}));
|
|
77
|
+
return new __HttpRequest({
|
|
78
|
+
protocol,
|
|
79
|
+
hostname,
|
|
80
|
+
port,
|
|
81
|
+
method: "POST",
|
|
82
|
+
headers,
|
|
83
|
+
path: resolvedPath,
|
|
84
|
+
body,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
67
87
|
export const se_ListEnabledControlsCommand = async (input, context) => {
|
|
68
88
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
69
89
|
const headers = {
|
|
@@ -233,6 +253,51 @@ const de_GetControlOperationCommandError = async (output, context) => {
|
|
|
233
253
|
});
|
|
234
254
|
}
|
|
235
255
|
};
|
|
256
|
+
export const de_GetEnabledControlCommand = async (output, context) => {
|
|
257
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
258
|
+
return de_GetEnabledControlCommandError(output, context);
|
|
259
|
+
}
|
|
260
|
+
const contents = map({
|
|
261
|
+
$metadata: deserializeMetadata(output),
|
|
262
|
+
});
|
|
263
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
264
|
+
const doc = take(data, {
|
|
265
|
+
enabledControlDetails: _json,
|
|
266
|
+
});
|
|
267
|
+
Object.assign(contents, doc);
|
|
268
|
+
return contents;
|
|
269
|
+
};
|
|
270
|
+
const de_GetEnabledControlCommandError = async (output, context) => {
|
|
271
|
+
const parsedOutput = {
|
|
272
|
+
...output,
|
|
273
|
+
body: await parseErrorBody(output.body, context),
|
|
274
|
+
};
|
|
275
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
276
|
+
switch (errorCode) {
|
|
277
|
+
case "AccessDeniedException":
|
|
278
|
+
case "com.amazonaws.controltower#AccessDeniedException":
|
|
279
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
280
|
+
case "InternalServerException":
|
|
281
|
+
case "com.amazonaws.controltower#InternalServerException":
|
|
282
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
283
|
+
case "ResourceNotFoundException":
|
|
284
|
+
case "com.amazonaws.controltower#ResourceNotFoundException":
|
|
285
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
286
|
+
case "ThrottlingException":
|
|
287
|
+
case "com.amazonaws.controltower#ThrottlingException":
|
|
288
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
289
|
+
case "ValidationException":
|
|
290
|
+
case "com.amazonaws.controltower#ValidationException":
|
|
291
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
292
|
+
default:
|
|
293
|
+
const parsedBody = parsedOutput.body;
|
|
294
|
+
return throwDefaultError({
|
|
295
|
+
output,
|
|
296
|
+
parsedBody,
|
|
297
|
+
errorCode,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
};
|
|
236
301
|
export const de_ListEnabledControlsCommand = async (output, context) => {
|
|
237
302
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
238
303
|
return de_ListEnabledControlsCommandError(output, context);
|
|
@@ -2,6 +2,7 @@ import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
|
2
2
|
import { DisableControlCommandInput, DisableControlCommandOutput } from "./commands/DisableControlCommand";
|
|
3
3
|
import { EnableControlCommandInput, EnableControlCommandOutput } from "./commands/EnableControlCommand";
|
|
4
4
|
import { GetControlOperationCommandInput, GetControlOperationCommandOutput } from "./commands/GetControlOperationCommand";
|
|
5
|
+
import { GetEnabledControlCommandInput, GetEnabledControlCommandOutput } from "./commands/GetEnabledControlCommand";
|
|
5
6
|
import { ListEnabledControlsCommandInput, ListEnabledControlsCommandOutput } from "./commands/ListEnabledControlsCommand";
|
|
6
7
|
import { ControlTowerClient } from "./ControlTowerClient";
|
|
7
8
|
export interface ControlTower {
|
|
@@ -23,6 +24,12 @@ export interface ControlTower {
|
|
|
23
24
|
getControlOperation(args: GetControlOperationCommandInput, options?: __HttpHandlerOptions): Promise<GetControlOperationCommandOutput>;
|
|
24
25
|
getControlOperation(args: GetControlOperationCommandInput, cb: (err: any, data?: GetControlOperationCommandOutput) => void): void;
|
|
25
26
|
getControlOperation(args: GetControlOperationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetControlOperationCommandOutput) => void): void;
|
|
27
|
+
/**
|
|
28
|
+
* @see {@link GetEnabledControlCommand}
|
|
29
|
+
*/
|
|
30
|
+
getEnabledControl(args: GetEnabledControlCommandInput, options?: __HttpHandlerOptions): Promise<GetEnabledControlCommandOutput>;
|
|
31
|
+
getEnabledControl(args: GetEnabledControlCommandInput, cb: (err: any, data?: GetEnabledControlCommandOutput) => void): void;
|
|
32
|
+
getEnabledControl(args: GetEnabledControlCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetEnabledControlCommandOutput) => void): void;
|
|
26
33
|
/**
|
|
27
34
|
* @see {@link ListEnabledControlsCommand}
|
|
28
35
|
*/
|
|
@@ -32,22 +39,31 @@ export interface ControlTower {
|
|
|
32
39
|
}
|
|
33
40
|
/**
|
|
34
41
|
* @public
|
|
35
|
-
* <p>These interfaces allow you to apply the AWS library of pre-defined
|
|
36
|
-
* organizational units, programmatically. In
|
|
42
|
+
* <p>These interfaces allow you to apply the AWS library of pre-defined
|
|
43
|
+
* <i>controls</i> to your organizational units, programmatically. In AWS Control Tower, the terms "control" and "guardrail" are synonyms. .</p>
|
|
37
44
|
* <p>To call these APIs, you'll need to know:</p>
|
|
38
45
|
* <ul>
|
|
39
46
|
* <li>
|
|
40
|
-
* <p>the <code>
|
|
41
|
-
* guardrail--you are targeting,</p>
|
|
47
|
+
* <p>the <code>controlIdentifier</code> for the control--or guardrail--you are targeting.</p>
|
|
42
48
|
* </li>
|
|
43
49
|
* <li>
|
|
44
|
-
* <p>
|
|
50
|
+
* <p>the ARN associated with the target organizational unit (OU), which we call the <code>targetIdentifier</code>.</p>
|
|
45
51
|
* </li>
|
|
46
52
|
* </ul>
|
|
47
53
|
* <p>
|
|
48
|
-
* <b>To get the <code>
|
|
54
|
+
* <b>To get the <code>controlIdentifier</code> for your AWS Control Tower
|
|
55
|
+
* control:</b>
|
|
49
56
|
* </p>
|
|
50
|
-
* <p>The <code>
|
|
57
|
+
* <p>The <code>controlIdentifier</code> is an ARN that is specified for each
|
|
58
|
+
* control. You can view the <code>controlIdentifier</code> in the console on the <b>Control details</b> page, as well as in the documentation.</p>
|
|
59
|
+
* <p>The <code>controlIdentifier</code> is unique in each AWS Region for each control. You can
|
|
60
|
+
* find the <code>controlIdentifier</code> for each Region and control in the <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html">Tables of control metadata</a> in the <i>AWS Control Tower User Guide.</i>
|
|
61
|
+
* </p>
|
|
62
|
+
* <p>A quick-reference list of control identifers for the AWS Control Tower legacy <i>Strongly recommended</i> and
|
|
63
|
+
* <i>Elective</i> controls is given in <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html">Resource identifiers for
|
|
64
|
+
* APIs and guardrails</a> in the <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html">Controls reference guide section</a>
|
|
65
|
+
* of the <i>AWS Control Tower User Guide</i>. Remember that <i>Mandatory</i> controls
|
|
66
|
+
* cannot be added or removed.</p>
|
|
51
67
|
* <note>
|
|
52
68
|
* <p>
|
|
53
69
|
* <b>ARN format:</b>
|
|
@@ -61,8 +77,9 @@ export interface ControlTower {
|
|
|
61
77
|
* </p>
|
|
62
78
|
* </note>
|
|
63
79
|
* <p>
|
|
64
|
-
* <b>To get the
|
|
80
|
+
* <b>To get the <code>targetIdentifier</code>:</b>
|
|
65
81
|
* </p>
|
|
82
|
+
* <p>The <code>targetIdentifier</code> is the ARN for an OU.</p>
|
|
66
83
|
* <p>In the AWS Organizations console, you can find the ARN for the OU on the <b>Organizational unit details</b> page associated with that OU.</p>
|
|
67
84
|
* <note>
|
|
68
85
|
* <p>
|
|
@@ -78,17 +95,32 @@ export interface ControlTower {
|
|
|
78
95
|
* <ul>
|
|
79
96
|
* <li>
|
|
80
97
|
* <p>
|
|
81
|
-
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-
|
|
98
|
+
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html">Control API input and output examples with CLI</a>
|
|
99
|
+
* </p>
|
|
100
|
+
* </li>
|
|
101
|
+
* <li>
|
|
102
|
+
* <p>
|
|
103
|
+
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/enable-controls.html">Enable controls with CloudFormation</a>
|
|
104
|
+
* </p>
|
|
105
|
+
* </li>
|
|
106
|
+
* <li>
|
|
107
|
+
* <p>
|
|
108
|
+
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html">Control metadata tables</a>
|
|
109
|
+
* </p>
|
|
110
|
+
* </li>
|
|
111
|
+
* <li>
|
|
112
|
+
* <p>
|
|
113
|
+
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html">List of identifiers for legacy controls</a>
|
|
82
114
|
* </p>
|
|
83
115
|
* </li>
|
|
84
116
|
* <li>
|
|
85
117
|
* <p>
|
|
86
|
-
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/
|
|
118
|
+
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/controls.html">Controls reference guide</a>
|
|
87
119
|
* </p>
|
|
88
120
|
* </li>
|
|
89
121
|
* <li>
|
|
90
122
|
* <p>
|
|
91
|
-
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/
|
|
123
|
+
* <a href="https://docs.aws.amazon.com/controltower/latest/userguide/controls-reference.html">Controls library groupings</a>
|
|
92
124
|
* </p>
|
|
93
125
|
* </li>
|
|
94
126
|
* <li>
|
|
@@ -102,7 +134,14 @@ export interface ControlTower {
|
|
|
102
134
|
* <p>
|
|
103
135
|
* <b>Recording API Requests</b>
|
|
104
136
|
* </p>
|
|
105
|
-
* <p>AWS Control Tower supports AWS CloudTrail, a service that records AWS API calls for your
|
|
137
|
+
* <p>AWS Control Tower supports AWS CloudTrail, a service that records AWS API calls for your
|
|
138
|
+
* AWS account and delivers log files to an Amazon S3 bucket. By using information collected by
|
|
139
|
+
* CloudTrail, you can determine which requests the AWS Control Tower service received, who made
|
|
140
|
+
* the request and when, and so on. For more about AWS Control Tower and its support for
|
|
141
|
+
* CloudTrail, see <a href="https://docs.aws.amazon.com/controltower/latest/userguide/logging-using-cloudtrail.html">Logging AWS Control Tower
|
|
142
|
+
* Actions with AWS CloudTrail</a> in the AWS Control Tower User Guide. To learn more about
|
|
143
|
+
* CloudTrail, including how to turn it on and find your log files, see the AWS CloudTrail User
|
|
144
|
+
* Guide.</p>
|
|
106
145
|
*/
|
|
107
146
|
export declare class ControlTower extends ControlTowerClient implements ControlTower {
|
|
108
147
|
}
|