workspaces

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 29 Imported by: 0

README

WorkSpaces

Parity grade: A · SDK aws-sdk-go-v2/service/workspaces@v1.79.0 · last audited 2026-08-28 (7c8077891728)

Coverage

Metric Value
PARITY entries audited 34 (33 ok, 1 deferred)
Feature families 14 (14 ok)
Known gaps 6
Deferred items 0
Resource leaks clean
Known gaps
  • RegisterWorkspaceDirectory accepts EnableSelfService but does not apply it: mapping the one bool onto the five SelfservicePermissions members needs AWS's actual mapping, which is unverified.
  • RegisterWorkspaceDirectory's WorkspaceType/Tenancy/UserIdentityType defaults (PERSONAL, SHARED, and AWS_DIRECTORY_SERVICE / CUSTOMER_MANAGED when ActiveDirectoryConfig is set / AWS_IAM_IDENTITY_CENTER when IdcInstanceArn is set) are inferred from the SDK enum docs, not verified against live AWS. IDCConfig.ApplicationArn is not modeled.
  • DirectoryType is derived for SimpleAD, ADConnector and IAM Identity Center only; MicrosoftAD/SharedMicrosoftAD leave it empty because AWS does not document which Directory Service type maps to CUSTOMER_MANAGED.
  • DescribeApplications' Owner/ComputeTypeNames/LicenseType/OperatingSystemNames filters and ImportWorkspaceImage.Applications are not applied: the application catalog (b.applications) has no create path, so there is nothing to filter or associate.
  • Accept/Reject/DeleteAccountLinkInvitation ClientToken is not read: repeating the same call is already idempotent here, and AWS's behaviour for a repeated Reject/Delete with a new token is unverified.
  • WorkspacesPool.ApplicationSettings.S3BucketName is not returned: AWS provisions the settings bucket, which this backend does not model.

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 AccountModification added in v1.2.0

type AccountModification struct {
	StartTime                           time.Time
	ModificationState                   string
	DedicatedTenancySupport             string
	DedicatedTenancyManagementCidrRange string
}

AccountModification records one completed change to the account's BYOL (Bring Your Own License) configuration, matching the real AccountModification SDK type (ErrorCode/ErrorMessage are omitted here: ModifyAccount in this backend always succeeds once it validates, so no failure path populates them).

type ApplicationResourceAssociation added in v1.3.1

type ApplicationResourceAssociation struct {
	Created                time.Time
	LastUpdatedTime        time.Time
	AssociatedResourceID   string
	AssociatedResourceType string
	ApplicationID          string
	State                  string
}

ApplicationResourceAssociation describes an association between an application and the resource it is associated with (a WorkSpace), matching the real ApplicationResourceAssociation SDK type. Unlike WorkspaceResourceAssociation, the identifying field here is ApplicationId, not WorkspaceId -- the wire shape describes the operation "from the application's side".

type BundleComputeType

type BundleComputeType struct {
	Name string
}

BundleComputeType holds the compute type name for a bundle.

type BundleResourceAssociation added in v1.2.0

type BundleResourceAssociation struct {
	Created                 time.Time
	LastUpdatedTime         time.Time
	AssociatedResourceID    string
	AssociatedResourceType  string
	BundleID                string
	State                   string
	StateReasonErrorCode    string
	StateReasonErrorMessage string
}

BundleResourceAssociation describes an application association for a bundle, matching the real BundleResourceAssociation SDK type. See ImageResourceAssociation -- same "always empty in this emulator" rationale.

type BundleStorage

type BundleStorage struct {
	Capacity int32
}

BundleStorage holds storage capacity for a bundle.

type CertificateBasedAuthProperties

type CertificateBasedAuthProperties struct {
	Status                  string
	CertificateAuthorityArn string
}

CertificateBasedAuthProperties mirrors types.CertificateBasedAuthProperties.

type DataReplicationSettings added in v1.3.4

type DataReplicationSettings struct {
	RecoverySnapshotTime *time.Time `json:"RecoverySnapshotTime,omitempty"`
	DataReplication      string     `json:"DataReplication,omitempty"`
}

DataReplicationSettings holds data replication settings.

type DirectoryActiveDirectoryConfig

type DirectoryActiveDirectoryConfig struct {
	DomainName              string
	ServiceAccountSecretArn string
}

DirectoryActiveDirectoryConfig mirrors types.ActiveDirectoryConfig.

type DirectoryFilter

type DirectoryFilter struct {
	Name   string
	Values []string
}

DirectoryFilter mirrors types.DescribeWorkspaceDirectoriesFilter.

type DirectoryIDCConfig

type DirectoryIDCConfig struct {
	InstanceArn string
}

DirectoryIDCConfig mirrors types.IDCConfig; ApplicationArn is not modeled.

type DirectoryMicrosoftEntraConfig

type DirectoryMicrosoftEntraConfig struct {
	ApplicationConfigSecretArn string
	TenantID                   string
}

DirectoryMicrosoftEntraConfig mirrors types.MicrosoftEntraConfig.

type DirectoryRegistration

