Skip to content

Commit

Permalink
feat(client-redshift-serverless): Adds dualstack support for Redshift…
Browse files Browse the repository at this point in the history
… Serverless workgroup.
  • Loading branch information
awstools committed Jul 22, 2024
1 parent cada4c3 commit b6495b0
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function createAwsAuthSigv4HttpAuthOption(authParameters: RedshiftServerlessHttp
name: "redshift-serverless",
region: authParameters.region,
},
propertiesExtractor: (config: RedshiftServerlessClientConfig, context) => ({
propertiesExtractor: (config: Partial<RedshiftServerlessClientConfig>, context) => ({
/**
* @internal
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface CreateEndpointAccessCommandOutput extends CreateEndpointAccessR
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface CreateWorkgroupCommandOutput extends CreateWorkgroupResponse, _
* ],
* port: Number("int"),
* maxCapacity: Number("int"),
* ipAddressType: "STRING_VALUE",
* };
* const command = new CreateWorkgroupCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -102,6 +103,7 @@ export interface CreateWorkgroupCommandOutput extends CreateWorkgroupResponse, _
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand All @@ -119,6 +121,7 @@ export interface CreateWorkgroupCommandOutput extends CreateWorkgroupResponse, _
* // crossAccountVpcs: [ // VpcIds
* // "STRING_VALUE",
* // ],
* // ipAddressType: "STRING_VALUE",
* // },
* // };
*
Expand All @@ -139,6 +142,9 @@ export interface CreateWorkgroupCommandOutput extends CreateWorkgroupResponse, _
* @throws {@link InternalServerException} (server fault)
* <p>The request processing has failed because of an unknown error, exception or failure.</p>
*
* @throws {@link Ipv6CidrBlockNotFoundException} (client fault)
* <p>There are no subnets in your VPC with associated IPv6 CIDR blocks. To use dual-stack mode, associate an IPv6 CIDR block with each subnet in your VPC.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource could not be found.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface DeleteEndpointAccessCommandOutput extends DeleteEndpointAccessR
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface DeleteWorkgroupCommandOutput extends DeleteWorkgroupResponse, _
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand All @@ -95,6 +96,7 @@ export interface DeleteWorkgroupCommandOutput extends DeleteWorkgroupResponse, _
* // crossAccountVpcs: [ // VpcIds
* // "STRING_VALUE",
* // ],
* // ipAddressType: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface GetEndpointAccessCommandOutput extends GetEndpointAccessRespons
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface GetWorkgroupCommandOutput extends GetWorkgroupResponse, __Metad
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand All @@ -95,6 +96,7 @@ export interface GetWorkgroupCommandOutput extends GetWorkgroupResponse, __Metad
* // crossAccountVpcs: [ // VpcIds
* // "STRING_VALUE",
* // ],
* // ipAddressType: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export interface ListEndpointAccessCommandOutput extends ListEndpointAccessRespo
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export interface ListWorkgroupsCommandOutput extends ListWorkgroupsResponse, __M
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand All @@ -99,6 +100,7 @@ export interface ListWorkgroupsCommandOutput extends ListWorkgroupsResponse, __M
* // crossAccountVpcs: [ // VpcIds
* // "STRING_VALUE",
* // ],
* // ipAddressType: "STRING_VALUE",
* // },
* // ],
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface UpdateEndpointAccessCommandOutput extends UpdateEndpointAccessR
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface UpdateWorkgroupCommandOutput extends UpdateWorkgroupResponse, _
* ],
* port: Number("int"),
* maxCapacity: Number("int"),
* ipAddressType: "STRING_VALUE",
* };
* const command = new UpdateWorkgroupCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -96,6 +97,7 @@ export interface UpdateWorkgroupCommandOutput extends UpdateWorkgroupResponse, _
* // subnetId: "STRING_VALUE",
* // privateIpAddress: "STRING_VALUE",
* // availabilityZone: "STRING_VALUE",
* // ipv6Address: "STRING_VALUE",
* // },
* // ],
* // },
Expand All @@ -113,6 +115,7 @@ export interface UpdateWorkgroupCommandOutput extends UpdateWorkgroupResponse, _
* // crossAccountVpcs: [ // VpcIds
* // "STRING_VALUE",
* // ],
* // ipAddressType: "STRING_VALUE",
* // },
* // };
*
Expand All @@ -133,6 +136,9 @@ export interface UpdateWorkgroupCommandOutput extends UpdateWorkgroupResponse, _
* @throws {@link InternalServerException} (server fault)
* <p>The request processing has failed because of an unknown error, exception or failure.</p>
*
* @throws {@link Ipv6CidrBlockNotFoundException} (client fault)
* <p>There are no subnets in your VPC with associated IPv6 CIDR blocks. To use dual-stack mode, associate an IPv6 CIDR block with each subnet in your VPC.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource could not be found.</p>
*
Expand Down
50 changes: 47 additions & 3 deletions clients/client-redshift-serverless/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ export interface NetworkInterface {
* @public
*/
availabilityZone?: string;

/**
* <p>The IPv6 address of the network interface within the subnet.</p>
* @public
*/
ipv6Address?: string;
}

/**
Expand Down Expand Up @@ -1072,7 +1078,7 @@ export interface CreateScheduledActionRequest {
* <p>The ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action.
* This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots. (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf.
* For more information about the IAM role to use with the Amazon Redshift scheduler, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">Using Identity-Based Policies for
* Amazon Redshift</a> in the Amazon Redshift Cluster Management Guide</p>
* Amazon Redshift</a> in the Amazon Redshift Management Guide</p>
* @public
*/
roleArn: string | undefined;
Expand Down Expand Up @@ -1165,7 +1171,7 @@ export interface ScheduledActionResponse {
* <p>The ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action.
* This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots. (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf.
* For more information about the IAM role to use with the Amazon Redshift scheduler, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">Using Identity-Based Policies for
* Amazon Redshift</a> in the Amazon Redshift Cluster Management Guide</p>
* Amazon Redshift</a> in the Amazon Redshift Management Guide</p>
* @public
*/
roleArn?: string;
Expand Down Expand Up @@ -1556,6 +1562,12 @@ export interface CreateWorkgroupRequest {
* @public
*/
maxCapacity?: number;

/**
* <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
* @public
*/
ipAddressType?: string;
}

/**
Expand Down Expand Up @@ -1733,6 +1745,12 @@ export interface Workgroup {
* @public
*/
crossAccountVpcs?: string[];

/**
* <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
* @public
*/
ipAddressType?: string;
}

/**
Expand Down Expand Up @@ -1767,6 +1785,26 @@ export class InsufficientCapacityException extends __BaseException {
}
}

/**
* <p>There are no subnets in your VPC with associated IPv6 CIDR blocks. To use dual-stack mode, associate an IPv6 CIDR block with each subnet in your VPC.</p>
* @public
*/
export class Ipv6CidrBlockNotFoundException extends __BaseException {
readonly name: "Ipv6CidrBlockNotFoundException" = "Ipv6CidrBlockNotFoundException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<Ipv6CidrBlockNotFoundException, __BaseException>) {
super({
name: "Ipv6CidrBlockNotFoundException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, Ipv6CidrBlockNotFoundException.prototype);
}
}

/**
* @public
*/
Expand Down Expand Up @@ -3343,7 +3381,7 @@ export interface UpdateScheduledActionRequest {
* <p>The ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action.
* This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf.
* For more information about the IAM role to use with the Amazon Redshift scheduler, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">Using Identity-Based Policies for
* Amazon Redshift</a> in the Amazon Redshift Cluster Management Guide</p>
* Amazon Redshift</a> in the Amazon Redshift Management Guide</p>
* @public
*/
roleArn?: string;
Expand Down Expand Up @@ -3788,6 +3826,12 @@ export interface UpdateWorkgroupRequest {
* @public
*/
maxCapacity?: number;

/**
* <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
* @public
*/
ipAddressType?: string;
}

/**
Expand Down
23 changes: 23 additions & 0 deletions clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ import {
InsufficientCapacityException,
InternalServerException,
InvalidPaginationException,
Ipv6CidrBlockNotFoundException,
ListCustomDomainAssociationsRequest,
ListCustomDomainAssociationsResponse,
ListEndpointAccessRequest,
Expand Down Expand Up @@ -2132,6 +2133,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "InsufficientCapacityException":
case "com.amazonaws.redshiftserverless#InsufficientCapacityException":
throw await de_InsufficientCapacityExceptionRes(parsedOutput, context);
case "Ipv6CidrBlockNotFoundException":
case "com.amazonaws.redshiftserverless#Ipv6CidrBlockNotFoundException":
throw await de_Ipv6CidrBlockNotFoundExceptionRes(parsedOutput, context);
case "InvalidPaginationException":
case "com.amazonaws.redshiftserverless#InvalidPaginationException":
throw await de_InvalidPaginationExceptionRes(parsedOutput, context);
Expand Down Expand Up @@ -2222,6 +2226,22 @@ const de_InvalidPaginationExceptionRes = async (
return __decorateServiceException(exception, body);
};

/**
* deserializeAws_json1_1Ipv6CidrBlockNotFoundExceptionRes
*/
const de_Ipv6CidrBlockNotFoundExceptionRes = async (
parsedOutput: any,
context: __SerdeContext
): Promise<Ipv6CidrBlockNotFoundException> => {
const body = parsedOutput.body;
const deserialized: any = _json(body);
const exception = new Ipv6CidrBlockNotFoundException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return __decorateServiceException(exception, body);
};

/**
* deserializeAws_json1_1ResourceNotFoundExceptionRes
*/
Expand Down Expand Up @@ -2794,6 +2814,8 @@ const de_GetWorkgroupResponse = (output: any, context: __SerdeContext): GetWorkg

// de_InvalidPaginationException omitted.

// de_Ipv6CidrBlockNotFoundException omitted.

/**
* deserializeAws_json1_1ListCustomDomainAssociationsResponse
*/
Expand Down Expand Up @@ -3240,6 +3262,7 @@ const de_Workgroup = (output: any, context: __SerdeContext): Workgroup => {
customDomainName: __expectString,
endpoint: _json,
enhancedVpcRouting: __expectBoolean,
ipAddressType: __expectString,
maxCapacity: __expectInt32,
namespaceName: __expectString,
patchVersion: __expectString,
Expand Down
Loading

0 comments on commit b6495b0

Please sign in to comment.