WorkspaceProviderAWS#
- class polars_cloud.WorkspaceProviderAWS(workspace_id: UUID)
The AWS connection of a workspace.
You can attach your own AWS account to a workspace to support BYOC on AWS and run clusters directly on your own AWS account.
- Parameters:
- workspace_id
The id of the workspace to manage the AWS connection of.
Examples
>>> provider = pc.WorkspaceProviderAWS(workspace.id) >>> provider.is_connected() True
Methods:
is_connectedWhether the workspace has an AWS account connected.
connectConnect an AWS account to the workspace.
disconnectDisconnect the AWS account from the workspace.
wait_until_connectedBlock until the workspace has an AWS account connected.
- is_connected() bool
Whether the workspace has an AWS account connected.
Examples
>>> pc.WorkspaceProviderAWS(workspace.id).is_connected() True
- connect(*, verify: bool = True) None
Connect an AWS account to the workspace.
This method will allow you to setup a connection with your AWS account and Polars Cloud. It opens a CloudFormation setup flow in a browser.
Does nothing if the workspace already has an AWS account connected.
- Parameters:
- verify
Wait for the AWS connection to be established.
Examples
>>> pc.WorkspaceProviderAWS(workspace.id).connect() Please complete the workspace setup process in your browser. Workspace creation may take up to 5 minutes to complete after clicking 'Create stack'. If your browser did not open automatically, please go to the following URL: [URL]
- disconnect() None
Disconnect the AWS account from the workspace.
Does nothing if the workspace has no AWS account connected.
Examples
>>> pc.WorkspaceProviderAWS(workspace.id).disconnect() To finish removing the AWS connection, delete the [STACK] CloudFormation stack in AWS.
- wait_until_connected( ) None
Block until the workspace has an AWS account connected.
- Parameters:
- interval
Number of seconds between checks.
- timeout
Number of seconds to wait before giving up.
- Raises:
- WorkspaceDeploymentError
If the CloudFormation stack rolled back, or the connection was removed while we were waiting for it.
- VerificationTimeoutError
If the connection was not established within the timeout.
Examples
>>> pc.WorkspaceProviderAWS(workspace.id).wait_until_connected()