type DirectoryRegistration struct {
	Tags                          map[string]string
	ActiveDirectoryConfig         *DirectoryActiveDirectoryConfig
	MicrosoftEntraConfig          *DirectoryMicrosoftEntraConfig
	DirectoryID                   string
	IdcInstanceArn                string
	Tenancy                       string
	UserIdentityType              string
	WorkspaceType                 string
	WorkspaceDirectoryName        string
	WorkspaceDirectoryDescription string
	SubnetIDs                     []string
}

DirectoryRegistration carries the RegisterWorkspaceDirectoryInput members.

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) BackendFor

func (h *Handler) BackendFor(region string) StorageBackend

BackendFor returns the backend serving region: the home backend, or the sibling built on first use.

func (*Handler) EnableRegions

func (h *Handler) EnableRegions()

EnableRegions makes h serve every other region through lazily built per-region siblings.

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 serves each request from the handler of its region.

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) RegionBackends

func (h *Handler) RegionBackends() []StorageBackend

RegionBackends returns the home backend followed by every sibling built so far.

func (*Handler) RegionHandler

func (h *Handler) RegionHandler(region string) *Handler

RegionHandler returns the handler serving region: h itself for the home region, else its sibling.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears every region.

func (*Handler) Restore

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

Restore implements persistence.Persistable.

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; other regions ride in an additive "regions" key.

type ImagePermission

type ImagePermission struct {
	SharedAccountID string
	AllowCopyImage  bool
}

ImagePermission is one shared-account entry from DescribeWorkspaceImagePermissions.

type ImageResourceAssociation added in v1.2.0

type ImageResourceAssociation struct {
	Created                 time.Time
	LastUpdatedTime         time.Time
	AssociatedResourceID    string
	AssociatedResourceType  string
	ImageID                 string
	State                   string
	StateReasonErrorCode    string
	StateReasonErrorMessage string
}

ImageResourceAssociation describes an application association for an image, matching the real ImageResourceAssociation SDK type. A freshly emulated account always returns an empty list from DescribeImageAssociations since there is no public API to create this kind of association (see DescribeImageAssociations doc comment in images.go) -- this type exists so the wire shape is correct if that ever changes.

type ImageSource added in v1.3.1

type ImageSource struct {
	Ec2ImageID           string `json:"ec2ImageId,omitempty"`
	Ec2ImportTaskID      string `json:"ec2ImportTaskId,omitempty"`
	ImageBuildVersionArn string `json:"imageBuildVersionArn,omitempty"`
}

ImageSource models the ImageSourceIdentifier tagged union (workspaces@v1.73.1 types.go:739-770): exactly one field is populated, mirroring whichever member the caller supplied on ImportCustomWorkspaceImage.

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,
) (WorkspaceResourceAssociation, error)

AssociateWorkspaceApplication associates an application with a workspace.

ApplicationId is intentionally not validated against a real catalog: real AWS's WorkSpaces Application Manager applications come from a read-only AWS/partner catalog with no public API to create one, and this backend never seeds b.applications, so requiring a match would make every call to this operation permanently fail -- see DescribeApplications, which has the same "always empty" catalog for the same reason.

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, sourceRegion, description string,
	tags map[string]string,
) (string, error)

CopyWorkspaceImage copies an image. SourceImageId is checked against b.images only when sourceRegion is empty or equals this backend's own region: this service instantiates one InMemoryBackend per (account, region) (see NewInMemoryBackend/provider.go), and storedImage carries no region field, so a genuine cross-region copy's source image legitimately lives in a different backend instance this one cannot see -- rejecting it would be more restrictive than real AWS. ResourceNotFoundException is in this operation's error list (aws-sdk-go-v2/service/workspaces@v1.73.1 deserializers.go's awsAwsjson11_deserializeOpErrorCopyWorkspaceImage).

func (*InMemoryBackend) CreateAccountLinkInvitation

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

CreateAccountLinkInvitation creates an account link invitation.

func (*InMemoryBackend) CreateAccountLinkInvitationWithToken

func (b *InMemoryBackend) CreateAccountLinkInvitationWithToken(
	targetAccountID, clientToken string,
) (*storedAccountLink, error)

CreateAccountLinkInvitationWithToken is CreateAccountLinkInvitation honouring ClientToken: a live token replays the link it created.

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) CreateStandbyWorkspace added in v1.2.0

func (b *InMemoryBackend) CreateStandbyWorkspace(
	ctx context.Context, spec StandbyWorkspaceSpec,
) (*PendingStandbyWorkspace, error)

CreateStandbyWorkspace creates a single standby WorkSpace and returns it in PENDING state. Returns InvalidParameterValuesException when spec.DirectoryID is not registered, and ResourceNotFoundException when spec.PrimaryWorkspaceID does not resolve to a WorkSpace in this backend -- both per-item runtime failures the handler reports via FailedStandbyRequests, matching the same pattern as CreateWorkspace's DirectoryID check. The real StandbyWorkspace request shape carries no UserName/BundleId (see StandbyWorkspaceSpec); the created record has no way to inherit them from the primary, and PendingCreateStandbyWorkspacesRequest's real shape doesn't surface BundleId at all, so its UserName is left empty for the same reason.

