workspaces

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 18 Imported by: 0

README

WorkSpaces

Parity grade: A · SDK aws-sdk-go-v2/service/workspaces@v1.68.3 · last audited 2026-07-12 (1b07910674fd)

Coverage

Metric Value
Operations audited 27 (25 ok, 2 deferred)
Feature families 16 (14 ok, 2 deferred)
Known gaps 2
Deferred items 3
Resource leaks clean
Known gaps
  • CreateStandbyWorkspaces never reports FailedStandbyRequests (e.g. for a missing DirectoryId) — always returns an empty failure list even when a standby spec is malformed. Lower priority than the CreateWorkspaces fix since CreateStandbyWorkspaces is a Multi-Region DR feature with much lower call volume. (bd: file follow-up)
  • AssociateIpGroups/DisassociateIpGroups state (directoryIpGroups map) is not persisted across Snapshot/Restore — pre-existing, documented design choice (see backend.go InMemoryBackend field comment), not newly introduced.
Deferred
  • DescribeImageAssociations / DescribeBundleAssociations
  • ListAvailableManagementCidrRanges
  • DescribeAccountModifications (returns empty list; no modification-history tracking)

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWorkspaceNotFound is returned when a workspace does not exist.
	ErrWorkspaceNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrInvalidParameter is returned on invalid input.
	ErrInvalidParameter = awserr.New(errInvalidParameterValues, awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("workspaces: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type BundleComputeType

type BundleComputeType struct {
	Name string
}

BundleComputeType holds the compute type name for a bundle.

type BundleStorage

type BundleStorage struct {
	Capacity int32
}

BundleStorage holds storage capacity for a bundle.

type FailedRequest

type FailedRequest struct {
	WorkspaceID  string
	ErrorCode    string
	ErrorMessage string
}

FailedRequest holds error information for a failed workspace bulk operation.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler handles WorkSpaces HTTP requests.

func NewHandler

func NewHandler(b StorageBackend) *Handler

NewHandler constructs a new Handler.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the X-Amz-Target header.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the resource identifier from the request.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset resets the backend.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a matcher that accepts WorkSpaces target header requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend. Handler previously had no Snapshot/Restore of its own, so cli.go's generic setupPersistence (which type-asserts the registered service.Registerable, i.e. the Handler, for a Snapshot/Restore pair) never picked WorkSpaces up even though InMemoryBackend already implemented persistence.Persistable -- dead wiring. Adding this delegation (matching the codecommit/codepipeline/ emr pattern) is what actually wires WorkSpaces into persistence.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend implements StorageBackend using in-memory maps.

Phase 3.3: every map[string]*T resource field is a *store.Table[T] registered on b.registry (see store_setup.go); registry.SnapshotAll / RestoreAll / ResetAll now drive Reset/Snapshot/Restore below (see persistence.go) instead of per-map hand-written boilerplate. tags, directoryIpGroups, imagePermissions, clientProperties, and appAssociations are left as plain maps -- their values are not *T (a map, a scalar, or a set), so there is no identity for store.Table to key on; see the field comments below and persistence.go's doc comment for which of these were persisted before this refactor and remain so.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend constructs a new InMemoryBackend.

func (*InMemoryBackend) AcceptAccountLinkInvitation

func (b *InMemoryBackend) AcceptAccountLinkInvitation(linkID string) (*storedAccountLink, error)

AcceptAccountLinkInvitation accepts an account link.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID.

func (*InMemoryBackend) AssociateConnectionAlias

func (b *InMemoryBackend) AssociateConnectionAlias(aliasID, resourceID string) (string, error)

AssociateConnectionAlias associates an alias with a resource.

func (*InMemoryBackend) AssociateIpGroups

func (b *InMemoryBackend) AssociateIpGroups(
	directoryID string,
	groupIDs []string,
) error

AssociateIpGroups associates IP groups with a directory.

func (*InMemoryBackend) AssociateWorkspaceApplication

func (b *InMemoryBackend) AssociateWorkspaceApplication(workspaceID, applicationID string) error

AssociateWorkspaceApplication associates an application with a workspace.

func (*InMemoryBackend) AuthorizeIpRules

func (b *InMemoryBackend) AuthorizeIpRules(
	groupID string,
	rules []ipRuleItem,
) error

AuthorizeIpRules appends rules to an IP group.

func (*InMemoryBackend) CopyWorkspaceImage

func (b *InMemoryBackend) CopyWorkspaceImage(
	name, sourceImageID, _, description string,
	tags map[string]string,
) (string, error)

CopyWorkspaceImage copies an image.

func (*InMemoryBackend) CreateAccountLinkInvitation

func (b *InMemoryBackend) CreateAccountLinkInvitation(
	targetAccountID string,
) (*storedAccountLink, error)

CreateAccountLinkInvitation creates an account link invitation.

func (*InMemoryBackend) CreateConnectClientAddIn

func (b *InMemoryBackend) CreateConnectClientAddIn(name, resourceID, url string) (string, error)

CreateConnectClientAddIn creates a new Connect client add-in.

func (*InMemoryBackend) CreateConnectionAlias

func (b *InMemoryBackend) CreateConnectionAlias(
	connectionString string, tags map[string]string,
) (string, error)

CreateConnectionAlias creates a new connection alias.

func (*InMemoryBackend) CreateIpGroup

func (b *InMemoryBackend) CreateIpGroup(
	groupName, groupDesc string,
	userRules []ipRuleItem,
	tags map[string]string,
) (string, error)

CreateIpGroup creates a new IP group and returns its ID.

func (*InMemoryBackend) CreateStandbyWorkspaces

func (b *InMemoryBackend) CreateStandbyWorkspaces(
	_ string, standby []map[string]string,
) ([]map[string]string, []map[string]string, error)

CreateStandbyWorkspaces creates standby workspaces (returns pending list).

func (*InMemoryBackend) CreateTags

func (b *InMemoryBackend) CreateTags(resourceID string, tags map[string]string) error

CreateTags applies tags to a workspace resource ID. Returns InvalidParameterValuesException if tag key/value limits are exceeded or if applying the tags would exceed the 50-tag limit per resource.

func (*InMemoryBackend) CreateUpdatedWorkspaceImage

func (b *InMemoryBackend) CreateUpdatedWorkspaceImage(
	sourceImageID, name, description string, tags map[string]string,
) (string, error)

CreateUpdatedWorkspaceImage creates an updated version of an existing image.

func (*InMemoryBackend) CreateWorkspace

func (b *InMemoryBackend) CreateWorkspace(
	ctx context.Context,
	spec *WorkspaceCreationSpec,
) (*Workspace, error)

CreateWorkspace creates a new WorkSpace and returns it. Returns InvalidParameterValuesException when spec.DirectoryID is not registered.

func (*InMemoryBackend) CreateWorkspaceBundle

func (b *InMemoryBackend) CreateWorkspaceBundle(
	name, description, imageID, computeType string,
	tags map[string]string,
) (*storedCustomBundle, error)

CreateWorkspaceBundle creates a custom bundle.

func (*InMemoryBackend) CreateWorkspaceImage

func (b *InMemoryBackend) CreateWorkspaceImage(
	name, description, _ string,
	tags map[string]string,
) (*storedImage, error)

CreateWorkspaceImage creates an image from a workspace.

func (*InMemoryBackend) CreateWorkspacesPool

func (b *InMemoryBackend) CreateWorkspacesPool(
	poolName, bundleID, directoryID, description string,
	tags map[string]string,
) (*storedPool, error)

CreateWorkspacesPool creates a new workspace pool.

func (*InMemoryBackend) DeleteAccountLinkInvitation

func (b *InMemoryBackend) DeleteAccountLinkInvitation(linkID string) (*storedAccountLink, error)

DeleteAccountLinkInvitation deletes an account link.

func (*InMemoryBackend) DeleteClientBranding

func (b *InMemoryBackend) DeleteClientBranding(resourceID string, platforms []string) error

DeleteClientBranding removes branding data for specific platforms.

func (*InMemoryBackend) DeleteConnectClientAddIn

func (b *InMemoryBackend) DeleteConnectClientAddIn(addInID, _ string) error

DeleteConnectClientAddIn removes a Connect client add-in.

func (*InMemoryBackend) DeleteConnectionAlias

func (b *InMemoryBackend) DeleteConnectionAlias(aliasID string) error

DeleteConnectionAlias removes a connection alias.

func (*InMemoryBackend) DeleteIPGroup

func (b *InMemoryBackend) DeleteIPGroup(
	groupID string,
) error

DeleteIPGroup removes an IP group by ID.

func (*InMemoryBackend) DeleteTags

func (b *InMemoryBackend) DeleteTags(resourceID string, tagKeys []string) error

DeleteTags removes tags from a workspace resource ID.

func (*InMemoryBackend) DeleteWorkspaceBundle

func (b *InMemoryBackend) DeleteWorkspaceBundle(bundleID string) error

DeleteWorkspaceBundle removes a custom bundle.

func (*InMemoryBackend) DeleteWorkspaceImage

func (b *InMemoryBackend) DeleteWorkspaceImage(imageID string) error

DeleteWorkspaceImage removes an image.

func (*InMemoryBackend) DeployWorkspaceApplications

func (b *InMemoryBackend) DeployWorkspaceApplications(
	workspaceID string,
	_ bool,
) ([]map[string]string, error)

DeployWorkspaceApplications deploys applications on a workspace (no-op in memory).

func (*InMemoryBackend) DeregisterWorkspaceDirectory

func (b *InMemoryBackend) DeregisterWorkspaceDirectory(directoryID string) error

DeregisterWorkspaceDirectory deregisters a directory.

func (*InMemoryBackend) DescribeAccount

func (b *InMemoryBackend) DescribeAccount() storedAccountConfig

DescribeAccount returns account configuration.

func (*InMemoryBackend) DescribeApplicationAssociations

func (b *InMemoryBackend) DescribeApplicationAssociations(
	applicationID string, _ []string, _ int32, _ string,
) ([]map[string]string, string, error)

DescribeApplicationAssociations returns workspace associations for an application.

func (*InMemoryBackend) DescribeApplications

func (b *InMemoryBackend) DescribeApplications(
	appIDs []string,
	_ int32,
	_ string,
) ([]*storedApplication, string, error)

DescribeApplications returns stored applications, filtered by IDs.

func (*InMemoryBackend) DescribeClientBranding

func (b *InMemoryBackend) DescribeClientBranding(
	resourceID string,
) (map[string]map[string]any, error)

DescribeClientBranding returns branding data for a resource.

func (*InMemoryBackend) DescribeClientProperties

func (b *InMemoryBackend) DescribeClientProperties(
	resourceIDs []string,
) (map[string]storedClientProps, error)

DescribeClientProperties returns client properties for resource IDs.

func (*InMemoryBackend) DescribeConnectClientAddIns

func (b *InMemoryBackend) DescribeConnectClientAddIns(
	resourceID string, _ int32, _ string,
) ([]*storedConnectAddIn, string, error)

DescribeConnectClientAddIns returns add-ins for a resource.

func (*InMemoryBackend) DescribeConnectionAliasPermissions

func (b *InMemoryBackend) DescribeConnectionAliasPermissions(
	aliasID string, _ int32, _ string,
) (string, []connAliasPermission, string, error)

DescribeConnectionAliasPermissions returns shared-account permissions for an alias.

func (*InMemoryBackend) DescribeConnectionAliases

func (b *InMemoryBackend) DescribeConnectionAliases(
	aliasIDs []string, resourceID string, _ int32, _ string,
) ([]*storedConnAlias, string, error)

DescribeConnectionAliases returns connection aliases filtered by IDs or resource.

func (*InMemoryBackend) DescribeCustomWorkspaceImageImport

func (b *InMemoryBackend) DescribeCustomWorkspaceImageImport(imageID string) (*storedImage, error)

DescribeCustomWorkspaceImageImport returns import state for a custom image.

func (*InMemoryBackend) DescribeIpGroups

func (b *InMemoryBackend) DescribeIpGroups(
	groupIDs []string, _ int32, _ string,
) ([]*storedIpGroup, string, error)

DescribeIpGroups returns IP groups, optionally filtered by IDs.

func (*InMemoryBackend) DescribeTags

func (b *InMemoryBackend) DescribeTags(resourceID string) (map[string]string, error)

DescribeTags returns tags for a workspace resource ID.

func (*InMemoryBackend) DescribeWorkspaceAssociations

func (b *InMemoryBackend) DescribeWorkspaceAssociations(
	workspaceID string,
	_ []string,
) ([]map[string]string, error)

DescribeWorkspaceAssociations returns application associations for a workspace.

func (*InMemoryBackend) DescribeWorkspaceBundles

func (b *InMemoryBackend) DescribeWorkspaceBundles(
	_ context.Context,
	bundleIDs []string, owner string, nextToken string,
) ([]*WorkspaceBundle, string, error)

DescribeWorkspaceBundles returns workspace bundles, optionally filtered by IDs or owner. When no owner is specified, returns both Amazon-owned and account-owned custom bundles. When owner is "Amazon", returns only Amazon-owned bundles. When owner is an account ID, returns custom bundles for that account. Results are sorted by BundleID and paginated (max 25 per page, matching AWS).

func (*InMemoryBackend) DescribeWorkspaceDirectories

func (b *InMemoryBackend) DescribeWorkspaceDirectories(
	_ context.Context,
	directoryIDs []string, nextToken string,
) ([]*WorkspaceDirectory, string, error)

DescribeWorkspaceDirectories returns workspace directories matching the given filters. Only directories that have been registered via RegisterWorkspaceDirectory are returned. Results are sorted by DirectoryID and paginated (max 50 per page, matching AWS).

func (*InMemoryBackend) DescribeWorkspaceImagePermissions

func (b *InMemoryBackend) DescribeWorkspaceImagePermissions(
	imageID string,
) (string, map[string]bool, error)

DescribeWorkspaceImagePermissions returns sharing permissions for an image.

func (*InMemoryBackend) DescribeWorkspaceImages

func (b *InMemoryBackend) DescribeWorkspaceImages(
	imageIDs []string, _ string, _ int32, _ string,
) ([]*storedImage, string, error)

DescribeWorkspaceImages returns workspace images, optionally filtered by IDs.

func (*InMemoryBackend) DescribeWorkspaces

func (b *InMemoryBackend) DescribeWorkspaces(
	ctx context.Context,
	workspaceIDs, directoryIDs, userIDs, bundleIDs []string,
	limit int32, nextToken string,
) ([]*Workspace, string, error)

DescribeWorkspaces returns workspaces matching the given filters. Results are sorted by WorkspaceId and paginated (max 25 per page, matching AWS).

func (*InMemoryBackend) DescribeWorkspacesPoolSessions

func (b *InMemoryBackend) DescribeWorkspacesPoolSessions(
	poolID, _ string, _ int32, _ string,
) ([]*storedPoolSession, string, error)

DescribeWorkspacesPoolSessions returns sessions for a pool.

func (*InMemoryBackend) DescribeWorkspacesPools

func (b *InMemoryBackend) DescribeWorkspacesPools(
	poolIDs []string, _ int32, _ string,
) ([]*storedPool, string, error)

DescribeWorkspacesPools returns pools, optionally filtered by IDs.

func (*InMemoryBackend) DisassociateConnectionAlias

func (b *InMemoryBackend) DisassociateConnectionAlias(aliasID string) error

DisassociateConnectionAlias removes the resource association from an alias.

func (*InMemoryBackend) DisassociateIpGroups

func (b *InMemoryBackend) DisassociateIpGroups(
	directoryID string,
	groupIDs []string,
) error

DisassociateIpGroups removes IP group associations from a directory.

func (*InMemoryBackend) DisassociateWorkspaceApplication

func (b *InMemoryBackend) DisassociateWorkspaceApplication(
	workspaceID, applicationID string,
) error

DisassociateWorkspaceApplication removes an application association from a workspace.

func (b *InMemoryBackend) GetAccountLink(linkID string) (*storedAccountLink, error)

GetAccountLink retrieves an account link by ID.

func (*InMemoryBackend) GetWorkspacesConnectionStatus

func (b *InMemoryBackend) GetWorkspacesConnectionStatus(
	workspaceIDs []string,
) ([]*WorkspaceConnectionStatus, error)

GetWorkspacesConnectionStatus returns connection status for the given workspace IDs. If no IDs are provided, returns status for all workspaces. AVAILABLE workspaces report DISCONNECTED (not yet connected in this emulator); STOPPED workspaces report NOT_CONNECTED, matching real AWS behaviour for offline workspaces.

func (*InMemoryBackend) ImportClientBranding

func (b *InMemoryBackend) ImportClientBranding(
	resourceID string, platforms map[string]map[string]any,
) error

ImportClientBranding stores branding data for a resource.

func (*InMemoryBackend) ImportCustomWorkspaceImage

func (b *InMemoryBackend) ImportCustomWorkspaceImage(
	name, description string,
) (*storedImage, error)

ImportCustomWorkspaceImage imports a custom workspace image.

func (*InMemoryBackend) ImportWorkspaceImage

func (b *InMemoryBackend) ImportWorkspaceImage(
	ec2ImageID, name, description string, tags map[string]string,
) (string, error)

ImportWorkspaceImage imports an EC2 image as a workspace image.

func (b *InMemoryBackend) ListAccountLinks(
	statusFilter string,
	_ int32,
	_ string,
) ([]*storedAccountLink, string, error)

ListAccountLinks returns account links, optionally filtered by status.

func (*InMemoryBackend) MigrateWorkspace

func (b *InMemoryBackend) MigrateWorkspace(
	sourceWorkspaceID, bundleID string,
) (sourceID, targetID string, err error)

MigrateWorkspace migrates a workspace to a new bundle.

func (*InMemoryBackend) ModifyAccount

func (b *InMemoryBackend) ModifyAccount(
	dedicatedTenancyCidr, dedicatedTenancySupport string,
) error

ModifyAccount updates account configuration.

func (*InMemoryBackend) ModifyCertificateBasedAuthProperties

func (b *InMemoryBackend) ModifyCertificateBasedAuthProperties(
	directoryID string,
	props map[string]string,
) error

ModifyCertificateBasedAuthProperties stores certificate auth properties for a directory.

func (*InMemoryBackend) ModifyClientProperties

func (b *InMemoryBackend) ModifyClientProperties(resourceID, reconnectEnabled string) error

ModifyClientProperties sets client properties for a resource.

func (*InMemoryBackend) ModifyEndpointEncryptionMode

func (b *InMemoryBackend) ModifyEndpointEncryptionMode(directoryID, mode string) error

ModifyEndpointEncryptionMode stores the endpoint encryption mode for a directory.

func (*InMemoryBackend) ModifySamlProperties

func (b *InMemoryBackend) ModifySamlProperties(directoryID string, props map[string]string) error

ModifySamlProperties stores SAML properties for a directory.

func (*InMemoryBackend) ModifySelfservicePermissions

func (b *InMemoryBackend) ModifySelfservicePermissions(
	directoryID string,
	props map[string]string,
) error

ModifySelfservicePermissions stores self-service permissions for a directory.

func (*InMemoryBackend) ModifyStreamingProperties

func (b *InMemoryBackend) ModifyStreamingProperties(
	directoryID string,
	props map[string]string,
) error

ModifyStreamingProperties stores streaming properties for a directory.

func (*InMemoryBackend) ModifyWorkspaceAccessProperties

func (b *InMemoryBackend) ModifyWorkspaceAccessProperties(
	directoryID string,
	props map[string]string,
) error

ModifyWorkspaceAccessProperties stores workspace access properties for a directory.

func (*InMemoryBackend) ModifyWorkspaceCreationProperties

func (b *InMemoryBackend) ModifyWorkspaceCreationProperties(
	directoryID string,
	props map[string]string,
) error

ModifyWorkspaceCreationProperties stores workspace creation properties for a directory.

func (*InMemoryBackend) ModifyWorkspaceProperties

func (b *InMemoryBackend) ModifyWorkspaceProperties(
	workspaceID string,
	props WorkspaceProperties,
) error

ModifyWorkspaceProperties updates and persists mutable properties of a WorkSpace. Returns InvalidParameterValuesException for unknown compute type names or running modes.

func (*InMemoryBackend) ModifyWorkspaceState

func (b *InMemoryBackend) ModifyWorkspaceState(workspaceID, state string) error

ModifyWorkspaceState updates the administrative state of a WorkSpace.

func (*InMemoryBackend) RebootWorkspaces

func (b *InMemoryBackend) RebootWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

RebootWorkspaces reboots the given workspaces, returning failures for unknown IDs.

func (*InMemoryBackend) RebuildWorkspaces

func (b *InMemoryBackend) RebuildWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

RebuildWorkspaces rebuilds the given workspaces, returning failures for unknown IDs.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the region.

func (*InMemoryBackend) RegisterWorkspaceDirectory

func (b *InMemoryBackend) RegisterWorkspaceDirectory(directoryID string, subnetIDs []string) error

RegisterWorkspaceDirectory registers a directory and stores subnet IDs.

func (*InMemoryBackend) RejectAccountLinkInvitation

func (b *InMemoryBackend) RejectAccountLinkInvitation(linkID string) (*storedAccountLink, error)

RejectAccountLinkInvitation rejects an account link.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore deserializes backend state from a snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) RestoreWorkspace

func (b *InMemoryBackend) RestoreWorkspace(workspaceID string) error

RestoreWorkspace restores a WorkSpace from its most recent snapshot. This backend does not model snapshots, so the operation is otherwise a no-op beyond existence validation, matching real AWS's ResourceNotFoundException for unknown WorkspaceIds.

func (*InMemoryBackend) RevokeIpRules

func (b *InMemoryBackend) RevokeIpRules(
	groupID string,
	ipRules []string,
) error

RevokeIpRules removes rules (by IpRule string) from an IP group.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serializes the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartWorkspaces

func (b *InMemoryBackend) StartWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

StartWorkspaces starts the given workspaces, transitioning STOPPED workspaces to AVAILABLE.

func (*InMemoryBackend) StartWorkspacesPool

func (b *InMemoryBackend) StartWorkspacesPool(poolID string) error

StartWorkspacesPool transitions a pool to RUNNING.

func (*InMemoryBackend) StopWorkspaces

func (b *InMemoryBackend) StopWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

StopWorkspaces stops the given workspaces, transitioning them to STOPPED state.

func (*InMemoryBackend) StopWorkspacesPool

func (b *InMemoryBackend) StopWorkspacesPool(poolID string) error

StopWorkspacesPool transitions a pool to STOPPED.

func (*InMemoryBackend) TerminateWorkspaces

func (b *InMemoryBackend) TerminateWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

TerminateWorkspaces terminates (deletes) the given workspaces, returning failures for unknown IDs.

func (*InMemoryBackend) TerminateWorkspacesPool

func (b *InMemoryBackend) TerminateWorkspacesPool(poolID string) error

TerminateWorkspacesPool removes a pool.

func (*InMemoryBackend) TerminateWorkspacesPoolSession

func (b *InMemoryBackend) TerminateWorkspacesPoolSession(sessionID string) error

TerminateWorkspacesPoolSession removes a pool session.

func (*InMemoryBackend) UpdateConnectClientAddIn

func (b *InMemoryBackend) UpdateConnectClientAddIn(
	addInID, _, name, url string,
) error

UpdateConnectClientAddIn updates a Connect client add-in.

func (*InMemoryBackend) UpdateConnectionAliasPermission

func (b *InMemoryBackend) UpdateConnectionAliasPermission(
	aliasID, accountID string, allowAssociation bool,
) error

UpdateConnectionAliasPermission sets the shared-account permission for an alias.

func (*InMemoryBackend) UpdateRulesOfIpGroup

func (b *InMemoryBackend) UpdateRulesOfIpGroup(
	groupID string,
	rules []ipRuleItem,
) error

UpdateRulesOfIpGroup replaces all rules in an IP group.

func (*InMemoryBackend) UpdateWorkspaceBundle

func (b *InMemoryBackend) UpdateWorkspaceBundle(bundleID, imageID string) error

UpdateWorkspaceBundle updates the image of a custom bundle.

func (*InMemoryBackend) UpdateWorkspaceImagePermission

func (b *InMemoryBackend) UpdateWorkspaceImagePermission(
	imageID, sharedAccountID string, allowCopy bool,
) error

UpdateWorkspaceImagePermission sets the sharing permission for an image.

func (*InMemoryBackend) UpdateWorkspacesPool

func (b *InMemoryBackend) UpdateWorkspacesPool(
	poolID, description, bundleID, directoryID string,
) (*storedPool, error)

UpdateWorkspacesPool updates pool fields.

type Provider

type Provider struct{}

Provider implements service.Provider for Amazon WorkSpaces.

func (*Provider) Init

Init initializes the WorkSpaces service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type StorageBackend

type StorageBackend interface {
	CreateWorkspace(ctx context.Context, spec *WorkspaceCreationSpec) (*Workspace, error)
	DescribeWorkspaces(
		ctx context.Context,
		workspaceIDs, directoryID, userID, bundleID []string,
		limit int32, nextToken string,
	) ([]*Workspace, string, error)
	GetWorkspacesConnectionStatus(workspaceIDs []string) ([]*WorkspaceConnectionStatus, error)
	ModifyWorkspaceProperties(workspaceID string, props WorkspaceProperties) error
	ModifyWorkspaceState(workspaceID, state string) error
	RebootWorkspaces(workspaceIDs []string) ([]FailedRequest, error)
	RebuildWorkspaces(workspaceIDs []string) ([]FailedRequest, error)
	StartWorkspaces(workspaceIDs []string) ([]FailedRequest, error)
	StopWorkspaces(workspaceIDs []string) ([]FailedRequest, error)
	TerminateWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

	CreateTags(resourceID string, tags map[string]string) error
	DeleteTags(resourceID string, tagKeys []string) error
	DescribeTags(resourceID string) (map[string]string, error)

	DescribeWorkspaceBundles(
		ctx context.Context,
		bundleIDs []string,
		owner string,
		nextToken string,
	) ([]*WorkspaceBundle, string, error)
	DescribeWorkspaceDirectories(
		ctx context.Context,
		directoryIDs []string,
		nextToken string,
	) ([]*WorkspaceDirectory, string, error)

	// IP Groups
	CreateIpGroup(
		groupName, groupDesc string,
		userRules []ipRuleItem,
		tags map[string]string,
	) (string, error)
	DescribeIpGroups(
		groupIDs []string,
		maxResults int32,
		nextToken string,
	) ([]*storedIpGroup, string, error)
	DeleteIPGroup(groupID string) error
	AuthorizeIpRules(groupID string, rules []ipRuleItem) error
	RevokeIpRules(groupID string, ipRules []string) error
	UpdateRulesOfIpGroup(groupID string, rules []ipRuleItem) error
	AssociateIpGroups(directoryID string, groupIDs []string) error
	DisassociateIpGroups(directoryID string, groupIDs []string) error

	// Connection Aliases
	CreateConnectionAlias(connectionString string, tags map[string]string) (string, error)
	DescribeConnectionAliases(
		aliasIDs []string, resourceID string, limit int32, nextToken string,
	) ([]*storedConnAlias, string, error)
	DeleteConnectionAlias(aliasID string) error
	AssociateConnectionAlias(aliasID, resourceID string) (string, error)
	DisassociateConnectionAlias(aliasID string) error
	DescribeConnectionAliasPermissions(
		aliasID string, maxResults int32, nextToken string,
	) (string, []connAliasPermission, string, error)
	UpdateConnectionAliasPermission(aliasID, accountID string, allowAssociation bool) error

	// Custom Bundles
	CreateWorkspaceBundle(
		name, description, imageID, computeType string,
		tags map[string]string,
	) (*storedCustomBundle, error)
	DeleteWorkspaceBundle(bundleID string) error
	UpdateWorkspaceBundle(bundleID, imageID string) error

	// Images
	CopyWorkspaceImage(
		name, sourceImageID, sourceRegion, description string,
		tags map[string]string,
	) (string, error)
	CreateWorkspaceImage(
		name, description, workspaceID string,
		tags map[string]string,
	) (*storedImage, error)
	DeleteWorkspaceImage(imageID string) error
	ImportWorkspaceImage(
		ec2ImageID, name, description string,
		tags map[string]string,
	) (string, error)
	ImportCustomWorkspaceImage(name, description string) (*storedImage, error)
	CreateUpdatedWorkspaceImage(
		sourceImageID, name, description string,
		tags map[string]string,
	) (string, error)
	DescribeWorkspaceImages(
		imageIDs []string,
		imageType string,
		maxResults int32,
		nextToken string,
	) ([]*storedImage, string, error)
	DescribeWorkspaceImagePermissions(imageID string) (string, map[string]bool, error)
	UpdateWorkspaceImagePermission(imageID, sharedAccountID string, allowCopy bool) error
	DescribeCustomWorkspaceImageImport(imageID string) (*storedImage, error)

	// Pools
	CreateWorkspacesPool(
		poolName, bundleID, directoryID, description string,
		tags map[string]string,
	) (*storedPool, error)
	DescribeWorkspacesPools(
		poolIDs []string,
		limit int32,
		nextToken string,
	) ([]*storedPool, string, error)
	StartWorkspacesPool(poolID string) error
	StopWorkspacesPool(poolID string) error
	TerminateWorkspacesPool(poolID string) error
	UpdateWorkspacesPool(poolID, description, bundleID, directoryID string) (*storedPool, error)
	DescribeWorkspacesPoolSessions(
		poolID, userID string,
		limit int32,
		nextToken string,
	) ([]*storedPoolSession, string, error)
	TerminateWorkspacesPoolSession(sessionID string) error

	// Directories
	RegisterWorkspaceDirectory(directoryID string, subnetIDs []string) error
	DeregisterWorkspaceDirectory(directoryID string) error

	// Account
	DescribeAccount() storedAccountConfig
	ModifyAccount(dedicatedTenancyCidr, dedicatedTenancySupport string) error
	ModifyEndpointEncryptionMode(directoryID, mode string) error

	// Connect Client Add-Ins
	CreateConnectClientAddIn(name, resourceID, url string) (string, error)
	DeleteConnectClientAddIn(addInID, resourceID string) error
	DescribeConnectClientAddIns(
		resourceID string,
		maxResults int32,
		nextToken string,
	) ([]*storedConnectAddIn, string, error)
	UpdateConnectClientAddIn(addInID, resourceID, name, url string) error

	// Client Branding
	ImportClientBranding(resourceID string, platforms map[string]map[string]any) error
	DescribeClientBranding(resourceID string) (map[string]map[string]any, error)
	DeleteClientBranding(resourceID string, platforms []string) error

	// Client Properties
	DescribeClientProperties(resourceIDs []string) (map[string]storedClientProps, error)
	ModifyClientProperties(resourceID, reconnectEnabled string) error

	// Directory modify ops
	ModifyCertificateBasedAuthProperties(directoryID string, props map[string]string) error
	ModifySamlProperties(directoryID string, props map[string]string) error
	ModifySelfservicePermissions(directoryID string, props map[string]string) error
	ModifyStreamingProperties(directoryID string, props map[string]string) error
	ModifyWorkspaceAccessProperties(directoryID string, props map[string]string) error
	ModifyWorkspaceCreationProperties(directoryID string, props map[string]string) error

	// Account Links
	CreateAccountLinkInvitation(targetAccountID string) (*storedAccountLink, error)
	AcceptAccountLinkInvitation(linkID string) (*storedAccountLink, error)
	RejectAccountLinkInvitation(linkID string) (*storedAccountLink, error)
	DeleteAccountLinkInvitation(linkID string) (*storedAccountLink, error)
	GetAccountLink(linkID string) (*storedAccountLink, error)
	ListAccountLinks(
		statusFilter string,
		maxResults int32,
		nextToken string,
	) ([]*storedAccountLink, string, error)

	// Applications
	AssociateWorkspaceApplication(workspaceID, applicationID string) error
	DisassociateWorkspaceApplication(workspaceID, applicationID string) error
	DeployWorkspaceApplications(workspaceID string, force bool) ([]map[string]string, error)
	DescribeWorkspaceAssociations(
		workspaceID string,
		associatedResourceTypes []string,
	) ([]map[string]string, error)
	DescribeApplicationAssociations(
		applicationID string, associatedResourceTypes []string, maxResults int32, nextToken string,
	) ([]map[string]string, string, error)
	DescribeApplications(
		appIDs []string,
		maxResults int32,
		nextToken string,
	) ([]*storedApplication, string, error)

	// Workspace-level ops
	MigrateWorkspace(sourceWorkspaceID, bundleID string) (sourceID, targetID string, err error)
	RestoreWorkspace(workspaceID string) error
	CreateStandbyWorkspaces(
		primaryRegion string,
		standby []map[string]string,
	) ([]map[string]string, []map[string]string, error)

	AccountID() string
	Region() string
	Reset()
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend is the interface for WorkSpaces storage operations.

type Workspace

type Workspace struct {
	Properties                  *WorkspaceProperties
	Tags                        map[string]string
	WorkspaceID                 string
	DirectoryID                 string
	UserName                    string
	BundleID                    string
	State                       string
	ComputerName                string
	SubnetID                    string
	VolumeEncryptionKey         string
	ErrorCode                   string
	ErrorMessage                string
	UserVolumeEncryptionEnabled bool
	RootVolumeEncryptionEnabled bool
}

Workspace holds full WorkSpace details.

type WorkspaceBundle

type WorkspaceBundle struct {
	ComputeType BundleComputeType
	BundleID    string
	Name        string
	Owner       string
	Description string
	ImageID     string
	UserStorage BundleStorage
	RootStorage BundleStorage
}

WorkspaceBundle holds WorkSpace bundle details.

type WorkspaceConnectionStatus

type WorkspaceConnectionStatus struct {
	LastKnownUserTime time.Time
	WorkspaceID       string
	ConnectionState   string
}

WorkspaceConnectionStatus holds connection status for a WorkSpace.

type WorkspaceCreationSpec

type WorkspaceCreationSpec struct {
	Properties                  *WorkspaceProperties
	Tags                        map[string]string
	UserName                    string
	DirectoryID                 string
	BundleID                    string
	SubnetID                    string
	VolumeEncryptionKey         string
	UserVolumeEncryptionEnabled bool
	RootVolumeEncryptionEnabled bool
}

WorkspaceCreationSpec holds all fields for creating a workspace.

type WorkspaceDirectory

type WorkspaceDirectory struct {
	DirectoryID   string
	DirectoryName string
	DirectoryType string
	Alias         string
	State         string
	SubnetIDs     []string
}

WorkspaceDirectory holds WorkSpace directory details.

type WorkspaceProperties

type WorkspaceProperties struct {
	ComputeTypeName                     string `json:"ComputeTypeName,omitempty"`
	RunningMode                         string `json:"RunningMode,omitempty"`
	RootVolumeSizeGib                   int32  `json:"RootVolumeSizeGib,omitempty"`
	RunningModeAutoStopTimeoutInMinutes int32  `json:"RunningModeAutoStopTimeoutInMinutes,omitempty"`
	UserVolumeSizeGib                   int32  `json:"UserVolumeSizeGib,omitempty"`
}

WorkspaceProperties holds mutable WorkSpace properties.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL