Skip to content

Commit a39c581

Browse files
author
awstools
committed
feat(client-redshift): Introduces new fields for LogDestinationType and LogExports on EnableLogging requests and Enable/Disable/DescribeLogging responses. Customers can now select CloudWatch Logs as a destination for their Audit Logs.
1 parent b97e526 commit a39c581

File tree

3 files changed

+166
-7
lines changed

3 files changed

+166
-7
lines changed

clients/client-redshift/src/models/models_1.ts

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ export namespace DescribeLoggingStatusMessage {
7777
});
7878
}
7979

80+
export enum LogDestinationType {
81+
CLOUDWATCH = "cloudwatch",
82+
S3 = "s3",
83+
}
84+
8085
/**
8186
* <p>Describes the status of logging for a cluster.</p>
8287
*/
@@ -111,6 +116,16 @@ export interface LoggingStatus {
111116
* <p>The message indicating that logs failed to be delivered.</p>
112117
*/
113118
LastFailureMessage?: string;
119+
120+
/**
121+
* <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
122+
*/
123+
LogDestinationType?: LogDestinationType | string;
124+
125+
/**
126+
* <p>The collection of exported log types. Log types include the connection log, user log and user activity log.</p>
127+
*/
128+
LogExports?: string[];
114129
}
115130