This emulator runs a single backend instance per service, so unlike real AWS (where the primary WorkSpace genuinely lives in a separate region's backend), the primary is looked up in this same b.workspaces table and its RelatedWorkspaces/StandbyWorkspacesProperties are updated with the new standby -- the only way this backend can truthfully round-trip the relationship DescribeWorkspaces must report on both sides.

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. Returns errImageNotFound for a SourceImageId that doesn't reference a real image, matching real AWS (ResourceNotFoundException is in this operation's error list; see deserializers.go's awsAwsjson11_deserializeOpErrorCreateUpdatedWorkspaceImage).

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 or spec.Properties.RunningMode is set to an unrecognized value. A RunningMode left unset defaults to ALWAYS_ON, matching CreateWorkspacesPool's precedent for an omitted RunningMode (pools.go's poolsRunningModeAlwaysOn) -- the pinned SDK's WorkspaceProperties.RunningMode doc comment doesn't state a default.

func (*InMemoryBackend) CreateWorkspaceBundle

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

CreateWorkspaceBundle creates a custom bundle. Returns errImageNotFound for an ImageId that doesn't reference a real image, matching real AWS (ResourceNotFoundException is in this operation's error list; see deserializers.go's awsAwsjson11_deserializeOpErrorCreateWorkspaceBundle).

func (*InMemoryBackend) CreateWorkspaceImage

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

CreateWorkspaceImage creates an image from a workspace. Returns ErrWorkspaceNotFound for a WorkspaceId that doesn't reference a real workspace, matching real AWS (ResourceNotFoundException is in this operation's error list; see deserializers.go's awsAwsjson11_deserializeOpErrorCreateWorkspaceImage). The real CreateWorkspaceImageOutput and WorkspaceImage type carry no source workspace reference, so there is nothing to derive from the workspace beyond confirming it exists.

func (*InMemoryBackend) CreateWorkspacesPool

func (b *InMemoryBackend) CreateWorkspacesPool(
	poolName, bundleID, directoryID, description, runningMode string,
	desiredUserSessions int32,
	tags map[string]string,
	settings PoolSettings,
) (*storedPool, error)

CreateWorkspacesPool creates a new workspace pool.

func (*InMemoryBackend) DeleteAccountLinkInvitation

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

DeleteAccountLinkInvitation deletes a pending account link invitation. "DELETED" is not a member of the real AccountLinkStatusEnum, so the returned AccountLink keeps whatever status it already had (this backend only reaches this op while a link is still PENDING_ACCEPTANCE_BY_TARGET_ACCOUNT) rather than fabricating one.

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. Returns errConnAliasInUse when the alias is still shared with an account or associated with a directory: "You can delete a connection alias only after it is no longer shared with any accounts or associated with any directories" (api_op_DeleteConnectionAlias.go doc comment).

func (*InMemoryBackend) DeleteIPGroup

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

DeleteIPGroup removes an IP group by ID. Real AWS: "You cannot delete an IP access control group that is associated with a directory".

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. Returns errBundleInUse when a WorkSpace still references the bundle (ResourceAssociatedException is modelled for this operation).

func (*InMemoryBackend) DeleteWorkspaceImage

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

DeleteWorkspaceImage removes an image. Returns errImageInUse when a bundle still references the image: "To delete an image, you must first delete any bundles that are associated with the image" (api_op_DeleteWorkspaceImage.go doc comment).

func (*InMemoryBackend) DeployWorkspaceApplications

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

DeployWorkspaceApplications deploys the applications currently associated with a WorkSpace. This backend has no pending-install queue -- Associate already leaves every association COMPLETED -- so Deploy's real work here is validating the WorkSpace exists and reporting its current associations.

func (*InMemoryBackend) DeregisterWorkspaceDirectory

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

DeregisterWorkspaceDirectory deregisters a directory. Returns InvalidResourceStateException when any WorkSpaces are still registered to the directory, matching real AWS: "If any WorkSpaces are registered to this directory, you must remove them before you can deregister the directory" -- this backend never auto-cascade-deletes WorkSpaces on deregister, since real AWS doesn't either.

func (*InMemoryBackend) DescribeAccount

func (b *InMemoryBackend) DescribeAccount() storedAccountConfig

DescribeAccount returns account configuration.

func (*InMemoryBackend) DescribeAccountModifications added in v1.2.0

func (b *InMemoryBackend) DescribeAccountModifications(
	nextToken string,
) ([]AccountModification, string, error)

DescribeAccountModifications returns the history of BYOL configuration changes recorded by ModifyAccount, most recent first (matching real AWS ordering), paginated. The real DescribeAccountModificationsInput has no MaxResults field (only NextToken), unlike most other paginated ops in this service -- so this backend applies its own fixed internal page size.

func (*InMemoryBackend) DescribeApplicationAssociations

func (b *InMemoryBackend) DescribeApplicationAssociations(
	applicationID string, associatedResourceTypes []string, maxResults int32, nextToken string,
) ([]ApplicationResourceAssociation, string, error)

DescribeApplicationAssociations returns workspace associations for an application.

ApplicationId is not validated for existence, matching AssociateWorkspaceApplication: the applications catalog is never populated in this backend, so requiring a match would make this operation permanently return zero results even for associations it created itself.

func (*InMemoryBackend) DescribeApplications

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

DescribeApplications returns stored applications, filtered by IDs.

func (*InMemoryBackend) DescribeBundleAssociations added in v1.2.0

func (b *InMemoryBackend) DescribeBundleAssociations(
	bundleID string, resourceTypes []string,
) ([]BundleResourceAssociation, error)

