Skip to content

Commit 31a35eb

Browse files
author
awstools
committed
feat(client-dsql): Add support for resource-based policies for Aurora DSQL clusters. This will enable you to implement Block Public Access (BPA) which will help restrict access to your Aurora DSQL public or VPC endpoints.
1 parent d2d7b42 commit 31a35eb

File tree

11 files changed

+719
-5
lines changed

11 files changed

+719
-5
lines changed

clients/client-dsql/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,14 @@ DeleteCluster
223223

224224
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dsql/command/DeleteClusterCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/DeleteClusterCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/DeleteClusterCommandOutput/)
225225

226+
</details>
227+
<details>
228+
<summary>
229+
DeleteClusterPolicy
230+
</summary>
231+
232+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dsql/command/DeleteClusterPolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/DeleteClusterPolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/DeleteClusterPolicyCommandOutput/)
233+
226234
</details>
227235
<details>
228236
<summary>
@@ -231,6 +239,14 @@ GetCluster
231239

232240
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dsql/command/GetClusterCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/GetClusterCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/GetClusterCommandOutput/)
233241

242+
</details>
243+
<details>
244+
<summary>
245+
GetClusterPolicy
246+
</summary>
247+
248+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dsql/command/GetClusterPolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/GetClusterPolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/GetClusterPolicyCommandOutput/)
249+
234250
</details>
235251
<details>
236252
<summary>
@@ -255,6 +271,14 @@ ListTagsForResource
255271

256272
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dsql/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/ListTagsForResourceCommandOutput/)
257273

274+
</details>
275+
<details>
276+
<summary>
277+
PutClusterPolicy
278+
</summary>
279+
280+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dsql/command/PutClusterPolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/PutClusterPolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-dsql/Interface/PutClusterPolicyCommandOutput/)
281+
258282
</details>
259283
<details>
260284
<summary>

