Associates the specified connection alias with the specified directory to enable cross-Region redirection. For more information, see Cross-Region Redirection for Amazon WorkSpaces.
Before performing this operation, call DescribeConnectionAliases to make sure that the current state of the connection alias is CREATED.
Parameters:
-
alias_id
(ConnectionAliasId)
–
The identifier of the connection alias.
-
resource_id
(NonEmptyString)
–
The identifier of the directory to associate the connection alias with.
Raises:
Source code in docs_src/capo_workspaces/_services/async_work_spaces.py
| async def associate_connection_alias(
self,
alias_id: "capo_workspaces.types.connection_alias_id.ConnectionAliasId",
resource_id: "capo_workspaces.types.non_empty_string.NonEmptyString",
*,
config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
) -> "capo_workspaces.types.associate_connection_alias_result.AssociateConnectionAliasResult":
"""<p>Associates the specified connection alias with the specified directory to enable cross-Region redirection. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html"> Cross-Region Redirection for Amazon WorkSpaces</a>.</p> <note> <p>Before performing this operation, call <a href="https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeConnectionAliases.html"> DescribeConnectionAliases</a> to make sure that the current state of the connection alias is <code>CREATED</code>.</p> </note>
Args:
alias_id: <p>The identifier of the connection alias.</p>
resource_id: <p>The identifier of the directory to associate the connection alias with.</p>
Raises:
capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
capo_workspaces.errors.invalid_parameter_values_exception.InvalidParameterValuesException: <p>One or more parameter values are not valid.</p>
capo_workspaces.errors.invalid_resource_state_exception.InvalidResourceStateException: <p>The state of the resource is not valid for this operation.</p>
capo_workspaces.errors.operation_not_supported_exception.OperationNotSupportedException: <p>This operation is not supported.</p>
capo_workspaces.errors.resource_associated_exception.ResourceAssociatedException: <p>The resource is associated with a directory.</p>
capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_workspaces.types.associate_connection_alias_request.AssociateConnectionAliasRequest]",
) -> AsyncOperationResponse[
"capo_workspaces.types.associate_connection_alias_result.AssociateConnectionAliasResult"
]:
import capo_workspaces._operations.workspaces_service.associate_connection_alias
(
output,
http_response,
) = await capo_workspaces._operations.workspaces_service.associate_connection_alias.async_associate_connection_alias(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateConnectionAlias")
)
input_: capo_workspaces.types.associate_connection_alias_request.AssociateConnectionAliasRequest = {
"alias_id": alias_id,
"resource_id": resource_id,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|