-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20462 from dhinus/workspace-device-type-linux
Add device_type_linux to workspace_access_properties
- Loading branch information
Showing
22 changed files
with
462 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```release-note:enhancement | ||
data-source/aws_workspaces_directory: Add `workspace_access_properties.device_type_linux` attribute | ||
``` | ||
|
||
```release-note:enhancement | ||
resource/aws_workspaces_directory: Add `workspace_access_properties.device_type_linux` argument | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package aws | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestAccDataSourceAwsWorkspaces_serial(t *testing.T) { | ||
testCases := map[string]map[string]func(t *testing.T){ | ||
"Bundle": { | ||
"basic": testAccDataSourceAwsWorkspaceBundle_basic, | ||
"bundleIDAndNameConflict": testAccDataSourceAwsWorkspaceBundle_bundleIDAndNameConflict, | ||
"byOwnerName": testAccDataSourceAwsWorkspaceBundle_byOwnerName, | ||
"privateOwner": testAccDataSourceAwsWorkspaceBundle_privateOwner, | ||
}, | ||
"Directory": { | ||
"basic": testAccDataSourceAwsWorkspacesDirectory_basic, | ||
}, | ||
"Image": { | ||
"basic": testAccDataSourceAwsWorkspacesImage_basic, | ||
}, | ||
"Workspace": { | ||
"byWorkspaceID": testAccDataSourceAwsWorkspacesWorkspace_byWorkspaceID, | ||
"byDirectoryID_userName": testAccDataSourceAwsWorkspacesWorkspace_byDirectoryID_userName, | ||
"workspaceIDAndDirectoryIDConflict": testAccDataSourceAwsWorkspacesWorkspace_workspaceIDAndDirectoryIDConflict, | ||
}, | ||
} | ||
|
||
for group, m := range testCases { | ||
m := m | ||
t.Run(group, func(t *testing.T) { | ||
for name, tc := range m { | ||
tc := tc | ||
t.Run(name, func(t *testing.T) { | ||
tc(t) | ||
}) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package finder | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/service/workspaces" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
) | ||
|
||
func DirectoryByID(conn *workspaces.WorkSpaces, id string) (*workspaces.WorkspaceDirectory, error) { | ||
input := &workspaces.DescribeWorkspaceDirectoriesInput{ | ||
DirectoryIds: aws.StringSlice([]string{id}), | ||
} | ||
|
||
output, err := conn.DescribeWorkspaceDirectories(input) | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if output == nil || len(output.Directories) == 0 || output.Directories[0] == nil { | ||
return nil, &resource.NotFoundError{ | ||
Message: "Empty result", | ||
LastRequest: input, | ||
} | ||
} | ||
|
||
// TODO Check for multiple results. | ||
// TODO https://github.com/hashicorp/terraform-provider-aws/pull/17613. | ||
|
||
directory := output.Directories[0] | ||
|
||
if state := aws.StringValue(directory.State); state == workspaces.WorkspaceDirectoryStateDeregistered { | ||
return nil, &resource.NotFoundError{ | ||
Message: state, | ||
LastRequest: input, | ||
} | ||
} | ||
|
||
return directory, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//go:generate go run ../../../generators/listpages/main.go -function=DescribeIpGroups -paginator=NextToken github.com/aws/aws-sdk-go/service/workspaces | ||
|
||
package lister |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.