Skip to content

Commit c897818

Browse files
author
awstools
committed
feat(client-controlcatalog): AWS Control Tower provides two new public APIs controlcatalog:ListControls and controlcatalog:GetControl under controlcatalog service namespace, which enable customers to programmatically retrieve control metadata of available controls.
1 parent 2f7a965 commit c897818

File tree

11 files changed

+947
-1
lines changed

11 files changed

+947
-1
lines changed

clients/client-controlcatalog/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,29 @@ see LICENSE for more information.
230230

231231
## Client Commands (Operations List)
232232

233+
<details>
234+
<summary>
235+
GetControl
236+
</summary>
237+
238+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/controlcatalog/command/GetControlCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/GetControlCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/GetControlCommandOutput/)
239+
240+
</details>
233241
<details>
234242
<summary>
235243
ListCommonControls
236244
</summary>
237245

238246
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/controlcatalog/command/ListCommonControlsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListCommonControlsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListCommonControlsCommandOutput/)
239247

248+
</details>
249+
<details>
250+
<summary>
251+
ListControls
252+
</summary>
253+
254+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/controlcatalog/command/ListControlsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListControlsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-controlcatalog/Interface/ListControlsCommandOutput/)
255+
240256
</details>
241257
<details>
242258
<summary>

clients/client-controlcatalog/src/ControlCatalog.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22
import { createAggregatedClient } from "@smithy/smithy-client";
33
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
44