DescribeBundleAssociations returns application associations for a bundle. See DescribeImageAssociations in images.go: real AWS exposes no public API to create a bundle<->application association, so a freshly emulated account always has an empty list. This still performs the real required-field and existence validation a live call would enforce.

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, maxResults int32, nextToken string,
) ([]*storedConnectAddIn, string, error)

DescribeConnectClientAddIns returns add-ins for a resource.

func (*InMemoryBackend) DescribeConnectionAliasPermissions

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

DescribeConnectionAliasPermissions returns a page of shared-account permissions for an alias, in the order they were granted.

func (*InMemoryBackend) DescribeConnectionAliases

func (b *InMemoryBackend) DescribeConnectionAliases(
	aliasIDs []string, resourceID string, limit int32, nextToken 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) DescribeImageAssociations added in v1.2.0

func (b *InMemoryBackend) DescribeImageAssociations(
	imageID string, resourceTypes []string,
) ([]ImageResourceAssociation, error)

DescribeImageAssociations returns application associations for an image. Real AWS's WorkSpaces Application Manager exposes no public API to create an image<->application association (only AssociateWorkspaceApplication, which associates an application directly with a WorkSpace, and DeployWorkspaceApplications, neither of which touch an image or bundle) -- so a freshly emulated account always has an empty association list. This still performs the real required-field and existence validation a live call would enforce, matching the pattern used by RestoreWorkspace for an otherwise-no-op operation.

func (*InMemoryBackend) DescribeIpGroups

func (b *InMemoryBackend) DescribeIpGroups(
	groupIDs []string, maxResults int32, nextToken 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,
	associatedResourceTypes []string,
) ([]WorkspaceResourceAssociation, 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 lists bundles: owner AMAZON gives AWS bundles, anything else the account's custom ones, and bundleIDs match either kind. Sorted by BundleID, 25 per page.

func (*InMemoryBackend) DescribeWorkspaceDirectories

func (b *InMemoryBackend) DescribeWorkspaceDirectories(
	ctx context.Context,
	directoryIDs []string, directoryNames []string, limit int32, 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) DescribeWorkspaceDirectoriesFiltered

func (b *InMemoryBackend) DescribeWorkspaceDirectoriesFiltered(
	_ context.Context,
	directoryIDs []string, directoryNames []string, filters []DirectoryFilter, limit int32, nextToken string,
) ([]*WorkspaceDirectory, string, error)

DescribeWorkspaceDirectoriesFiltered is DescribeWorkspaceDirectories plus the USER_IDENTITY_TYPE / WORKSPACE_TYPE filters (ANDed; values within one filter are ORed).

func (*InMemoryBackend) DescribeWorkspaceImagePermissions

func (b *InMemoryBackend) DescribeWorkspaceImagePermissions(
	imageID, token string, limit int,
) (string, page.Page[ImagePermission], error)

DescribeWorkspaceImagePermissions returns a page of sharing permissions for an image, sorted by account ID for a stable pagination order.

func (*InMemoryBackend) DescribeWorkspaceImages

func (b *InMemoryBackend) DescribeWorkspaceImages(
	imageIDs []string, _ string, maxResults int32, nextToken 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) DescribeWorkspacesFiltered

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

DescribeWorkspacesFiltered is DescribeWorkspaces plus the user-decoupled WorkspaceName filter (empty means no name filter).

func (*InMemoryBackend) DescribeWorkspacesPoolSessions

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

DescribeWorkspacesPoolSessions returns sessions for a pool.

func (*InMemoryBackend) DescribeWorkspacesPools

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

DescribeWorkspacesPools returns pools, optionally filtered by IDs.

func (*InMemoryBackend) DescribeWorkspacesPoolsFiltered

func (b *InMemoryBackend) DescribeWorkspacesPoolsFiltered(
	poolIDs []string, filters []PoolFilter, limit int32, nextToken string,
) ([]*storedPool, string, error)

DescribeWorkspacesPoolsFiltered is DescribeWorkspacesPools narrowed by PoolName filter conditions.

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,
) (WorkspaceResourceAssociation, error)

DisassociateWorkspaceApplication removes an application association from a workspace, returning the resulting REMOVED association. Created/ LastUpdatedTime are left zero-valued on the returned value: once removed, this backend no longer tracks when the association was originally made, and fabricating a timestamp would be dishonest.

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

GetAccountLink retrieves an account link by ID.

func (*InMemoryBackend) GetAccountLinkBy

func (b *InMemoryBackend) GetAccountLinkBy(linkID, linkedAccountID string) (*storedAccountLink, error)

GetAccountLinkBy looks a link up by LinkId or, when that is empty, by the LinkedAccountId of its other party. Exactly one of the two is required.

func (*InMemoryBackend) GetWorkspacesConnectionStatus

func (b *InMemoryBackend) GetWorkspacesConnectionStatus(
	workspaceIDs []string, nextToken string,
) ([]*WorkspaceConnectionStatus, string, 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, spec customWorkspaceImageImportSpec,
) (*storedImage, error)

ImportCustomWorkspaceImage imports a custom workspace image.

func (*InMemoryBackend) ImportWorkspaceImage

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

