Skip to content

Commit

Permalink
feat(client-workspaces): The release introduces Multi-Region Resilien…
Browse files Browse the repository at this point in the history
…ce one-way data replication that allows you to replicate data from your primary WorkSpace to a standby WorkSpace in another AWS Region. DescribeWorkspaces now returns the status of data replication.
  • Loading branch information
awstools committed Nov 27, 2023
1 parent c190128 commit f807e5a
Show file tree
Hide file tree
Showing 7 changed files with 297 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export interface CreateStandbyWorkspacesCommandOutput extends CreateStandbyWorks
* Value: "STRING_VALUE",
* },
* ],
* DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE",
* },
* ],
* };
Expand All @@ -75,6 +76,7 @@ export interface CreateStandbyWorkspacesCommandOutput extends CreateStandbyWorks
* // Value: "STRING_VALUE",
* // },
* // ],
* // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE",
* // },
* // ErrorCode: "STRING_VALUE",
* // ErrorMessage: "STRING_VALUE",
Expand Down
11 changes: 11 additions & 0 deletions clients/client-workspaces/src/commands/CreateWorkspacesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ export interface CreateWorkspacesCommandOutput extends CreateWorkspacesResult, _
* // Type: "PRIMARY" || "STANDBY",
* // },
* // ],
* // DataReplicationSettings: { // DataReplicationSettings
* // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE",
* // RecoverySnapshotTime: new Date("TIMESTAMP"),
* // },
* // StandbyWorkspacesProperties: [ // StandbyWorkspacesPropertiesList
* // { // StandbyWorkspacesProperties
* // StandbyWorkspaceId: "STRING_VALUE",
* // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE",
* // RecoverySnapshotTime: new Date("TIMESTAMP"),
* // },
* // ],
* // },
* // ],
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ export interface DescribeWorkspacesCommandOutput extends DescribeWorkspacesResul
* // Type: "PRIMARY" || "STANDBY",
* // },
* // ],
* // DataReplicationSettings: { // DataReplicationSettings
* // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE",
* // RecoverySnapshotTime: new Date("TIMESTAMP"),
* // },
* // StandbyWorkspacesProperties: [ // StandbyWorkspacesPropertiesList
* // { // StandbyWorkspacesProperties
* // StandbyWorkspaceId: "STRING_VALUE",
* // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE",
* // RecoverySnapshotTime: new Date("TIMESTAMP"),
* // },
* // ],
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface ModifyWorkspacePropertiesCommandOutput extends ModifyWorkspaceP
* ],
* OperatingSystemName: "AMAZON_LINUX_2" || "UBUNTU_18_04" || "UBUNTU_20_04" || "UBUNTU_22_04" || "UNKNOWN" || "WINDOWS_10" || "WINDOWS_11" || "WINDOWS_7" || "WINDOWS_SERVER_2016" || "WINDOWS_SERVER_2019" || "WINDOWS_SERVER_2022",
* },
* DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE",
* };
* const command = new ModifyWorkspacePropertiesCommand(input);
* const response = await client.send(command);
Expand Down
84 changes: 83 additions & 1 deletion clients/client-workspaces/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,20 @@ export interface CreateIpGroupResult {
GroupId?: string;
}

/**
* @public
* @enum
*/
export const DataReplication = {
NO_REPLICATION: "NO_REPLICATION",
PRIMARY_AS_SOURCE: "PRIMARY_AS_SOURCE",
} as const;

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

/**
* @public
* <p>Describes a standby WorkSpace.</p>
Expand Down Expand Up @@ -1458,6 +1472,12 @@ export interface StandbyWorkspace {
* <p>The tags associated with the standby WorkSpace.</p>
*/
Tags?: Tag[];

/**
* @public
* <p>Indicates whether data replication is enabled, and if enabled, the type of data replication.</p>
*/
DataReplication?: DataReplication;
}

/**
Expand Down Expand Up @@ -2076,6 +2096,25 @@ export interface FailedCreateWorkspaceRequest {
ErrorMessage?: string;
}

/**
* @public
* <p>Describes the data replication settings.</p>
*/
export interface DataReplicationSettings {
/**
* @public
* <p>Indicates whether data replication is enabled, and if enabled, the type of data replication.</p>
*/
DataReplication?: DataReplication;

/**
* @public
* <p>The date and time at which the last successful snapshot was taken of the
* primary WorkSpace used for replicating data.</p>
*/
RecoverySnapshotTime?: Date;
}