116131
export namespace LoggingStatus {
@@ -1696,7 +1711,7 @@ export interface EnableLoggingMessage {
16961711
* </li>
16971712
* </ul>
16981713
*/
1699-
BucketName: string | undefined;
1714+
BucketName?: string;
17001715

17011716
/**
17021717
* <p>The prefix applied to the log file names.</p>
@@ -1729,6 +1744,16 @@ export interface EnableLoggingMessage {
17291744
* </ul>
17301745
*/
17311746
S3KeyPrefix?: string;
1747+
1748+
/**
1749+
* <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
1750+
*/
1751+
LogDestinationType?: LogDestinationType | string;
1752+
1753+
/**
1754+
* <p>The collection of exported log types. Log types include the connection log, user log and user activity log.</p>
1755+
*/
1756+
LogExports?: string[];
17321757
}
17331758

17341759
export namespace EnableLoggingMessage {
@@ -3708,7 +3733,7 @@ export interface RestoreFromClusterSnapshotMessage {
37083733
ManualSnapshotRetentionPeriod?: number;
37093734

37103735
/**
3711-
* <p>The Key Management Service (KMS) key ID of the encryption key to encrypt data in the cluster
3736+
* <p>The Key Management Service (KMS) key ID of the encryption key that encrypts data in the cluster
37123737
* restored from a shared snapshot. You can also provide
37133738
* the key ID when you restore from an unencrypted snapshot to an encrypted cluster in
37143739
* the same account. Additionally, you can specify a new KMS key ID when you restore from an encrypted
@@ -3815,7 +3840,7 @@ export interface RestoreFromClusterSnapshotMessage {
38153840

38163841
/**
38173842
* <p>Enables support for restoring an unencrypted snapshot to a cluster encrypted
3818-
* with Key Management Service (KMS) and a CMK.</p>
3843+
* with Key Management Service (KMS) and a customer managed key.</p>
38193844
*/
38203845
Encrypted?: boolean;
38213846
}

clients/client-redshift/src/protocols/Aws_query.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12229,6 +12229,16 @@ const serializeAws_queryEnableLoggingMessage = (input: EnableLoggingMessage, con
1222912229
if (input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null) {
1223012230
entries["S3KeyPrefix"] = input.S3KeyPrefix;
1223112231
}
12232+
if (input.LogDestinationType !== undefined && input.LogDestinationType !== null) {
12233+
entries["LogDestinationType"] = input.LogDestinationType;
12234+
}
12235+
if (input.LogExports !== undefined && input.LogExports !== null) {
12236+
const memberEntries = serializeAws_queryLogTypeList(input.LogExports, context);
12237+
Object.entries(memberEntries).forEach(([key, value]) => {
12238+
const loc = `LogExports.${key}`;
12239+
entries[loc] = value;
12240+
});
12241+
}
1223212242
return entries;
1223312243
};
1223412244

@@ -12351,6 +12361,19 @@ const serializeAws_queryIamRoleArnList = (input: string[], context: __SerdeConte
1235112361
return entries;
1235212362
};
1235312363

12364+
const serializeAws_queryLogTypeList = (input: string[], context: __SerdeContext): any => {
12365+
const entries: any = {};
12366+
let counter = 1;
12367+
for (const entry of input) {
12368+
if (entry === null) {
12369+
continue;
12370+
}
12371+
entries[`member.${counter}`] = entry;
12372+
counter++;
12373+
}
12374+
return entries;
12375+
};
12376+
1235412377
const serializeAws_queryModifyAquaInputMessage = (input: ModifyAquaInputMessage, context: __SerdeContext): any => {
1235512378
const entries: any = {};
1235612379
if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) {
@@ -16974,6 +16997,8 @@ const deserializeAws_queryLoggingStatus = (output: any, context: __SerdeContext)
1697416997
LastSuccessfulDeliveryTime: undefined,
1697516998
LastFailureTime: undefined,
1697616999
LastFailureMessage: undefined,
17000+
LogDestinationType: undefined,
17001+
LogExports: undefined,
1697717002
};
1697817003
if (output["LoggingEnabled"] !== undefined) {
1697917004
contents.LoggingEnabled = __parseBoolean(output["LoggingEnabled"]);
@@ -16993,9 +17018,32 @@ const deserializeAws_queryLoggingStatus = (output: any, context: __SerdeContext)
1699317018
if (output["LastFailureMessage"] !== undefined) {
1699417019
contents.LastFailureMessage = __expectString(output["LastFailureMessage"]);
1699517020
}
17021+
if (output["LogDestinationType"] !== undefined) {
17022+
contents.LogDestinationType = __expectString(output["LogDestinationType"]);
17023+
}
17024+
if (output.LogExports === "") {
17025+
contents.LogExports = [];
17026+
}
17027+
if (output["LogExports"] !== undefined && output["LogExports"]["member"] !== undefined) {
17028+
contents.LogExports = deserializeAws_queryLogTypeList(
17029+
__getArrayIfSingleItem(output["LogExports"]["member"]),
17030+
context
17031+
);
17032+
}
1699617033
return contents;
1699717034
};
1699817035

17036+
const deserializeAws_queryLogTypeList = (output: any, context: __SerdeContext): string[] => {
17037+
return (output || [])
17038+
.filter((e: any) => e != null)
17039+
.map((entry: any) => {
17040+
if (entry === null) {
17041+
return null as any;
17042+
}
17043+
return __expectString(entry) as any;
17044+
});
17045+
};
17046+
1699917047
const deserializeAws_queryMaintenanceTrack = (output: any, context: __SerdeContext): MaintenanceTrack => {
1700017048
const contents: any = {
1700117049
MaintenanceTrackName: undefined,

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

Lines changed: 90 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,6 +3554,9 @@
35543554
"input": {
35553555
"target": "com.amazonaws.redshift#CreateTagsMessage"
35563556
},
3557+
"output": {
3558+
"target": "smithy.api#Unit"
3559+
},
35573560
"errors": [
35583561
{
35593562
"target": "com.amazonaws.redshift#InvalidClusterStateFault"
@@ -4115,6 +4118,9 @@
41154118
"input": {
41164119
"target": "com.amazonaws.redshift#DeleteClusterParameterGroupMessage"
41174120
},
4121+
"output": {
4122+
"target": "smithy.api#Unit"
4123+
},
41184124
"errors": [
41194125
{
41204126
"target": "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault"
@@ -4155,6 +4161,9 @@
41554161
"input": {
41564162
"target": "com.amazonaws.redshift#DeleteClusterSecurityGroupMessage"
41574163
},
4164+
"output": {
4165+
"target": "smithy.api#Unit"
4166+
},
41584167
"errors": [
41594168
{
41604169
"target": "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault"
@@ -4245,6 +4254,9 @@
42454254
"input": {
42464255
"target": "com.amazonaws.redshift#DeleteClusterSubnetGroupMessage"
42474256
},
4257+
"output": {
4258+
"target": "smithy.api#Unit"
4259+
},
42484260
"errors": [
42494261
{
42504262
"target": "com.amazonaws.redshift#ClusterSubnetGroupNotFoundFault"
@@ -4321,6 +4333,9 @@
43214333
"input": {
43224334
"target": "com.amazonaws.redshift#DeleteEventSubscriptionMessage"
43234335
},
4336+
"output": {
4337+
"target": "smithy.api#Unit"
4338+
},
43244339
"errors": [
43254340
{
43264341
"target": "com.amazonaws.redshift#InvalidSubscriptionStateFault"
@@ -4353,6 +4368,9 @@
43534368
"input": {
43544369
"target": "com.amazonaws.redshift#DeleteHsmClientCertificateMessage"
43554370
},
4371+
"output": {
4372+
"target": "smithy.api#Unit"
4373+
},
43564374
"errors": [
43574375
{
43584376
"target": "com.amazonaws.redshift#HsmClientCertificateNotFoundFault"
@@ -4385,6 +4403,9 @@
43854403
"input": {
43864404
"target": "com.amazonaws.redshift#DeleteHsmConfigurationMessage"
43874405
},
4406+
"output": {
4407+
"target": "smithy.api#Unit"
4408+
},
43884409
"errors": [
43894410
{
43904411
"target": "com.amazonaws.redshift#HsmConfigurationNotFoundFault"
@@ -4440,6 +4461,9 @@
44404461
"input": {
44414462
"target": "com.amazonaws.redshift#DeleteScheduledActionMessage"
44424463
},
4464+
"output": {
4465+
"target": "smithy.api#Unit"
4466+
},
44434467
"errors": [
44444468
{
44454469
"target": "com.amazonaws.redshift#ScheduledActionNotFoundFault"
@@ -4469,6 +4493,9 @@
44694493
"input": {
44704494
"target": "com.amazonaws.redshift#DeleteSnapshotCopyGrantMessage"
44714495
},
4496+
"output": {
4497+
"target": "smithy.api#Unit"
4498+
},
44724499
"errors": [
44734500
{
44744501
"target": "com.amazonaws.redshift#InvalidSnapshotCopyGrantStateFault"
@@ -4501,6 +4528,9 @@
45014528
"input": {
45024529
"target": "com.amazonaws.redshift#DeleteSnapshotScheduleMessage"
45034530
},
4531+
"output": {
4532+
"target": "smithy.api#Unit"
4533+
},
45044534
"errors": [
45054535
{
45064536
"target": "com.amazonaws.redshift#InvalidClusterSnapshotScheduleStateFault"
@@ -4530,6 +4560,9 @@
45304560
"input": {
45314561
"target": "com.amazonaws.redshift#DeleteTagsMessage"
45324562
},
4563+
"output": {
4564+
"target": "smithy.api#Unit"
4565+
},
45334566
"errors": [
45344567
{
45354568
"target": "com.amazonaws.redshift#InvalidTagFault"
@@ -4569,6 +4602,9 @@
45694602
"input": {
45704603
"target": "com.amazonaws.redshift#DeleteUsageLimitMessage"
45714604
},
4605+
"output": {
4606+
"target": "smithy.api#Unit"
4607+
},
45724608
"errors": [
45734609
{
45744610
"target": "com.amazonaws.redshift#UnsupportedOperationFault"
@@ -6722,6 +6758,9 @@
67226758
},
67236759
"com.amazonaws.redshift#DescribeStorage": {
67246760
"type": "operation",
6761+
"input": {
6762+
"target": "smithy.api#Unit"
6763+
},
67256764
"output": {
67266765
"target": "com.amazonaws.redshift#CustomerStorageMessage"
67276766
},
@@ -7188,15 +7227,26 @@
71887227
"BucketName": {
71897228
"target": "com.amazonaws.redshift#String",
71907229
"traits": {
7191-
"smithy.api#documentation": "<p>The name of an existing S3 bucket where the log files are to be stored.</p>\n <p>Constraints:</p>\n <ul>\n <li>\n <p>Must be in the same region as the cluster</p>\n </li>\n <li>\n <p>The cluster must have read bucket and put object permissions</p>\n </li>\n </ul>",
7192-
"smithy.api#required": {}
7230+
"smithy.api#documentation": "<p>The name of an existing S3 bucket where the log files are to be stored.</p>\n <p>Constraints:</p>\n <ul>\n <li>\n <p>Must be in the same region as the cluster</p>\n </li>\n <li>\n <p>The cluster must have read bucket and put object permissions</p>\n </li>\n </ul>"
71937231
}
71947232
},
71957233
"S3KeyPrefix": {
71967234
"target": "com.amazonaws.redshift#String",
71977235
"traits": {
71987236
"smithy.api#documentation": "<p>The prefix applied to the log file names.</p>\n <p>Constraints:</p>\n <ul>\n <li>\n <p>Cannot exceed 512 characters</p>\n </li>\n <li>\n <p>Cannot contain spaces( ), double quotes (\"), single quotes ('), a backslash\n (\\), or control characters. The hexadecimal codes for invalid characters are: </p>\n <ul>\n <li>\n <p>x00 to x20</p>\n </li>\n <li>\n <p>x22</p>\n </li>\n <li>\n <p>x27</p>\n </li>\n <li>\n <p>x5c</p>\n </li>\n <li>\n <p>x7f or larger</p>\n </li>\n </ul>\n </li>\n </ul>"
71997237
}
7238+
},
7239+
"LogDestinationType": {
7240+
"target": "com.amazonaws.redshift#LogDestinationType",
7241+
"traits": {
7242+
"smithy.api#documentation": "<p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>"
7243+
}
7244+
},
7245+
"LogExports": {
7246+
"target": "com.amazonaws.redshift#LogTypeList",
7247+
"traits": {
7248+
"smithy.api#documentation": "<p>The collection of exported log types. Log types include the connection log, user log and user activity log.</p>"
7249+
}
72007250
}
72017251
},
72027252
"traits": {
@@ -9072,6 +9122,27 @@
90729122
"smithy.api#httpError": 400
90739123
}
90749124
},
9125+
"com.amazonaws.redshift#LogDestinationType": {
9126+
"type": "string",
9127+
"traits": {
9128+
"smithy.api#enum": [
9129+
{
9130+
"value": "s3",
9131+
"name": "S3"
9132+
},
9133+
{
9134+
"value": "cloudwatch",
9135+
"name": "CLOUDWATCH"
9136+
}
9137+
]
9138+
}
9139+
},
9140+
"com.amazonaws.redshift#LogTypeList": {
9141+
"type": "list",
9142+
"member": {
9143+
"target": "com.amazonaws.redshift#String"
9144+
}
9145+
},
90759146
"com.amazonaws.redshift#LoggingStatus": {
90769147
"type": "structure",
90779148
"members": {
@@ -9110,6 +9181,18 @@
91109181
"traits": {
91119182
"smithy.api#documentation": "<p>The message indicating that logs failed to be delivered.</p>"
91129183
}
9184+
},
9185+
"LogDestinationType": {
9186+
"target": "com.amazonaws.redshift#LogDestinationType",
9187+
"traits": {
9188+
"smithy.api#documentation": "<p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>"
9189+
}
9190+
},
9191+
"LogExports": {
9192+
"target": "com.amazonaws.redshift#LogTypeList",
9193+
"traits": {
9194+
"smithy.api#documentation": "<p>The collection of exported log types. Log types include the connection log, user log and user activity log.</p>"
9195+
}
91139196
}
91149197
},
91159198
"traits": {
@@ -9798,6 +9881,9 @@
97989881
"input": {
97999882
"target": "com.amazonaws.redshift#ModifyClusterSnapshotScheduleMessage"
98009883
},
9884+
"output": {
9885+
"target": "smithy.api#Unit"
9886+
},
98019887
"errors": [
98029888
{
98039889
"target": "com.amazonaws.redshift#ClusterNotFoundFault"
@@ -12552,7 +12638,7 @@
1255212638
"KmsKeyId": {
1255312639
"target": "com.amazonaws.redshift#String",
1255412640
"traits": {
12555-
"smithy.api#documentation": "<p>The Key Management Service (KMS) key ID of the encryption key to encrypt data in the cluster \n restored from a shared snapshot. You can also provide \n the key ID when you restore from an unencrypted snapshot to an encrypted cluster in \n the same account. Additionally, you can specify a new KMS key ID when you restore from an encrypted \n snapshot in the same account in order to change it. In that case, the restored cluster is encrypted \n with the new KMS key ID.</p>"
12641+
"smithy.api#documentation": "<p>The Key Management Service (KMS) key ID of the encryption key that encrypts data in the cluster \n restored from a shared snapshot. You can also provide \n the key ID when you restore from an unencrypted snapshot to an encrypted cluster in \n the same account. Additionally, you can specify a new KMS key ID when you restore from an encrypted \n snapshot in the same account in order to change it. In that case, the restored cluster is encrypted \n with the new KMS key ID.</p>"
1255612642
}
1255712643
},
1255812644
"NodeType": {
@@ -12630,7 +12716,7 @@
1263012716
"Encrypted": {
1263112717
"target": "com.amazonaws.redshift#BooleanOptional",
1263212718
"traits": {
12633-
"smithy.api#documentation": "<p>Enables support for restoring an unencrypted snapshot to a cluster encrypted \n with Key Management Service (KMS) and a CMK.</p>"
12719+
"smithy.api#documentation": "<p>Enables support for restoring an unencrypted snapshot to a cluster encrypted \n with Key Management Service (KMS) and a customer managed key.</p>"
1263412720
}
1263512721
}
1263612722
},

0 commit comments

Comments
 (0)