ImportWorkspaceImage imports an EC2 image as a workspace image. IngestionProcess is required on the real ImportWorkspaceImageInput (workspaces@v1.73.1 api_op_ImportWorkspaceImage.go:67).

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

ListAccountLinks returns account links, optionally filtered by status.

func (*InMemoryBackend) ListAvailableManagementCidrRanges added in v1.2.0

func (b *InMemoryBackend) ListAvailableManagementCidrRanges(
	constraint string, maxResults int32, nextToken string,
) ([]string, string, error)

ListAvailableManagementCidrRanges returns candidate BYOL management network CIDR ranges contained within constraint, paginated. ManagementCidrRangeConstraint is a required field on the real API (smithy `required` trait) and must be a syntactically valid IPv4 CIDR block; both are validated here.

func (*InMemoryBackend) MigrateWorkspace

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

MigrateWorkspace migrates a workspace to a new bundle.

func (*InMemoryBackend) ModifyAccount

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

ModifyAccount updates account configuration and records the change as a completed AccountModification, matching real AWS's DescribeAccountModifications (which surfaces the history of BYOL configuration changes). This backend applies the change synchronously, so ModificationState is always COMPLETED -- there is no PENDING window to model.

func (*InMemoryBackend) ModifyCertificateBasedAuthProperties

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

ModifyCertificateBasedAuthProperties stores certificate auth properties for a registered directory. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifyClientProperties

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

ModifyClientProperties merges the supplied client properties into a resource's stored properties. Each of clientExperiencePolicy, logUploadEnabled, reconnectEnabled is nil when the caller omitted it from the request, in which case the previously stored value (if any) is left untouched rather than cleared -- matching real ModifyClientProperties, which is a partial update, not a full replace.

func (*InMemoryBackend) ModifyEndpointEncryptionMode

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

ModifyEndpointEncryptionMode stores the endpoint encryption mode for a registered directory. Returns errDirectoryNotFound for a DirectoryId that was never registered, matching real AWS (ResourceNotFoundException is in this operation's error list).

func (*InMemoryBackend) ModifySamlProperties

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

ModifySamlProperties stores SAML properties for a registered directory and clears the members named in propertiesToDelete. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifySelfservicePermissions

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

ModifySelfservicePermissions stores self-service permissions for a registered directory. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifyStreamingProperties

func (b *InMemoryBackend) ModifyStreamingProperties(directoryID string, props StreamingProperties) error

ModifyStreamingProperties merges streaming properties into a registered directory: set members replace, unset members keep their stored value.

func (*InMemoryBackend) ModifyWorkspaceAccessProperties

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

ModifyWorkspaceAccessProperties stores workspace access properties for a registered directory. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifyWorkspaceCreationProperties

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

ModifyWorkspaceCreationProperties stores workspace creation properties for a registered directory. Returns errDirectoryNotFound for a DirectoryId that was never registered, matching real AWS (ResourceNotFoundException is in this operation's error list).

func (*InMemoryBackend) ModifyWorkspaceDataReplication

func (b *InMemoryBackend) ModifyWorkspaceDataReplication(workspaceID, mode string) error

ModifyWorkspaceDataReplication sets the workspace's DataReplication mode.

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 or a workspace whose state doesn't support rebooting.

func (*InMemoryBackend) RebuildWorkspaces

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

RebuildWorkspaces rebuilds the given workspaces, returning failures for unknown IDs or a workspace whose state doesn't support rebuilding.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the region.

func (*InMemoryBackend) RegisterWorkspaceDirectory

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

RegisterWorkspaceDirectory registers a directory and stores subnet IDs. Returns ResourceAlreadyExistsException when the directory is already registered, matching real AWS: you cannot re-register an already-registered directory.

requestedName is the RegisterWorkspaceDirectoryInput.WorkspaceDirectoryName the caller supplied, if any. It is only used as a DirectoryName fallback when the Directory Service backend isn't wired or the directory can't be found there -- see resolveDirectoryInfo.

func (*InMemoryBackend) RegisterWorkspaceDirectoryWithConfig

func (b *InMemoryBackend) RegisterWorkspaceDirectoryWithConfig(reg DirectoryRegistration) (string, error)

RegisterWorkspaceDirectoryWithConfig registers a directory with the full input member set and returns its DirectoryId, generated for IAM Identity Center / Entra registrations that omit one.

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) SetAppConfig

func (b *InMemoryBackend) SetAppConfig(cfg any)

SetAppConfig records the service.AppContext.Config value Provider.Init received, so this backend can resolve the Directory Service backend on demand -- see services/grafana/cross_service.go's SetAppConfig doc comment for why this must happen lazily rather than at Init time.

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. Returns a per-item failure for unknown IDs or a workspace whose state or running mode doesn't support starting.

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. Returns a per-item failure for unknown IDs or a workspace whose state or running mode doesn't support stopping.

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. Returns errImageNotFound for an ImageId that doesn't reference a real image, matching real AWS (ResourceNotFoundException is in this operation's error list, and UpdateWorkspaceBundleInput.ImageId is optional, so an empty value is a no-op rather than a validation failure).

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, runningMode string,
	desiredUserSessions int32,
	settings PoolSettings,
) (*storedPool, error)

