Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add device_type_linux to workspace_access_properties #20462

Merged
merged 14 commits into from
Aug 9, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
r/aws_workspaces_directory: Retry on 'InvalidResourceStateException' …
…when registering.
ewbankkit committed Aug 8, 2021
commit 1010a9e1a55e898742db77d271cb6c8fa90bebac
1 change: 1 addition & 0 deletions aws/internal/service/workspaces/waiter/waiter.go
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ import (

const (
DirectoryDeregisterInvalidResourceStateTimeout = 2 * time.Minute
DirectoryRegisterInvalidResourceStateTimeout = 2 * time.Minute

// Maximum amount of time to wait for a Directory to return Registered
DirectoryRegisteredTimeout = 10 * time.Minute
9 changes: 8 additions & 1 deletion aws/resource_aws_workspaces_directory.go
Original file line number Diff line number Diff line change
@@ -221,7 +221,14 @@ func resourceAwsWorkspacesDirectoryCreate(d *schema.ResourceData, meta interface
}

log.Printf("[DEBUG] Registering WorkSpaces Directory: %s", input)
_, err := conn.RegisterWorkspaceDirectory(input)
_, err := tfresource.RetryWhenAwsErrCodeEquals(
waiter.DirectoryRegisterInvalidResourceStateTimeout,
func() (interface{}, error) {
return conn.RegisterWorkspaceDirectory(input)
},
// "error registering WorkSpaces Directory (d-000000000000): InvalidResourceStateException: The specified directory is not in a valid state. Confirm that the directory has a status of Active, and try again."
workspaces.ErrCodeInvalidResourceStateException,
)

if err != nil {
return fmt.Errorf("error registering WorkSpaces Directory (%s): %w", directoryID, err)