clients/client-dsql/src/DSQL.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ import {
1212
DeleteClusterCommandInput,
1313
DeleteClusterCommandOutput,
1414
} from "./commands/DeleteClusterCommand";
15+
import {
16+
DeleteClusterPolicyCommand,
17+
DeleteClusterPolicyCommandInput,
18+
DeleteClusterPolicyCommandOutput,
19+
} from "./commands/DeleteClusterPolicyCommand";
1520
import { GetClusterCommand, GetClusterCommandInput, GetClusterCommandOutput } from "./commands/GetClusterCommand";
21+
import {
22+
GetClusterPolicyCommand,
23+
GetClusterPolicyCommandInput,
24+
GetClusterPolicyCommandOutput,
25+
} from "./commands/GetClusterPolicyCommand";
1626
import {
1727
GetVpcEndpointServiceNameCommand,
1828
GetVpcEndpointServiceNameCommandInput,
@@ -28,6 +38,11 @@ import {
2838
ListTagsForResourceCommandInput,
2939
ListTagsForResourceCommandOutput,
3040
} from "./commands/ListTagsForResourceCommand";
41+
import {
42+
PutClusterPolicyCommand,
43+
PutClusterPolicyCommandInput,
44+
PutClusterPolicyCommandOutput,
45+
} from "./commands/PutClusterPolicyCommand";
3146
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
3247
import {
3348
UntagResourceCommand,
@@ -44,10 +59,13 @@ import { DSQLClient, DSQLClientConfig } from "./DSQLClient";
4459
const commands = {
4560
CreateClusterCommand,
4661
DeleteClusterCommand,
62+
DeleteClusterPolicyCommand,
4763
GetClusterCommand,
64+
GetClusterPolicyCommand,
4865
GetVpcEndpointServiceNameCommand,
4966
ListClustersCommand,
5067
ListTagsForResourceCommand,
68+
PutClusterPolicyCommand,
5169
TagResourceCommand,
5270
UntagResourceCommand,
5371
UpdateClusterCommand,
@@ -77,6 +95,23 @@ export interface DSQL {
7795
cb: (err: any, data?: DeleteClusterCommandOutput) => void
7896
): void;
7997

98+
/**
99+
* @see {@link DeleteClusterPolicyCommand}
100+
*/
101+
deleteClusterPolicy(
102+
args: DeleteClusterPolicyCommandInput,
103+
options?: __HttpHandlerOptions
104+
): Promise<DeleteClusterPolicyCommandOutput>;
105+
deleteClusterPolicy(
106+
args: DeleteClusterPolicyCommandInput,
107+
cb: (err: any, data?: DeleteClusterPolicyCommandOutput) => void
108+
): void;
109+
deleteClusterPolicy(
110+
args: DeleteClusterPolicyCommandInput,
111+
options: __HttpHandlerOptions,
112+
cb: (err: any, data?: DeleteClusterPolicyCommandOutput) => void
113+
): void;
114+
80115
/**
81116
* @see {@link GetClusterCommand}
82117
*/
@@ -88,6 +123,23 @@ export interface DSQL {
88123
cb: (err: any, data?: GetClusterCommandOutput) => void
89124
): void;
90125

126+
/**
127+
* @see {@link GetClusterPolicyCommand}
128+
*/
129+
getClusterPolicy(
130+
args: GetClusterPolicyCommandInput,
131+
options?: __HttpHandlerOptions
132+
): Promise<GetClusterPolicyCommandOutput>;
133+
getClusterPolicy(
134+
args: GetClusterPolicyCommandInput,
135+
cb: (err: any, data?: GetClusterPolicyCommandOutput) => void
136+
): void;
137+
getClusterPolicy(
138+
args: GetClusterPolicyCommandInput,
139+
options: __HttpHandlerOptions,
140+
cb: (err: any, data?: GetClusterPolicyCommandOutput) => void
141+
): void;
142+
91143
/**
92144
* @see {@link GetVpcEndpointServiceNameCommand}
93145
*/
@@ -134,6 +186,23 @@ export interface DSQL {
134186
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
135187
): void;
136188

189+
/**
190+
* @see {@link PutClusterPolicyCommand}
191+
*/
192+
putClusterPolicy(
193+
args: PutClusterPolicyCommandInput,
194+
options?: __HttpHandlerOptions
195+
): Promise<PutClusterPolicyCommandOutput>;
196+
putClusterPolicy(
197+
args: PutClusterPolicyCommandInput,
198+
cb: (err: any, data?: PutClusterPolicyCommandOutput) => void
199+
): void;
200+
putClusterPolicy(
201+
args: PutClusterPolicyCommandInput,
202+
options: __HttpHandlerOptions,
203+
cb: (err: any, data?: PutClusterPolicyCommandOutput) => void
204+
): void;
205+
137206
/**
138207
* @see {@link TagResourceCommand}
139208
*/

clients/client-dsql/src/DSQLClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ import {
5555
} from "./auth/httpAuthSchemeProvider";
5656
import { CreateClusterCommandInput, CreateClusterCommandOutput } from "./commands/CreateClusterCommand";
5757
import { DeleteClusterCommandInput, DeleteClusterCommandOutput } from "./commands/DeleteClusterCommand";
58+
import {
59+
DeleteClusterPolicyCommandInput,
60+
DeleteClusterPolicyCommandOutput,
61+
} from "./commands/DeleteClusterPolicyCommand";
5862
import { GetClusterCommandInput, GetClusterCommandOutput } from "./commands/GetClusterCommand";
63+
import { GetClusterPolicyCommandInput, GetClusterPolicyCommandOutput } from "./commands/GetClusterPolicyCommand";
5964
import {
6065
GetVpcEndpointServiceNameCommandInput,
6166
GetVpcEndpointServiceNameCommandOutput,
@@ -65,6 +70,7 @@ import {
6570
ListTagsForResourceCommandInput,
6671
ListTagsForResourceCommandOutput,
6772
} from "./commands/ListTagsForResourceCommand";
73+
import { PutClusterPolicyCommandInput, PutClusterPolicyCommandOutput } from "./commands/PutClusterPolicyCommand";
6874
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
6975
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
7076
import { UpdateClusterCommandInput, UpdateClusterCommandOutput } from "./commands/UpdateClusterCommand";
@@ -85,10 +91,13 @@ export { __Client };
8591
export type ServiceInputTypes =
8692
| CreateClusterCommandInput
8793
| DeleteClusterCommandInput
94+
| DeleteClusterPolicyCommandInput
8895
| GetClusterCommandInput
96+
| GetClusterPolicyCommandInput
8997
| GetVpcEndpointServiceNameCommandInput
9098
| ListClustersCommandInput
9199
| ListTagsForResourceCommandInput
100+
| PutClusterPolicyCommandInput
92101
| TagResourceCommandInput
93102
| UntagResourceCommandInput
94103
| UpdateClusterCommandInput;
@@ -99,10 +108,13 @@ export type ServiceInputTypes =
99108
export type ServiceOutputTypes =
100109
| CreateClusterCommandOutput
101110
| DeleteClusterCommandOutput
111+
| DeleteClusterPolicyCommandOutput
102112
| GetClusterCommandOutput
113+
| GetClusterPolicyCommandOutput
103114
| GetVpcEndpointServiceNameCommandOutput
104115
| ListClustersCommandOutput
105116
| ListTagsForResourceCommandOutput
117+
| PutClusterPolicyCommandOutput
106118
| TagResourceCommandOutput
107119
| UntagResourceCommandOutput
108120
| UpdateClusterCommandOutput;

clients/client-dsql/src/commands/CreateClusterCommand.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface CreateClusterCommandInput extends CreateClusterInput {}
2828
export interface CreateClusterCommandOutput extends CreateClusterOutput, __MetadataBearer {}
2929

3030
/**
31-
* <p>The CreateCluster API allows you to create both single-region clusters and multi-Region
31+
* <p>The CreateCluster API allows you to create both single-Region clusters and multi-Region
3232
* clusters. With the addition of the <i>multiRegionProperties</i> parameter,
3333
* you can create a cluster with witness Region support and establish peer relationships with
3434
* clusters in other Regions during creation.</p>
@@ -55,7 +55,7 @@ export interface CreateClusterCommandOutput extends CreateClusterOutput, __Metad
5555
* </dd>
5656
* <dt>dsql:PutMultiRegionProperties</dt>
5757
* <dd>
58-
* <p>Permission to configure multi-region properties for a cluster.</p>
58+
* <p>Permission to configure multi-Region properties for a cluster.</p>
5959
* <p>Resources: <code>arn:aws:dsql:region:account-id:cluster/*</code>
6060
* </p>
6161
* </dd>
@@ -114,6 +114,8 @@ export interface CreateClusterCommandOutput extends CreateClusterOutput, __Metad
114114
* "STRING_VALUE",
115115
* ],
116116
* },
117+
* policy: "STRING_VALUE",
118+
* bypassPolicyLockoutSafetyCheck: true || false,
117119
* };
118120
* const command = new CreateClusterCommand(input);
119121
* const response = await client.send(command);
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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 { DSQLClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DSQLClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { DeleteClusterPolicyInput, DeleteClusterPolicyOutput } from "../models/models_0";
10+
import { de_DeleteClusterPolicyCommand, se_DeleteClusterPolicyCommand } 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 DeleteClusterPolicyCommand}.
21+
*/
22+
export interface DeleteClusterPolicyCommandInput extends DeleteClusterPolicyInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link DeleteClusterPolicyCommand}.
27+
*/
28+
export interface DeleteClusterPolicyCommandOutput extends DeleteClusterPolicyOutput, __MetadataBearer {}
29+
30+
/**
31+
* <p>Deletes the resource-based policy attached to a cluster. This removes all access permissions defined by the policy, reverting to default access controls.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { DSQLClient, DeleteClusterPolicyCommand } from "@aws-sdk/client-dsql"; // ES Modules import
36+
* // const { DSQLClient, DeleteClusterPolicyCommand } = require("@aws-sdk/client-dsql"); // CommonJS import
37+
* // import type { DSQLClientConfig } from "@aws-sdk/client-dsql";
38+
* const config = {}; // type is DSQLClientConfig
39+
* const client = new DSQLClient(config);
40+
* const input = { // DeleteClusterPolicyInput
41+
* identifier: "STRING_VALUE", // required
42+
* expectedPolicyVersion: "STRING_VALUE",
43+
* clientToken: "STRING_VALUE",
44+
* };
45+
* const command = new DeleteClusterPolicyCommand(input);
46+
* const response = await client.send(command);
47+
* // { // DeleteClusterPolicyOutput
48+
* // policyVersion: "STRING_VALUE", // required
49+
* // };
50+
*
51+
* ```
52+
*
53+
* @param DeleteClusterPolicyCommandInput - {@link DeleteClusterPolicyCommandInput}
54+
* @returns {@link DeleteClusterPolicyCommandOutput}
55+
* @see {@link DeleteClusterPolicyCommandInput} for command's `input` shape.
56+
* @see {@link DeleteClusterPolicyCommandOutput} for command's `response` shape.
57+
* @see {@link DSQLClientResolvedConfig | config} for DSQLClient's `config` shape.
58+
*
59+
* @throws {@link ConflictException} (client fault)
60+
* <p>The submitted action has conflicts.</p>
61+
*
62+
* @throws {@link ResourceNotFoundException} (client fault)
63+
* <p>The resource could not be found.</p>
64+
*
65+
* @throws {@link ValidationException} (client fault)
66+
* <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
67+
*
68+
* @throws {@link AccessDeniedException} (client fault)
69+
* <p>You do not have sufficient access to perform this action.</p>
70+
*
71+
* @throws {@link InternalServerException} (server fault)
72+
* <p>The request processing has failed because of an unknown error, exception or
73+
* failure.</p>
74+
*
75+
* @throws {@link ThrottlingException} (client fault)
76+
* <p>The request was denied due to request throttling.</p>
77+
*
78+
* @throws {@link DSQLServiceException}
79+
* <p>Base exception class for all service exceptions from DSQL service.</p>
80+
*
81+
*
82+
* @public
83+
*/
84+
export class DeleteClusterPolicyCommand extends $Command
85+
.classBuilder<
86+
DeleteClusterPolicyCommandInput,
87+
DeleteClusterPolicyCommandOutput,
88+
DSQLClientResolvedConfig,
89+
ServiceInputTypes,
90+
ServiceOutputTypes
91+
>()
92+
.ep(commonParams)
93+
.m(function (this: any, Command: any, cs: any, config: DSQLClientResolvedConfig, o: any) {
94+
return [
95+
getSerdePlugin(config, this.serialize, this.deserialize),
96+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
97+
];
98+
})
99+
.s("DSQL", "DeleteClusterPolicy", {})
100+
.n("DSQLClient", "DeleteClusterPolicyCommand")
101+
.f(void 0, void 0)
102+
.ser(se_DeleteClusterPolicyCommand)
103+
.de(de_DeleteClusterPolicyCommand)
104+
.build() {
105+
/** @internal type navigation helper, not in runtime. */
106+
protected declare static __types: {
107+
api: {
108+
input: DeleteClusterPolicyInput;
109+
output: DeleteClusterPolicyOutput;
110+
};
111+
sdk: {
112+
input: DeleteClusterPolicyCommandInput;
113+
output: DeleteClusterPolicyCommandOutput;
114+
};
115+
};
116+
}

0 commit comments

Comments
 (0)