Skip to content

Commit

Permalink
feat(client-cloudhsm-v2): Add support for Dual-Stack hsm2m.medium clu…
Browse files Browse the repository at this point in the history
…sters. The customers will now be able to create hsm2m.medium clusters having both IPv4 and IPv6 connection capabilities by specifying a new param called NetworkType=DUALSTACK during cluster creation.
  • Loading branch information
awstools committed Dec 13, 2024
1 parent 718151a commit 50cf29a
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface CreateClusterCommandOutput extends CreateClusterResponse, __Met
* SubnetIds: [ // SubnetIds // required
* "STRING_VALUE",
* ],
* NetworkType: "IPV4" || "DUALSTACK",
* TagList: [ // TagList
* { // Tag
* Key: "STRING_VALUE", // required
Expand All @@ -74,6 +75,7 @@ export interface CreateClusterCommandOutput extends CreateClusterResponse, __Met
* // SubnetId: "STRING_VALUE",
* // EniId: "STRING_VALUE",
* // EniIp: "STRING_VALUE",
* // EniIpV6: "STRING_VALUE",
* // HsmId: "STRING_VALUE", // required
* // State: "CREATE_IN_PROGRESS" || "ACTIVE" || "DEGRADED" || "DELETE_IN_PROGRESS" || "DELETED",
* // StateMessage: "STRING_VALUE",
Expand All @@ -83,12 +85,13 @@ export interface CreateClusterCommandOutput extends CreateClusterResponse, __Met
* // PreCoPassword: "STRING_VALUE",
* // SecurityGroup: "STRING_VALUE",
* // SourceBackupId: "STRING_VALUE",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "MODIFY_IN_PROGRESS" || "ROLLBACK_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // StateMessage: "STRING_VALUE",
* // SubnetMapping: { // ExternalSubnetMapping
* // "<keys>": "STRING_VALUE",
* // },
* // VpcId: "STRING_VALUE",
* // NetworkType: "IPV4" || "DUALSTACK",
* // Certificates: { // Certificates
* // ClusterCsr: "STRING_VALUE",
* // HsmCertificate: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface CreateHsmCommandOutput extends CreateHsmResponse, __MetadataBea
* // SubnetId: "STRING_VALUE",
* // EniId: "STRING_VALUE",
* // EniIp: "STRING_VALUE",
* // EniIpV6: "STRING_VALUE",
* // HsmId: "STRING_VALUE", // required
* // State: "CREATE_IN_PROGRESS" || "ACTIVE" || "DEGRADED" || "DELETE_IN_PROGRESS" || "DELETED",
* // StateMessage: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface DeleteClusterCommandOutput extends DeleteClusterResponse, __Met
* // SubnetId: "STRING_VALUE",
* // EniId: "STRING_VALUE",
* // EniIp: "STRING_VALUE",
* // EniIpV6: "STRING_VALUE",
* // HsmId: "STRING_VALUE", // required
* // State: "CREATE_IN_PROGRESS" || "ACTIVE" || "DEGRADED" || "DELETE_IN_PROGRESS" || "DELETED",
* // StateMessage: "STRING_VALUE",
Expand All @@ -68,12 +69,13 @@ export interface DeleteClusterCommandOutput extends DeleteClusterResponse, __Met
* // PreCoPassword: "STRING_VALUE",
* // SecurityGroup: "STRING_VALUE",
* // SourceBackupId: "STRING_VALUE",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "MODIFY_IN_PROGRESS" || "ROLLBACK_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // StateMessage: "STRING_VALUE",
* // SubnetMapping: { // ExternalSubnetMapping
* // "<keys>": "STRING_VALUE",
* // },
* // VpcId: "STRING_VALUE",
* // NetworkType: "IPV4" || "DUALSTACK",
* // Certificates: { // Certificates
* // ClusterCsr: "STRING_VALUE",
* // HsmCertificate: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface DescribeClustersCommandOutput extends DescribeClustersResponse,
* // SubnetId: "STRING_VALUE",
* // EniId: "STRING_VALUE",
* // EniIp: "STRING_VALUE",
* // EniIpV6: "STRING_VALUE",
* // HsmId: "STRING_VALUE", // required
* // State: "CREATE_IN_PROGRESS" || "ACTIVE" || "DEGRADED" || "DELETE_IN_PROGRESS" || "DELETED",
* // StateMessage: "STRING_VALUE",
Expand All @@ -79,12 +80,13 @@ export interface DescribeClustersCommandOutput extends DescribeClustersResponse,
* // PreCoPassword: "STRING_VALUE",
* // SecurityGroup: "STRING_VALUE",
* // SourceBackupId: "STRING_VALUE",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "MODIFY_IN_PROGRESS" || "ROLLBACK_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // StateMessage: "STRING_VALUE",
* // SubnetMapping: { // ExternalSubnetMapping
* // "<keys>": "STRING_VALUE",
* // },
* // VpcId: "STRING_VALUE",
* // NetworkType: "IPV4" || "DUALSTACK",
* // Certificates: { // Certificates
* // ClusterCsr: "STRING_VALUE",
* // HsmCertificate: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface InitializeClusterCommandOutput extends InitializeClusterRespons
* const command = new InitializeClusterCommand(input);
* const response = await client.send(command);
* // { // InitializeClusterResponse
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "MODIFY_IN_PROGRESS" || "ROLLBACK_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // StateMessage: "STRING_VALUE",
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface ModifyClusterCommandOutput extends ModifyClusterResponse, __Met
* // SubnetId: "STRING_VALUE",
* // EniId: "STRING_VALUE",
* // EniIp: "STRING_VALUE",
* // EniIpV6: "STRING_VALUE",
* // HsmId: "STRING_VALUE", // required
* // State: "CREATE_IN_PROGRESS" || "ACTIVE" || "DEGRADED" || "DELETE_IN_PROGRESS" || "DELETED",
* // StateMessage: "STRING_VALUE",
Expand All @@ -71,12 +72,13 @@ export interface ModifyClusterCommandOutput extends ModifyClusterResponse, __Met
* // PreCoPassword: "STRING_VALUE",
* // SecurityGroup: "STRING_VALUE",
* // SourceBackupId: "STRING_VALUE",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // State: "CREATE_IN_PROGRESS" || "UNINITIALIZED" || "INITIALIZE_IN_PROGRESS" || "INITIALIZED" || "ACTIVE" || "UPDATE_IN_PROGRESS" || "MODIFY_IN_PROGRESS" || "ROLLBACK_IN_PROGRESS" || "DELETE_IN_PROGRESS" || "DELETED" || "DEGRADED",
* // StateMessage: "STRING_VALUE",
* // SubnetMapping: { // ExternalSubnetMapping
* // "<keys>": "STRING_VALUE",
* // },
* // VpcId: "STRING_VALUE",
* // NetworkType: "IPV4" || "DUALSTACK",
* // Certificates: { // Certificates
* // ClusterCsr: "STRING_VALUE",
* // HsmCertificate: "STRING_VALUE",
Expand Down
3 changes: 3 additions & 0 deletions clients/client-cloudhsm-v2/src/commands/TagResourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export interface TagResourceCommandOutput extends TagResourceResponse, __Metadat
* @throws {@link CloudHsmInvalidRequestException} (client fault)
* <p>The request was rejected because it is not a valid request.</p>
*
* @throws {@link CloudHsmResourceLimitExceededException} (client fault)
* <p>The request was rejected because it exceeds an CloudHSM limit.</p>
*
* @throws {@link CloudHsmResourceNotFoundException} (client fault)
* <p>The request was rejected because it refers to a resource that cannot be
* found.</p>
Expand Down
62 changes: 62 additions & 0 deletions clients/client-cloudhsm-v2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,20 @@ export interface CopyBackupToRegionResponse {
DestinationBackup?: DestinationBackup | undefined;
}

/**
* @public
* @enum
*/
export const NetworkType = {
DUALSTACK: "DUALSTACK",
IPV4: "IPV4",
} as const;

/**
* @public
*/
export type NetworkType = (typeof NetworkType)[keyof typeof NetworkType];

/**
* @public
*/
Expand Down Expand Up @@ -440,6 +454,14 @@ export interface CreateClusterRequest {
*/
SubnetIds: string[] | undefined;

/**
* <p>The NetworkType to create a cluster with. The allowed values are
* <code>IPV4</code> and <code>DUALSTACK</code>.
* </p>
* @public
*/
NetworkType?: NetworkType | undefined;

/**
* <p>Tags to apply to the CloudHSM cluster during creation.</p>
* @public
Expand Down Expand Up @@ -545,6 +567,12 @@ export interface Hsm {
*/
EniIp?: string | undefined;

/**
* <p>The IPv6 address (if any) of the HSM's elastic network interface (ENI).</p>
* @public
*/
EniIpV6?: string | undefined;

/**
* <p>The HSM's identifier (ID).</p>
* @public
Expand Down Expand Up @@ -576,6 +604,8 @@ export const ClusterState = {
DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS",
INITIALIZED: "INITIALIZED",
INITIALIZE_IN_PROGRESS: "INITIALIZE_IN_PROGRESS",
MODIFY_IN_PROGRESS: "MODIFY_IN_PROGRESS",
ROLLBACK_IN_PROGRESS: "ROLLBACK_IN_PROGRESS",
UNINITIALIZED: "UNINITIALIZED",
UPDATE_IN_PROGRESS: "UPDATE_IN_PROGRESS",
} as const;
Expand Down Expand Up @@ -670,6 +700,16 @@ export interface Cluster {
*/
VpcId?: string | undefined;

/**
* <p>The cluster's NetworkType can be set to either IPV4 (which is the default) or DUALSTACK.
* When set to IPV4, communication between your application and the Hardware Security Modules (HSMs) is restricted to the IPv4 protocol only.
* In contrast, the DUALSTACK network type enables communication over both the IPv4 and IPv6 protocols.
* To use the DUALSTACK option, you'll need to configure your Virtual Private Cloud (VPC) and subnets to support both IPv4 and IPv6. This involves adding IPv6 Classless Inter-Domain Routing (CIDR) blocks to the existing IPv4 CIDR blocks in your subnets.
* The choice between IPV4 and DUALSTACK network types determines the flexibility of the network addressing setup for your cluster. The DUALSTACK option provides more flexibility by allowing both IPv4 and IPv6 communication.</p>
* @public
*/
NetworkType?: NetworkType | undefined;

/**
* <p>Contains one or more certificates or a certificate signing request (CSR).</p>
* @public
Expand Down Expand Up @@ -1210,6 +1250,28 @@ export interface RestoreBackupResponse {
Backup?: Backup | undefined;
}

/**
* <p>The request was rejected because it exceeds an CloudHSM limit.</p>
* @public
*/
export class CloudHsmResourceLimitExceededException extends __BaseException {
readonly name: "CloudHsmResourceLimitExceededException" = "CloudHsmResourceLimitExceededException";
readonly $fault: "client" = "client";
Message?: string | undefined;
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<CloudHsmResourceLimitExceededException, __BaseException>) {
super({
name: "CloudHsmResourceLimitExceededException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, CloudHsmResourceLimitExceededException.prototype);
this.Message = opts.Message;
}
}

/**
* @public
*/
Expand Down
23 changes: 23 additions & 0 deletions clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
CloudHsmAccessDeniedException,
CloudHsmInternalFailureException,
CloudHsmInvalidRequestException,
CloudHsmResourceLimitExceededException,
CloudHsmResourceNotFoundException,
CloudHsmServiceException,
CloudHsmTagException,
Expand Down Expand Up @@ -708,6 +709,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "CloudHsmTagException":
case "com.amazonaws.cloudhsmv2#CloudHsmTagException":
throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
case "CloudHsmResourceLimitExceededException":
case "com.amazonaws.cloudhsmv2#CloudHsmResourceLimitExceededException":
throw await de_CloudHsmResourceLimitExceededExceptionRes(parsedOutput, context);
default:
const parsedBody = parsedOutput.body;
return throwDefaultError({
Expand Down Expand Up @@ -766,6 +770,22 @@ const de_CloudHsmInvalidRequestExceptionRes = async (
return __decorateServiceException(exception, body);
};

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

/**
* deserializeAws_json1_1CloudHsmResourceNotFoundExceptionRes
*/
Expand Down Expand Up @@ -908,6 +928,8 @@ const de_Backups = (output: any, context: __SerdeContext): Backup[] => {

// de_CloudHsmInvalidRequestException omitted.

// de_CloudHsmResourceLimitExceededException omitted.

// de_CloudHsmResourceNotFoundException omitted.

// de_CloudHsmServiceException omitted.
Expand All @@ -927,6 +949,7 @@ const de_Cluster = (output: any, context: __SerdeContext): Cluster => {
HsmType: __expectString,
Hsms: _json,
Mode: __expectString,
NetworkType: __expectString,
PreCoPassword: __expectString,
SecurityGroup: __expectString,
SourceBackupId: __expectString,
Expand Down
Loading

0 comments on commit 50cf29a

Please sign in to comment.