/**
* @public
* @enum
Expand Down Expand Up @@ -2169,6 +2208,31 @@ export interface RelatedWorkspaceProperties {
Type?: StandbyWorkspaceRelationshipType;
}

/**
* @public
* <p>Describes the properties of the related standby WorkSpaces. </p>
*/
export interface StandbyWorkspacesProperties {
/**
* @public
* <p>The identifier of the standby WorkSpace</p>
*/
StandbyWorkspaceId?: string;

/**
* @public
* <p>Indicates whether data replication is enabled, and if enabled, the type of data replication.</p>
*/
DataReplication?: DataReplication;

/**
* @public
* <p>The date and time at which the last successful snapshot was taken of the
* primary WorkSpace used for replicating data.</p>
*/
RecoverySnapshotTime?: Date;
}

/**
* @public
* <p>Describes a WorkSpace.</p>
Expand Down Expand Up @@ -2281,6 +2345,18 @@ export interface Workspace {
* <p>The standby WorkSpace or primary WorkSpace related to the specified WorkSpace.</p>
*/
RelatedWorkspaces?: RelatedWorkspaceProperties[];

/**
* @public
* <p>Indicates the settings of the data replication.</p>
*/
DataReplicationSettings?: DataReplicationSettings;

/**
* @public
* <p>The properties of the standby WorkSpace</p>
*/
StandbyWorkspacesProperties?: StandbyWorkspacesProperties[];
}

/**
Expand Down Expand Up @@ -5169,7 +5245,13 @@ export interface ModifyWorkspacePropertiesRequest {
* @public
* <p>The properties of the WorkSpace.</p>
*/
WorkspaceProperties: WorkspaceProperties | undefined;
WorkspaceProperties?: WorkspaceProperties;

/**
* @public
* <p>Indicates the data replication status.</p>
*/
DataReplication?: DataReplication;
}

/**
Expand Down
101 changes: 95 additions & 6 deletions clients/client-workspaces/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectBoolean as __expectBoolean,
expectNonNull as __expectNonNull,
expectNumber as __expectNumber,
expectString as __expectString,
Expand Down Expand Up @@ -283,6 +284,8 @@ import {
CreateWorkspaceImageRequest,
CreateWorkspaceImageResult,
CreateWorkspacesRequest,
CreateWorkspacesResult,
DataReplicationSettings,
DefaultImportClientBrandingAttributes,
DeletableCertificateBasedAuthProperty,
DeletableSamlProperty,
Expand Down Expand Up @@ -327,6 +330,7 @@ import {
DescribeWorkspaceSnapshotsRequest,
DescribeWorkspaceSnapshotsResult,
DescribeWorkspacesRequest,
DescribeWorkspacesResult,
DisassociateConnectionAliasRequest,
DisassociateIpGroupsRequest,
DisassociateWorkspaceApplicationRequest,
Expand Down Expand Up @@ -375,6 +379,7 @@ import {
SelfservicePermissions,
Snapshot,
StandbyWorkspace,
StandbyWorkspacesProperties,
StartRequest,
StartWorkspacesRequest,
StopRequest,
Expand All @@ -390,6 +395,7 @@ import {
UpdateWorkspaceBundleRequest,
UpdateWorkspaceImagePermissionRequest,
UserStorage,
Workspace,
WorkspaceAccessProperties,
WorkSpaceApplication,
WorkSpaceApplicationDeployment,
Expand Down Expand Up @@ -2159,7 +2165,7 @@ export const de_CreateWorkspacesCommand = async (
}
const data: any = await parseBody(output.body, context);
let contents: any = {};
contents = _json(data);
contents = de_CreateWorkspacesResult(data, context);
const response: CreateWorkspacesCommandOutput = {
$metadata: deserializeMetadata(output),
...contents,
Expand Down Expand Up @@ -3618,7 +3624,7 @@ export const de_DescribeWorkspacesCommand = async (
}
const data: any = await parseBody(output.body, context);
let contents: any = {};
contents = _json(data);
contents = de_DescribeWorkspacesResult(data, context);
const response: DescribeWorkspacesCommandOutput = {
$metadata: deserializeMetadata(output),
...contents,
Expand Down Expand Up @@ -6113,7 +6119,25 @@ const de_CreateWorkspaceImageResult = (output: any, context: __SerdeContext): Cr
}) as any;
};

// de_CreateWorkspacesResult omitted.
/**
* deserializeAws_json1_1CreateWorkspacesResult
*/
const de_CreateWorkspacesResult = (output: any, context: __SerdeContext): CreateWorkspacesResult => {
return take(output, {
FailedRequests: _json,
PendingRequests: (_: any) => de_WorkspaceList(_, context),
}) as any;
};

