Skip to content

create_connection_alias

create_connection_alias(
    connection_string: ConnectionString,
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    tags: Optional[TagList] = None,
) -> CreateConnectionAliasResult

Creates the specified connection alias for use with cross-Region redirection. For more information, see Cross-Region Redirection for Amazon WorkSpaces.

Parameters:

  • connection_string (ConnectionString) –

    A connection string in the form of a fully qualified domain name (FQDN), such as www.example.com.

    After you create a connection string, it is always associated to your Amazon Web Services account. You cannot recreate the same connection string with a different account, even if you delete all instances of it from the original account. The connection string is globally reserved for your account.

  • tags (Optional[TagList], default: None ) –

    The tags to associate with the connection alias.

Raises:

Source code in docs_src/capo_workspaces/_services/work_spaces.py
def create_connection_alias(
    self,
    connection_string: "capo_workspaces.types.connection_string.ConnectionString",
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    tags: Optional["capo_workspaces.types.tag_list.TagList"] = None,
) -> "capo_workspaces.types.create_connection_alias_result.CreateConnectionAliasResult":
    """<p>Creates the specified connection alias for use with 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>

    Args:
        connection_string: <p>A connection string in the form of a fully qualified domain name (FQDN), such as <code>www.example.com</code>.</p> <important> <p>After you create a connection string, it is always associated to your Amazon Web Services account. You cannot recreate the same connection string with a different account, even if you delete all instances of it from the original account. The connection string is globally reserved for your account.</p> </important>
        tags: <p>The tags to associate with the connection alias.</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_already_exists_exception.ResourceAlreadyExistsException: <p>The specified resource already exists.</p>
        capo_workspaces.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>Your resource limits have been exceeded.</p>
        capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workspaces.types.create_connection_alias_request.CreateConnectionAliasRequest]",
    ) -> OperationResponse[
        "capo_workspaces.types.create_connection_alias_result.CreateConnectionAliasResult"
    ]:
        import capo_workspaces._operations.workspaces_service.create_connection_alias

        output, http_response = (
            capo_workspaces._operations.workspaces_service.create_connection_alias.create_connection_alias(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateConnectionAlias")
    )
    input_: capo_workspaces.types.create_connection_alias_request.CreateConnectionAliasRequest = {
        "connection_string": connection_string
    }
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output