5+
import { GetControlCommand, GetControlCommandInput, GetControlCommandOutput } from "./commands/GetControlCommand";
56
import {
67
ListCommonControlsCommand,
78
ListCommonControlsCommandInput,
89
ListCommonControlsCommandOutput,
910
} from "./commands/ListCommonControlsCommand";
11+
import {
12+
ListControlsCommand,
13+
ListControlsCommandInput,
14+
ListControlsCommandOutput,
15+
} from "./commands/ListControlsCommand";
1016
import { ListDomainsCommand, ListDomainsCommandInput, ListDomainsCommandOutput } from "./commands/ListDomainsCommand";
1117
import {
1218
ListObjectivesCommand,
@@ -16,12 +22,25 @@ import {
1622
import { ControlCatalogClient, ControlCatalogClientConfig } from "./ControlCatalogClient";
1723

1824
const commands = {
25+
GetControlCommand,
1926
ListCommonControlsCommand,
27+
ListControlsCommand,
2028
ListDomainsCommand,
2129
ListObjectivesCommand,
2230
};
2331

2432
export interface ControlCatalog {
33+
/**
34+
* @see {@link GetControlCommand}
35+
*/
36+
getControl(args: GetControlCommandInput, options?: __HttpHandlerOptions): Promise<GetControlCommandOutput>;
37+
getControl(args: GetControlCommandInput, cb: (err: any, data?: GetControlCommandOutput) => void): void;
38+
getControl(
39+
args: GetControlCommandInput,
40+
options: __HttpHandlerOptions,
41+
cb: (err: any, data?: GetControlCommandOutput) => void
42+
): void;
43+
2544
/**
2645
* @see {@link ListCommonControlsCommand}
2746
*/
@@ -40,6 +59,18 @@ export interface ControlCatalog {
4059
cb: (err: any, data?: ListCommonControlsCommandOutput) => void
4160
): void;
4261

62+
/**
63+
* @see {@link ListControlsCommand}
64+
*/
65+
listControls(): Promise<ListControlsCommandOutput>;
66+
listControls(args: ListControlsCommandInput, options?: __HttpHandlerOptions): Promise<ListControlsCommandOutput>;
67+
listControls(args: ListControlsCommandInput, cb: (err: any, data?: ListControlsCommandOutput) => void): void;
68+
listControls(
69+
args: ListControlsCommandInput,
70+
options: __HttpHandlerOptions,
71+
cb: (err: any, data?: ListControlsCommandOutput) => void
72+
): void;
73+
4374
/**
4475
* @see {@link ListDomainsCommand}
4576
*/

clients/client-controlcatalog/src/ControlCatalogClient.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ import {
5353
HttpAuthSchemeResolvedConfig,
5454
resolveHttpAuthSchemeConfig,
5555
} from "./auth/httpAuthSchemeProvider";
56+
import { GetControlCommandInput, GetControlCommandOutput } from "./commands/GetControlCommand";
5657
import { ListCommonControlsCommandInput, ListCommonControlsCommandOutput } from "./commands/ListCommonControlsCommand";
58+
import { ListControlsCommandInput, ListControlsCommandOutput } from "./commands/ListControlsCommand";
5759
import { ListDomainsCommandInput, ListDomainsCommandOutput } from "./commands/ListDomainsCommand";
5860
import { ListObjectivesCommandInput, ListObjectivesCommandOutput } from "./commands/ListObjectivesCommand";
5961
import {
@@ -70,13 +72,20 @@ export { __Client };
7072
/**
7173
* @public
7274
*/
73-
export type ServiceInputTypes = ListCommonControlsCommandInput | ListDomainsCommandInput | ListObjectivesCommandInput;
75+
export type ServiceInputTypes =
76+
| GetControlCommandInput
77+
| ListCommonControlsCommandInput
78+
| ListControlsCommandInput
79+
| ListDomainsCommandInput
80+
| ListObjectivesCommandInput;
7481

7582
/**
7683
* @public
7784
*/
7885
export type ServiceOutputTypes =
86+
| GetControlCommandOutput
7987
| ListCommonControlsCommandOutput
88+
| ListControlsCommandOutput
8089
| ListDomainsCommandOutput
8190
| ListObjectivesCommandOutput;
8291

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { ControlCatalogClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ControlCatalogClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { GetControlRequest, GetControlResponse } from "../models/models_0";
10+
import { de_GetControlCommand, se_GetControlCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link GetControlCommand}.
21+
*/
22+
export interface GetControlCommandInput extends GetControlRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link GetControlCommand}.
27+
*/
28+
export interface GetControlCommandOutput extends GetControlResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns details about a specific control, most notably a list of Amazon Web Services Regions where this control is supported. Input a value for the <i>ControlArn</i> parameter, in ARN form. <code>GetControl</code> accepts <i>controltower</i> or <i>controlcatalog</i> control ARNs as input. Returns a <i>controlcatalog</i> ARN format.</p>
32+
* <p>In the API response, controls that have the value <code>GLOBAL</code> in the <code>Scope</code> field do not show the <code>DeployableRegions</code> field, because it does not apply. Controls that have the value <code>REGIONAL</code> in the <code>Scope</code> field return a value for the <code>DeployableRegions</code> field, as shown in the example.</p>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { ControlCatalogClient, GetControlCommand } from "@aws-sdk/client-controlcatalog"; // ES Modules import
37+
* // const { ControlCatalogClient, GetControlCommand } = require("@aws-sdk/client-controlcatalog"); // CommonJS import
38+
* const client = new ControlCatalogClient(config);
39+
* const input = { // GetControlRequest
40+
* ControlArn: "STRING_VALUE", // required
41+
* };
42+
* const command = new GetControlCommand(input);
43+
* const response = await client.send(command);
44+
* // { // GetControlResponse
45+
* // Arn: "STRING_VALUE", // required
46+
* // Name: "STRING_VALUE", // required
47+
* // Description: "STRING_VALUE", // required
48+
* // Behavior: "PREVENTIVE" || "PROACTIVE" || "DETECTIVE", // required
49+
* // RegionConfiguration: { // RegionConfiguration
50+
* // Scope: "GLOBAL" || "REGIONAL", // required
51+
* // DeployableRegions: [ // DeployableRegions
52+
* // "STRING_VALUE",
53+
* // ],
54+
* // },
55+
* // };
56+
*
57+
* ```
58+
*
59+
* @param GetControlCommandInput - {@link GetControlCommandInput}
60+
* @returns {@link GetControlCommandOutput}
61+
* @see {@link GetControlCommandInput} for command's `input` shape.
62+
* @see {@link GetControlCommandOutput} for command's `response` shape.
63+
* @see {@link ControlCatalogClientResolvedConfig | config} for ControlCatalogClient's `config` shape.
64+
*
65+
* @throws {@link AccessDeniedException} (client fault)
66+
* <p>You do not have sufficient access to perform this action.</p>
67+
*
68+
* @throws {@link InternalServerException} (server fault)
69+
* <p>An internal service error occurred during the processing of your request. Try again later.</p>
70+
*
71+
* @throws {@link ResourceNotFoundException} (client fault)
72+
* <p>The requested resource does not exist.</p>
73+
*
74+
* @throws {@link ThrottlingException} (client fault)
75+
* <p>The request was denied due to request throttling.</p>
76+
*
77+
* @throws {@link ValidationException} (client fault)
78+
* <p>The request has invalid or missing parameters.</p>
79+
*
80+
* @throws {@link ControlCatalogServiceException}
81+
* <p>Base exception class for all service exceptions from ControlCatalog service.</p>
82+
*
83+
* @public
84+
*/
85+
export class GetControlCommand extends $Command
86+
.classBuilder<
87+
GetControlCommandInput,
88+
GetControlCommandOutput,
89+
ControlCatalogClientResolvedConfig,
90+
ServiceInputTypes,
91+
ServiceOutputTypes
92+
>()
93+
.ep({
94+
...commonParams,
95+
})
96+
.m(function (this: any, Command: any, cs: any, config: ControlCatalogClientResolvedConfig, o: any) {
97+
return [
98+
getSerdePlugin(config, this.serialize, this.deserialize),
99+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
100+
];
101+
})
102+
.s("ControlCatalog", "GetControl", {})
103+
.n("ControlCatalogClient", "GetControlCommand")
104+
.f(void 0, void 0)
105+
.ser(se_GetControlCommand)
106+
.de(de_GetControlCommand)
107+
.build() {}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { ControlCatalogClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ControlCatalogClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { ListControlsRequest, ListControlsResponse } from "../models/models_0";
10+
import { de_ListControlsCommand, se_ListControlsCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link ListControlsCommand}.
21+
*/
22+
export interface ListControlsCommandInput extends ListControlsRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link ListControlsCommand}.
27+
*/
28+
export interface ListControlsCommandOutput extends ListControlsResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns a paginated list of all available controls in the Amazon Web Services Control Catalog library. Allows you to discover available controls. The list of controls is given as structures of type <i>controlSummary</i>. The ARN is returned in the global <i>controlcatalog</i> format, as shown in the examples.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { ControlCatalogClient, ListControlsCommand } from "@aws-sdk/client-controlcatalog"; // ES Modules import
36+
* // const { ControlCatalogClient, ListControlsCommand } = require("@aws-sdk/client-controlcatalog"); // CommonJS import
37+
* const client = new ControlCatalogClient(config);
38+
* const input = { // ListControlsRequest
39+
* NextToken: "STRING_VALUE",
40+
* MaxResults: Number("int"),
41+
* };
42+
* const command = new ListControlsCommand(input);
43+
* const response = await client.send(command);
44+
* // { // ListControlsResponse
45+
* // Controls: [ // Controls // required
46+
* // { // ControlSummary
47+
* // Arn: "STRING_VALUE", // required
48+
* // Name: "STRING_VALUE", // required
49+
* // Description: "STRING_VALUE", // required
50+
* // },
51+
* // ],
52+
* // NextToken: "STRING_VALUE",
53+
* // };
54+
*
55+
* ```
56+
*
57+
* @param ListControlsCommandInput - {@link ListControlsCommandInput}
58+
* @returns {@link ListControlsCommandOutput}
59+
* @see {@link ListControlsCommandInput} for command's `input` shape.
60+
* @see {@link ListControlsCommandOutput} for command's `response` shape.
61+
* @see {@link ControlCatalogClientResolvedConfig | config} for ControlCatalogClient's `config` shape.
62+
*
63+
* @throws {@link AccessDeniedException} (client fault)
64+
* <p>You do not have sufficient access to perform this action.</p>
65+
*
66+
* @throws {@link InternalServerException} (server fault)
67+
* <p>An internal service error occurred during the processing of your request. Try again later.</p>
68+
*
69+
* @throws {@link ThrottlingException} (client fault)
70+
* <p>The request was denied due to request throttling.</p>
71+
*
72+
* @throws {@link ValidationException} (client fault)
73+
* <p>The request has invalid or missing parameters.</p>
74+
*
75+
* @throws {@link ControlCatalogServiceException}
76+
* <p>Base exception class for all service exceptions from ControlCatalog service.</p>
77+
*
78+
* @public
79+
*/
80+
export class ListControlsCommand extends $Command
81+
.classBuilder<
82+
ListControlsCommandInput,
83+
ListControlsCommandOutput,
84+
ControlCatalogClientResolvedConfig,
85+
ServiceInputTypes,
86+
ServiceOutputTypes
87+
>()
88+
.ep({
89+
...commonParams,
90+
})
91+
.m(function (this: any, Command: any, cs: any, config: ControlCatalogClientResolvedConfig, o: any) {
92+
return [
93+
getSerdePlugin(config, this.serialize, this.deserialize),
94+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
95+
];
96+
})
97+
.s("ControlCatalog", "ListControls", {})
98+
.n("ControlCatalogClient", "ListControlsCommand")
99+
.f(void 0, void 0)
100+
.ser(se_ListControlsCommand)
101+
.de(de_ListControlsCommand)
102+
.build() {}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// smithy-typescript generated code
2+
export * from "./GetControlCommand";
23
export * from "./ListCommonControlsCommand";
4+
export * from "./ListControlsCommand";
35
export * from "./ListDomainsCommand";
46
export * from "./ListObjectivesCommand";

0 commit comments

Comments
 (0)