UpdateWorkspacesPool updates pool fields. Fields left at their zero value (empty string / zero int) are left unchanged, matching the real API's "only specified fields are updated" partial-update semantics.

type ModificationState added in v1.3.4

type ModificationState struct {
	Resource string `json:"Resource,omitempty"`
	State    string `json:"State,omitempty"`
}

ModificationState holds modification state of a workspace.

type PendingStandbyWorkspace added in v1.2.0

type PendingStandbyWorkspace struct {
	WorkspaceID string
	DirectoryID string
	State       string
}

PendingStandbyWorkspace holds the identity of a newly created standby WorkSpace, matching the real PendingCreateStandbyWorkspacesRequest shape.

type PoolApplicationSettings

type PoolApplicationSettings struct {
	Status        string `json:"Status"`
	SettingsGroup string `json:"SettingsGroup,omitempty"`
}

PoolApplicationSettings mirrors types.ApplicationSettingsRequest.

type PoolFilter

type PoolFilter struct {
	Name     string
	Operator string
	Values   []string
}

PoolFilter is one DescribeWorkspacesPools filter condition.

type PoolSettings

type PoolSettings struct {
	ApplicationSettings *PoolApplicationSettings
	TimeoutSettings     *PoolTimeoutSettings
}

PoolSettings groups the optional pool members accepted by Create/UpdateWorkspacesPool.

type PoolTimeoutSettings

type PoolTimeoutSettings struct {
	DisconnectTimeoutInSeconds     *int32 `json:"DisconnectTimeoutInSeconds,omitempty"`
	IdleDisconnectTimeoutInSeconds *int32 `json:"IdleDisconnectTimeoutInSeconds,omitempty"`
	MaxUserDurationInSeconds       *int32 `json:"MaxUserDurationInSeconds,omitempty"`
}

PoolTimeoutSettings mirrors types.TimeoutSettings.

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 RelatedWorkspace added in v1.3.4

type RelatedWorkspace struct {
	Region      string `json:"Region,omitempty"`
	State       string `json:"State,omitempty"`
	Type        string `json:"Type,omitempty"`
	WorkspaceID string `json:"WorkspaceId,omitempty"`
}

RelatedWorkspace holds related workspace information.

type SamlProperties

type SamlProperties struct {
	Status                  string
	UserAccessUrl           string //nolint:revive,staticcheck // matches real SDK field name
	RelayStateParameterName string
}

SamlProperties mirrors types.SamlProperties.

type SelfservicePermissions

type SelfservicePermissions struct {
	RestartWorkspace   string
	IncreaseVolumeSize string
	ChangeComputeType  string
	SwitchRunningMode  string
	RebuildWorkspace   string
}

SelfservicePermissions mirrors types.SelfservicePermissions.

type StandbyWorkspaceProperties added in v1.3.4

type StandbyWorkspaceProperties struct {
	RecoverySnapshotTime *time.Time `json:"RecoverySnapshotTime,omitempty"`
	StandbyWorkspaceID   string     `json:"StandbyWorkspaceId,omitempty"`
	DataReplication      string     `json:"DataReplication,omitempty"`
}

StandbyWorkspaceProperties holds standby workspace properties.

type StandbyWorkspaceSpec added in v1.2.0

type StandbyWorkspaceSpec struct {
	Tags                map[string]string
	DirectoryID         string
	PrimaryWorkspaceID  string
	PrimaryRegion       string
	DataReplication     string
	VolumeEncryptionKey string
}

