Skip to content

Commit f5e3e09

Browse files
author
awstools
committed
feat(client-dsql): Features: support for customer managed encryption keys
1 parent 6c961b6 commit f5e3e09

File tree

6 files changed

+219
-0
lines changed

6 files changed

+219
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export interface CreateClusterCommandOutput extends CreateClusterOutput, __Metad
101101
* const client = new DSQLClient(config);
102102
* const input = { // CreateClusterInput
103103
* deletionProtectionEnabled: true || false,
104+
* kmsEncryptionKey: "STRING_VALUE",
104105
* tags: { // TagMap
105106
* "<keys>": "STRING_VALUE",
106107
* },
@@ -125,6 +126,11 @@ export interface CreateClusterCommandOutput extends CreateClusterOutput, __Metad
125126
* // "STRING_VALUE",
126127
* // ],
127128
* // },
129+
* // encryptionDetails: { // EncryptionDetails
130+
* // encryptionType: "AWS_OWNED_KMS_KEY" || "CUSTOMER_MANAGED_KMS_KEY", // required
131+
* // kmsKeyArn: "STRING_VALUE",
132+
* // encryptionStatus: "ENABLED" || "UPDATING" || "KMS_KEY_INACCESSIBLE" || "ENABLING", // required
133+
* // },
128134
* // deletionProtectionEnabled: true || false, // required
129135
* // };
130136
*

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ export interface GetClusterCommandOutput extends GetClusterOutput, __MetadataBea
5555
* // tags: { // TagMap
5656
* // "<keys>": "STRING_VALUE",
5757
* // },
58+
* // encryptionDetails: { // EncryptionDetails
59+
* // encryptionType: "AWS_OWNED_KMS_KEY" || "CUSTOMER_MANAGED_KMS_KEY", // required
60+
* // kmsKeyArn: "STRING_VALUE",
61+
* // encryptionStatus: "ENABLED" || "UPDATING" || "KMS_KEY_INACCESSIBLE" || "ENABLING", // required
62+
* // },
5863
* // };
5964
*
6065
* ```

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export interface UpdateClusterCommandOutput extends UpdateClusterOutput, __Metad
124124
* const input = { // UpdateClusterInput
125125
* identifier: "STRING_VALUE", // required
126126
* deletionProtectionEnabled: true || false,
127+
* kmsEncryptionKey: "STRING_VALUE",
127128
* clientToken: "STRING_VALUE",
128129
* multiRegionProperties: { // MultiRegionProperties
129130
* witnessRegion: "STRING_VALUE",

clients/client-dsql/src/models/models_0.ts

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ export interface CreateClusterInput {
108108
*/
109109
deletionProtectionEnabled?: boolean | undefined;
110110

111+
/**
112+
* <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
113+
* @public
114+
*/
115+
kmsEncryptionKey?: string | undefined;
116+
111117
/**
112118
* <p>A map of key and value pairs to use to tag your cluster.</p>
113119
* @public
@@ -133,6 +139,60 @@ export interface CreateClusterInput {
133139
multiRegionProperties?: MultiRegionProperties | undefined;
134140
}
135141

142+
/**
143+
* @public
144+
* @enum
145+
*/
146+
export const EncryptionStatus = {
147+
ENABLED: "ENABLED",
148+
ENABLING: "ENABLING",
149+
KMS_KEY_INACCESSIBLE: "KMS_KEY_INACCESSIBLE",
150+
UPDATING: "UPDATING",
151+
} as const;
152+
153+
/**
154+
* @public
155+
*/
156+
export type EncryptionStatus = (typeof EncryptionStatus)[keyof typeof EncryptionStatus];
157+
158+
/**
159+
* @public
160+
* @enum
161+
*/
162+
export const EncryptionType = {
163+
AWS_OWNED_KMS_KEY: "AWS_OWNED_KMS_KEY",
164+
CUSTOMER_MANAGED_KMS_KEY: "CUSTOMER_MANAGED_KMS_KEY",
165+
} as const;
166+
167+
/**
168+
* @public
169+
*/
170+
export type EncryptionType = (typeof EncryptionType)[keyof typeof EncryptionType];
171+
172+
/**
173+
* <p>Configuration details about encryption for the cluster including the KMS key ARN, encryption type, and encryption status.</p>
174+
* @public
175+
*/
176+
export interface EncryptionDetails {
177+
/**
178+
* <p>The type of encryption that protects the data on your cluster.</p>
179+
* @public
180+
*/
181+
encryptionType: EncryptionType | undefined;
182+
183+
/**
184+
* <p>The ARN of the KMS key that encrypts data in the cluster.</p>
185+
* @public
186+
*/
187+
kmsKeyArn?: string | undefined;
188+
189+
/**
190+
* <p>The status of encryption for the cluster.</p>
191+
* @public
192+
*/
193+
encryptionStatus: EncryptionStatus | undefined;
194+
}
195+
136196
/**
137197
* <p>The output of a created cluster.</p>
138198
* @public
@@ -168,6 +228,12 @@ export interface CreateClusterOutput {
168228
*/
169229
multiRegionProperties?: MultiRegionProperties | undefined;
170230

231+
/**
232+
* <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
233+
* @public
234+
*/
235+
encryptionDetails?: EncryptionDetails | undefined;
236+
171237
/**
172238
* <p>Whether deletion protection is enabled on this cluster.</p>
173239
* @public
@@ -510,6 +576,12 @@ export interface GetClusterOutput {
510576
* @public
511577
*/
512578
tags?: Record<string, string> | undefined;
579+
580+
/**
581+
* <p>The current encryption configuration details for the cluster.</p>
582+
* @public
583+
*/
584+
encryptionDetails?: EncryptionDetails | undefined;
513585
}
514586

515587
/**
@@ -607,6 +679,12 @@ export interface UpdateClusterInput {
607679
*/
608680
deletionProtectionEnabled?: boolean | undefined;
609681

682+
/**
683+
* <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
684+
* @public
685+
*/
686+
kmsEncryptionKey?: string | undefined;
687+
610688
/**
611689
* <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the
612690
* request. Idempotency ensures that an API request completes only once. With an idempotent

clients/client-dsql/src/protocols/Aws_restJson1.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const se_CreateClusterCommand = async (
7070
take(input, {
7171
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
7272
deletionProtectionEnabled: [],
73+
kmsEncryptionKey: [],
7374
multiRegionProperties: (_) => _json(_),
7475
tags: (_) => _json(_),
7576
})
@@ -224,6 +225,7 @@ export const se_UpdateClusterCommand = async (
224225
take(input, {
225226
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
226227
deletionProtectionEnabled: [],
228+
kmsEncryptionKey: [],
227229
multiRegionProperties: (_) => _json(_),
228230
})
229231
);
@@ -249,6 +251,7 @@ export const de_CreateClusterCommand = async (
249251
arn: __expectString,
250252
creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
251253
deletionProtectionEnabled: __expectBoolean,
254+
encryptionDetails: _json,
252255
identifier: __expectString,
253256
multiRegionProperties: _json,
254257
status: __expectString,
@@ -299,6 +302,7 @@ export const de_GetClusterCommand = async (
299302
arn: __expectString,
300303
creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
301304
deletionProtectionEnabled: __expectBoolean,
305+
encryptionDetails: _json,
302306
identifier: __expectString,
303307
multiRegionProperties: _json,
304308
status: __expectString,
@@ -631,6 +635,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
631635

632636
// de_ClusterSummary omitted.
633637

638+
// de_EncryptionDetails omitted.
639+
634640
// de_MultiRegionProperties omitted.
635641

636642
// de_TagMap omitted.

codegen/sdk-codegen/aws-models/dsql.json

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
},
5959
"deletionProtectionEnabled": {
6060
"target": "com.amazonaws.dsql#DeletionProtectionEnabled"
61+
},
62+
"encryptionDetails": {
63+
"target": "com.amazonaws.dsql#EncryptionDetails"
6164
}
6265
},
6366
"create": {
@@ -300,6 +303,13 @@
300303
"smithy.api#documentation": "<p>If enabled, you can't delete your cluster. You must first disable this property before\n you can delete your cluster.</p>"
301304
}
302305
},
306+
"kmsEncryptionKey": {
307+
"target": "com.amazonaws.dsql#KmsEncryptionKey",
308+
"traits": {
309+
"smithy.api#documentation": "<p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>",
310+
"smithy.api#notProperty": {}
311+
}
312+
},
303313
"tags": {
304314
"target": "com.amazonaws.dsql#TagMap",
305315
"traits": {
@@ -364,6 +374,13 @@
364374
"smithy.api#notProperty": {}
365375
}
366376
},
377+
"encryptionDetails": {
378+
"target": "com.amazonaws.dsql#EncryptionDetails",
379+
"traits": {
380+
"smithy.api#documentation": "<p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>",
381+
"smithy.api#notProperty": {}
382+
}
383+
},
367384
"deletionProtectionEnabled": {
368385
"target": "com.amazonaws.dsql#DeletionProtectionEnabled",
369386
"traits": {
@@ -870,6 +887,80 @@
870887
"smithy.api#documentation": "<p>Indicates whether deletion protection is enabled for a cluster.</p>"
871888
}
872889
},
890+
"com.amazonaws.dsql#EncryptionDetails": {
891+
"type": "structure",
892+
"members": {
893+
"encryptionType": {
894+
"target": "com.amazonaws.dsql#EncryptionType",
895+
"traits": {
896+
"smithy.api#documentation": "<p>The type of encryption that protects the data on your cluster.</p>",
897+
"smithy.api#required": {}
898+
}
899+
},
900+
"kmsKeyArn": {
901+
"target": "com.amazonaws.dsql#KmsKeyArn",
902+
"traits": {
903+
"smithy.api#documentation": "<p>The ARN of the KMS key that encrypts data in the cluster.</p>"
904+
}
905+
},
906+
"encryptionStatus": {
907+
"target": "com.amazonaws.dsql#EncryptionStatus",
908+
"traits": {
909+
"smithy.api#documentation": "<p>The status of encryption for the cluster.</p>",
910+
"smithy.api#required": {}
911+
}
912+
}
913+
},
914+
"traits": {
915+
"smithy.api#documentation": "<p>Configuration details about encryption for the cluster including the KMS key ARN, encryption type, and encryption status.</p>"
916+
}
917+
},
918+
"com.amazonaws.dsql#EncryptionStatus": {
919+
"type": "enum",
920+
"members": {
921+
"ENABLED": {
922+
"target": "smithy.api#Unit",
923+
"traits": {
924+
"smithy.api#enumValue": "ENABLED"
925+
}
926+
},
927+
"UPDATING": {
928+
"target": "smithy.api#Unit",
929+
"traits": {
930+
"smithy.api#enumValue": "UPDATING"
931+
}
932+
},
933+
"KMS_KEY_INACCESSIBLE": {
934+
"target": "smithy.api#Unit",
935+
"traits": {
936+
"smithy.api#enumValue": "KMS_KEY_INACCESSIBLE"
937+
}
938+
},
939+
"ENABLING": {
940+
"target": "smithy.api#Unit",
941+
"traits": {
942+
"smithy.api#enumValue": "ENABLING"
943+
}
944+
}
945+
}
946+
},
947+
"com.amazonaws.dsql#EncryptionType": {
948+
"type": "enum",
949+
"members": {
950+
"AWS_OWNED_KMS_KEY": {
951+
"target": "smithy.api#Unit",
952+
"traits": {
953+
"smithy.api#enumValue": "AWS_OWNED_KMS_KEY"
954+
}
955+
},
956+
"CUSTOMER_MANAGED_KMS_KEY": {
957+
"target": "smithy.api#Unit",
958+
"traits": {
959+
"smithy.api#enumValue": "CUSTOMER_MANAGED_KMS_KEY"
960+
}
961+
}
962+
}
963+
},
873964
"com.amazonaws.dsql#GetCluster": {
874965
"type": "operation",
875966
"input": {
@@ -1015,6 +1106,13 @@
10151106
"traits": {
10161107
"smithy.api#notProperty": {}
10171108
}
1109+
},
1110+
"encryptionDetails": {
1111+
"target": "com.amazonaws.dsql#EncryptionDetails",
1112+
"traits": {
1113+
"smithy.api#documentation": "<p>The current encryption configuration details for the cluster.</p>",
1114+
"smithy.api#notProperty": {}
1115+
}
10181116
}
10191117
},
10201118
"traits": {
@@ -1138,6 +1236,24 @@
11381236
"smithy.api#retryable": {}
11391237
}
11401238
},
1239+
"com.amazonaws.dsql#KmsEncryptionKey": {
1240+
"type": "string",
1241+
"traits": {
1242+
"smithy.api#length": {
1243+
"min": 1,
1244+
"max": 2048
1245+
},
1246+
"smithy.api#pattern": "^[a-zA-Z0-9:/_-]+$"
1247+
}
1248+
},
1249+
"com.amazonaws.dsql#KmsKeyArn": {
1250+
"type": "string",
1251+
"traits": {
1252+
"aws.api#arnReference": {
1253+
"type": "AWS::KMS::Key"
1254+
}
1255+
}
1256+
},
11411257
"com.amazonaws.dsql#ListClusters": {
11421258
"type": "operation",
11431259
"input": {
@@ -1696,6 +1812,13 @@
16961812
"smithy.api#documentation": "<p>Specifies whether to enable deletion protection in your cluster.</p>"
16971813
}
16981814
},
1815+
"kmsEncryptionKey": {
1816+
"target": "com.amazonaws.dsql#KmsEncryptionKey",
1817+
"traits": {
1818+
"smithy.api#documentation": "<p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>",
1819+
"smithy.api#notProperty": {}
1820+
}
1821+
},
16991822
"clientToken": {
17001823
"target": "com.amazonaws.dsql#ClientToken",
17011824
"traits": {

0 commit comments

Comments
 (0)