/**
* deserializeAws_json1_1DataReplicationSettings
*/
const de_DataReplicationSettings = (output: any, context: __SerdeContext): DataReplicationSettings => {
return take(output, {
DataReplication: __expectString,
RecoverySnapshotTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
}) as any;
};

// de_DedicatedTenancyCidrRangeList omitted.

Expand Down Expand Up @@ -6284,7 +6308,15 @@ const de_DescribeWorkspaceSnapshotsResult = (
}) as any;
};

// de_DescribeWorkspacesResult omitted.
/**
* deserializeAws_json1_1DescribeWorkspacesResult
*/
const de_DescribeWorkspacesResult = (output: any, context: __SerdeContext): DescribeWorkspacesResult => {
return take(output, {
NextToken: __expectString,
Workspaces: (_: any) => de_WorkspaceList(_, context),
}) as any;
};

// de_DirectoryList omitted.

Expand Down Expand Up @@ -6480,6 +6512,29 @@ const de_SnapshotList = (output: any, context: __SerdeContext): Snapshot[] => {

// de_StandbyWorkspace omitted.

/**
* deserializeAws_json1_1StandbyWorkspacesProperties
*/
const de_StandbyWorkspacesProperties = (output: any, context: __SerdeContext): StandbyWorkspacesProperties => {
return take(output, {
DataReplication: __expectString,
RecoverySnapshotTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
StandbyWorkspaceId: __expectString,
}) as any;
};

/**
* deserializeAws_json1_1StandbyWorkspacesPropertiesList
*/
const de_StandbyWorkspacesPropertiesList = (output: any, context: __SerdeContext): StandbyWorkspacesProperties[] => {
const retVal = (output || [])
.filter((e: any) => e != null)
.map((entry: any) => {
return de_StandbyWorkspacesProperties(entry, context);
});
return retVal;
};

// de_StartWorkspacesResult omitted.

// de_StopWorkspacesResult omitted.
Expand Down Expand Up @@ -6510,7 +6565,31 @@ const de_SnapshotList = (output: any, context: __SerdeContext): Snapshot[] => {

// de_UserStorage omitted.

// de_Workspace omitted.
/**
* deserializeAws_json1_1Workspace
*/
const de_Workspace = (output: any, context: __SerdeContext): Workspace => {
return take(output, {
BundleId: __expectString,
ComputerName: __expectString,
DataReplicationSettings: (_: any) => de_DataReplicationSettings(_, context),
DirectoryId: __expectString,
ErrorCode: __expectString,
ErrorMessage: __expectString,
IpAddress: __expectString,
ModificationStates: _json,
RelatedWorkspaces: _json,
RootVolumeEncryptionEnabled: __expectBoolean,
StandbyWorkspacesProperties: (_: any) => de_StandbyWorkspacesPropertiesList(_, context),
State: __expectString,
SubnetId: __expectString,
UserName: __expectString,
UserVolumeEncryptionEnabled: __expectBoolean,
VolumeEncryptionKey: __expectString,
WorkspaceId: __expectString,
WorkspaceProperties: _json,
}) as any;
};

// de_WorkspaceAccessProperties omitted.

Expand Down Expand Up @@ -6630,7 +6709,17 @@ const de_WorkspaceImageList = (output: any, context: __SerdeContext): WorkspaceI
return retVal;
};

// de_WorkspaceList omitted.
/**
* deserializeAws_json1_1WorkspaceList
*/
const de_WorkspaceList = (output: any, context: __SerdeContext): Workspace[] => {
const retVal = (output || [])
.filter((e: any) => e != null)
.map((entry: any) => {
return de_Workspace(entry, context);
});
return retVal;
};

// de_WorkspaceProperties omitted.

Expand Down
Loading

0 comments on commit f807e5a

Please sign in to comment.