StandbyWorkspaceSpec holds the fields for creating a single standby WorkSpace, matching the real StandbyWorkspace request shape (DirectoryId, PrimaryWorkspaceId, DataReplication, Tags, VolumeEncryptionKey -- no UserName/BundleId, unlike WorkspaceCreationSpec). PrimaryRegion is not a StandbyWorkspace member -- it's CreateStandbyWorkspacesInput's batch-level required field (api_op_CreateStandbyWorkspaces.go:29-33), applied uniformly to every item in the request.

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)
	DescribeWorkspacesFiltered(
		ctx context.Context,
		workspaceIDs, directoryID, userID, bundleID []string,
		workspaceName string,
		limit int32, nextToken string,
	) ([]*Workspace, string, error)
	GetWorkspacesConnectionStatus(
		workspaceIDs []string, nextToken string,
	) ([]*WorkspaceConnectionStatus, string, error)
	ModifyWorkspaceProperties(workspaceID string, props WorkspaceProperties) error
	ModifyWorkspaceDataReplication(workspaceID, mode string) 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,
		directoryNames []string,
		limit int32,
		nextToken string,
	) ([]*WorkspaceDirectory, string, error)
	DescribeWorkspaceDirectoriesFiltered(
		ctx context.Context,
		directoryIDs []string,
		directoryNames []string,
		filters []DirectoryFilter,
		limit int32,
		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,
		userStorageGiB, rootStorageGiB int32,
		tags map[string]string,
	) (*storedCustomBundle, error)
	DeleteWorkspaceBundle(bundleID string) error
	UpdateWorkspaceBundle(bundleID, imageID string) error
	DescribeBundleAssociations(
		bundleID string, resourceTypes []string,
	) ([]BundleResourceAssociation, 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, ingestionProcess string,
		tags map[string]string,
	) (string, error)
	ImportCustomWorkspaceImage(
		name, description string, spec customWorkspaceImageImportSpec,
	) (*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, nextToken string, maxResults int,
	) (string, page.Page[ImagePermission], error)
	UpdateWorkspaceImagePermission(imageID, sharedAccountID string, allowCopy bool) error
	DescribeCustomWorkspaceImageImport(imageID string) (*storedImage, error)
	DescribeImageAssociations(
		imageID string, resourceTypes []string,
	) ([]ImageResourceAssociation, error)

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

	// Directories
	RegisterWorkspaceDirectory(
		directoryID string, subnetIDs []string, tags map[string]string, requestedName string,
	) error
	RegisterWorkspaceDirectoryWithConfig(reg DirectoryRegistration) (string, error)
	DeregisterWorkspaceDirectory(directoryID string) error

	// Account
	DescribeAccount() storedAccountConfig
	ModifyAccount(dedicatedTenancyCidr, dedicatedTenancySupport string) error
	ModifyEndpointEncryptionMode(directoryID, mode string) error
	DescribeAccountModifications(
		nextToken string,
	) ([]AccountModification, string, error)
	ListAvailableManagementCidrRanges(
		constraint string, maxResults int32, nextToken string,
	) ([]string, 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 string, clientExperiencePolicy, logUploadEnabled, reconnectEnabled *string) error

	// Directory modify ops
	ModifyCertificateBasedAuthProperties(directoryID string, props map[string]string, propertiesToDelete []string) error
	ModifySamlProperties(directoryID string, props map[string]string, propertiesToDelete []string) error
	ModifySelfservicePermissions(directoryID string, props map[string]string) error
	ModifyStreamingProperties(directoryID string, props StreamingProperties) 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)
	GetAccountLinkBy(linkID, linkedAccountID string) (*storedAccountLink, error)
	CreateAccountLinkInvitationWithToken(targetAccountID, clientToken string) (*storedAccountLink, error)
	ListAccountLinks(
		statusFilter string,
		maxResults int32,
		nextToken string,
	) ([]*storedAccountLink, string, error)

	// Applications
	AssociateWorkspaceApplication(
		workspaceID, applicationID string,
	) (WorkspaceResourceAssociation, error)
	DisassociateWorkspaceApplication(
		workspaceID, applicationID string,
	) (WorkspaceResourceAssociation, error)
	DeployWorkspaceApplications(
		workspaceID string, force bool,
	) ([]WorkspaceResourceAssociation, error)
	DescribeWorkspaceAssociations(
		workspaceID string,
		associatedResourceTypes []string,
	) ([]WorkspaceResourceAssociation, error)
	DescribeApplicationAssociations(
		applicationID string, associatedResourceTypes []string, maxResults int32, nextToken string,
	) ([]ApplicationResourceAssociation, 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
	CreateStandbyWorkspace(
		ctx context.Context, spec StandbyWorkspaceSpec,
	) (*PendingStandbyWorkspace, 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 StreamingAccelerator

type StreamingAccelerator struct {
	Mode              string `json:"Mode"`
	PreferredProtocol string `json:"PreferredProtocol,omitempty"`
}

StreamingAccelerator mirrors types.GlobalAcceleratorForDirectory.

type StreamingConnector

type StreamingConnector struct {
	ConnectorType string `json:"ConnectorType"`
	Status        string `json:"Status"`
}

StreamingConnector mirrors types.StorageConnector.

type StreamingProperties

type StreamingProperties struct {
	GlobalAccelerator                    *StreamingAccelerator  `json:"GlobalAccelerator,omitempty"`
	StreamingExperiencePreferredProtocol string                 `json:"StreamingExperiencePreferredProtocol,omitempty"`
	UserSettings                         []StreamingUserSetting `json:"UserSettings,omitempty"`
	StorageConnectors                    []StreamingConnector   `json:"StorageConnectors,omitempty"`
}

StreamingProperties mirrors types.StreamingProperties; the JSON tags are the wire keys.

type StreamingUserSetting

type StreamingUserSetting struct {
	MaximumLength *int32 `json:"MaximumLength,omitempty"`
	Action        string `json:"Action"`
	Permission    string `json:"Permission"`
}

StreamingUserSetting mirrors types.UserSetting.

type Workspace

type Workspace struct {
	Properties                  *WorkspaceProperties
	Tags                        map[string]string
	DataReplicationSettings     *DataReplicationSettings
	VolumeEncryptionKey         string
	State                       string
	ErrorMessage                string
	WorkspaceID                 string
	WorkspaceName               string
	DirectoryID                 string
	UserName                    string
	IPAddress                   string
	BundleID                    string
	ErrorCode                   string
	ComputerName                string
	SubnetID                    string
	StandbyWorkspacesProperties []StandbyWorkspaceProperties
	RelatedWorkspaces           []RelatedWorkspace
	ModificationStates          []ModificationState
	UserVolumeEncryptionEnabled bool
	RootVolumeEncryptionEnabled bool
}

Workspace holds full WorkSpace details.

type WorkspaceAccessProperties

type WorkspaceAccessProperties struct {
	DeviceTypeWindows    string
	DeviceTypeOsx        string
	DeviceTypeWeb        string
	DeviceTypeIos        string
	DeviceTypeAndroid    string
	DeviceTypeChromeOs   string
	DeviceTypeZeroClient string
	DeviceTypeLinux      string
}

WorkspaceAccessProperties mirrors types.WorkspaceAccessProperties (device type members only -- AccessEndpointConfig is not modeled by ModifyWorkspaceAccessProperties's handler and stays omitted).

type WorkspaceBundle

type WorkspaceBundle struct {
	CreationTime    time.Time
	LastUpdatedTime time.Time
	ComputeType     BundleComputeType
	BundleType      string
	State           string
	BundleID        string
	Name            string
	Owner           string
	Description     string
	ImageID         string
	UserStorage     BundleStorage
	RootStorage     BundleStorage
}

WorkspaceBundle holds WorkSpace bundle details.

type WorkspaceConnectionStatus

type WorkspaceConnectionStatus struct {
	ConnectionStateCheckTimestamp    time.Time
	LastKnownUserConnectionTimestamp time.Time
	WorkspaceID                      string
	ConnectionState                  string
}

WorkspaceConnectionStatus holds connection status for a WorkSpace, matching the real WorkspaceConnectionStatus SDK type's four fields (ConnectionState, ConnectionStateCheckTimestamp, LastKnownUserConnectionTimestamp, WorkspaceId) -- LastKnownUserConnectionTimestamp stays the zero time since this backend models no actual client connection activity.

type WorkspaceCreationProperties

type WorkspaceCreationProperties struct {
	EnableInternetAccess            *bool
	EnableMaintenanceMode           *bool
	UserEnabledAsLocalAdministrator *bool
	DefaultOu                       string
	CustomSecurityGroupId           string //nolint:revive,staticcheck // matches real SDK field name
}

WorkspaceCreationProperties mirrors types.WorkspaceCreationProperties (workspaces@v1.73.1 api_op_ModifyWorkspaceCreationProperties.go)'s five real members. InstanceIamRoleArn stays unmodeled: this backend has no IAM role state to validate or attach it to. EnableWorkDocs is deliberately absent -- the real SDK removed it ("Remove parameter EnableWorkDocs from WorkSpacesServiceModel due to end of support of Amazon WorkDocs service", CHANGELOG.md), so it is not a real member of this type at all. Pointer booleans distinguish an explicit false from never having been set.

type WorkspaceCreationSpec

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

WorkspaceCreationSpec holds all fields for creating a workspace. WorkspaceName mirrors WorkspaceRequest.WorkspaceName (aws-sdk-go-v2/service/workspaces@v1.73.1/types/types.go:1874-1879): "not applicable if UserName is specified for user-assigned WorkSpaces", so an empty value here means the field genuinely stays unset, not a fallback to derive from UserName.

type WorkspaceDirectory

type WorkspaceDirectory struct {
	CertificateBasedAuthProperties *CertificateBasedAuthProperties
	SamlProperties                 *SamlProperties
	SelfservicePermissions         *SelfservicePermissions
	WorkspaceAccessProperties      *WorkspaceAccessProperties
	WorkspaceCreationProperties    *WorkspaceCreationProperties
	StreamingProperties            *StreamingProperties
	ActiveDirectoryConfig          *DirectoryActiveDirectoryConfig
	MicrosoftEntraConfig           *DirectoryMicrosoftEntraConfig
	IDCConfig                      *DirectoryIDCConfig
	UserIdentityType               string
	WorkspaceType                  string
	Tenancy                        string
	WorkspaceDirectoryName         string
	WorkspaceDirectoryDescription  string
	DirectoryID                    string
	DirectoryName                  string
	DirectoryType                  string
	Alias                          string
	State                          string
	EndpointEncryptionMode         string
	CustomerUserName               string
	SubnetIDs                      []string
	IPGroupIDs                     []string
	DNSIPAddresses                 []string
}

WorkspaceDirectory holds WorkSpace directory details.

IPGroupIDs / EndpointEncryptionMode / CertificateBasedAuthProperties / SamlProperties / SelfservicePermissions / WorkspaceAccessProperties / WorkspaceCreationProperties are all real members of the wire type (aws-sdk-go-v2/service/workspaces@v1.73.1/types.WorkspaceDirectory) that real AWS's DescribeWorkspaceDirectories echoes back -- there is no separate Describe op for any of these settings, only Modify* ops, so DescribeWorkspaceDirectories is the only place a real client ever reads them. Pointer sub-structs are nil (omitted) when the directory was never touched by the corresponding Modify op, matching this backend's honest no-default-simulated posture elsewhere.

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.

type WorkspaceResourceAssociation added in v1.3.1

type WorkspaceResourceAssociation struct {
	Created                time.Time
	LastUpdatedTime        time.Time
	AssociatedResourceID   string
	AssociatedResourceType string
	State                  string
	WorkspaceID            string
}

WorkspaceResourceAssociation describes a workspace<->application association, matching the real WorkspaceResourceAssociation SDK type (field-diffed against deserializers.go's awsAwsjson11_deserializeDocumentWorkspaceResourceAssociation: the wire key is "State" with AssociationState enum values, not "AssociationStatus" / "INSTALLED", which don't exist on the real type). This backend applies Associate/Deploy synchronously, so State is always the terminal COMPLETED/REMOVED value -- there is no pending/installing window to model.

Jump to

Keyboard shortcuts

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