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

New Service (Multiple Resources): DesktopVirtualization (Virtual Desktops) #8605

Merged
merged 39 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c6c1c7b
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
DanielMabbett Sep 23, 2020
703d98e
Revert "Update check-test-package.sh"
DanielMabbett Sep 23, 2020
21669af
F/wvd (#1)
DanielMabbett Sep 23, 2020
6fc34f9
Update network_interface_application_security_group_association_resou…
DanielMabbett Sep 23, 2020
d398b20
Update check-test-package.sh
DanielMabbett Sep 23, 2020
25f26bc
Merge branch 'master' of github.com:DanielMabbett/terraform-provider-…
DanielMabbett Sep 23, 2020
e93e09f
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
DanielMabbett Sep 24, 2020
76f267e
Revert test package back to original
DanielMabbett Sep 24, 2020
e03158b
fix documentation association
DanielMabbett Sep 24, 2020
2863b60
Fixed linting issues and documentation terraform code formatting. Sti…
DanielMabbett Sep 24, 2020
ef590e7
move test files and remove multiline comment
DanielMabbett Sep 28, 2020
2d48cf3
cleanup
DanielMabbett Sep 28, 2020
8e536f0
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
DanielMabbett Sep 28, 2020
4150d55
Update website/docs/r/virtual_desktop_application_group.html.markdown
DanielMabbett Sep 29, 2020
5097261
Update azurerm/internal/services/desktopvirtualization/tests/virtual_…
DanielMabbett Sep 29, 2020
7e580d7
Update azurerm/internal/services/desktopvirtualization/tests/virtual_…
DanielMabbett Sep 29, 2020
8d31970
Update azurerm/internal/services/desktopvirtualization/tests/virtual_…
DanielMabbett Sep 29, 2020
84dbbb6
Merge branch 'master' of github.com:DanielMabbett/terraform-provider-…
DanielMabbett Sep 28, 2020
998622b
cleanup + move to latest sdk api version + website build
DanielMabbett Oct 2, 2020
095e69d
hotfix documentation should be "Pooled" for host pool
DanielMabbett Oct 2, 2020
6fdf4c3
hotfix documentation should be "Pooled" for host pool
DanielMabbett Oct 2, 2020
03a8beb
make terrafmt
DanielMabbett Oct 2, 2020
2d0275c
Merge remote-tracking branch 'origin/master' into master-8605
katbyte Oct 2, 2020
569bb86
switch to secondary location for tests
katbyte Oct 2, 2020
d745ac7
Update website/docs/r/virtual_desktop_workspace.html.markdown
DanielMabbett Oct 3, 2020
562554f
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
DanielMabbett Oct 3, 2020
8ed1a6f
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
DanielMabbett Oct 3, 2020
2acecf6
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
DanielMabbett Oct 3, 2020
bb2582f
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
DanielMabbett Oct 3, 2020
2ef0902
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
DanielMabbett Oct 3, 2020
06d83da
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
DanielMabbett Oct 3, 2020
6d7dd26
update/move function to utils. Change name of application_group_refer…
DanielMabbett Oct 4, 2020
4a4f2e8
CI fixes
DanielMabbett Oct 4, 2020
758a081
Merge branch 'master' of github.com:terraform-providers/terraform-pro…
DanielMabbett Oct 6, 2020
6745e6b
fix failing tests for wvd resources
DanielMabbett Oct 6, 2020
adb663d
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
katbyte Oct 7, 2020
563564c
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
katbyte Oct 7, 2020
d557180
Update website/docs/r/virtual_desktop_workspace_application_group_ass…
katbyte Oct 7, 2020
a3a96ac
Update azurerm/internal/services/desktopvirtualization/virtual_deskto…
katbyte Oct 7, 2020
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
1 change: 1 addition & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var services = mapOf(
"datalake" to "Data Lake",
"databasemigration" to "Database Migration",
"datashare" to "Data Share",
"desktopvirtualization" to "DesktopVirtualization",
"devspace" to "DevSpaces",
"devtestlabs" to "Dev Test",
"dns" to "DNS",
Expand Down
3 changes: 3 additions & 0 deletions azurerm/internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
datafactory "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory/client"
datalake "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datalake/client"
datashare "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datashare/client"
desktopvirtualization "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/desktopvirtualization/client"
devspace "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/devspace/client"
devtestlabs "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/devtestlabs/client"
dns "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/dns/client"
Expand Down Expand Up @@ -118,6 +119,7 @@ type Client struct {
DataFactory *datafactory.Client
Datalake *datalake.Client
DataShare *datashare.Client
DesktopVirtualization *desktopvirtualization.Client
DevSpace *devspace.Client
DevTestLabs *devtestlabs.Client
Dns *dns.Client
Expand Down Expand Up @@ -207,6 +209,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
client.DataFactory = datafactory.NewClient(o)
client.Datalake = datalake.NewClient(o)
client.DataShare = datashare.NewClient(o)
client.DesktopVirtualization = desktopvirtualization.NewClient(o)
client.DevSpace = devspace.NewClient(o)
client.DevTestLabs = devtestlabs.NewClient(o)
client.Dns = dns.NewClient(o)
Expand Down
2 changes: 2 additions & 0 deletions azurerm/internal/provider/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datalake"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datashare"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/desktopvirtualization"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/devspace"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/devtestlabs"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/dns"
Expand Down Expand Up @@ -111,6 +112,7 @@ func SupportedServices() []common.ServiceRegistration {
datalake.Registration{},
databasemigration.Registration{},
datashare.Registration{},
desktopvirtualization.Registration{},
devspace.Registration{},
devtestlabs.Registration{},
dns.Registration{},
Expand Down
1 change: 1 addition & 0 deletions azurerm/internal/resourceproviders/required.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func Required() map[string]struct{} {
"Microsoft.DBforMariaDB": {},
"Microsoft.DBforMySQL": {},
"Microsoft.DBforPostgreSQL": {},
"Microsoft.DesktopVirtualization": {},
"Microsoft.Devices": {},
"Microsoft.DevSpaces": {},
"Microsoft.DevTestLab": {},
Expand Down
45 changes: 45 additions & 0 deletions azurerm/internal/services/desktopvirtualization/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package client

import (
"github.com/Azure/azure-sdk-for-go/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common"
)

type Client struct {
ApplicationGroupsClient *desktopvirtualization.ApplicationGroupsClient
DesktopsClient *desktopvirtualization.DesktopsClient
HostPoolsClient *desktopvirtualization.HostPoolsClient
OperationsClient *desktopvirtualization.OperationsClient
SessionHostsClient *desktopvirtualization.SessionHostsClient
WorkspacesClient *desktopvirtualization.WorkspacesClient
}

// NewClient - New client for desktop virtualization
func NewClient(o *common.ClientOptions) *Client {
ApplicationGroupsClient := desktopvirtualization.NewApplicationGroupsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&ApplicationGroupsClient.Client, o.ResourceManagerAuthorizer)

DesktopsClient := desktopvirtualization.NewDesktopsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&DesktopsClient.Client, o.ResourceManagerAuthorizer)

HostPoolsClient := desktopvirtualization.NewHostPoolsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&HostPoolsClient.Client, o.ResourceManagerAuthorizer)

OperationsClient := desktopvirtualization.NewOperationsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&OperationsClient.Client, o.ResourceManagerAuthorizer)

SessionHostsClient := desktopvirtualization.NewSessionHostsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&SessionHostsClient.Client, o.ResourceManagerAuthorizer)

WorkspacesClient := desktopvirtualization.NewWorkspacesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&WorkspacesClient.Client, o.ResourceManagerAuthorizer)

return &Client{
ApplicationGroupsClient: &ApplicationGroupsClient,
DesktopsClient: &DesktopsClient,
HostPoolsClient: &HostPoolsClient,
OperationsClient: &OperationsClient,
SessionHostsClient: &SessionHostsClient,
WorkspacesClient: &WorkspacesClient,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package parse

import (
"fmt"

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
)

// VirtualDesktopApplicationGroupid - The id for the virtual desktop host pool
type VirtualDesktopApplicationGroupid struct {
ResourceGroup string
Name string
}

// VirtualDesktopApplicationGroupID - Parses and validates the virtual desktop host pool
func VirtualDesktopApplicationGroupID(input string) (*VirtualDesktopApplicationGroupid, error) {
id, err := azure.ParseAzureResourceID(input)
if err != nil {
return nil, fmt.Errorf("[ERROR] Unable to parse Virtual Desktop Application Group ID %q: %+v", input, err)
}

ApplicationGroup := VirtualDesktopApplicationGroupid{
ResourceGroup: id.ResourceGroup,
}

if ApplicationGroup.Name, err = id.PopSegment("applicationgroups"); err != nil {
return nil, err
}

if err := id.ValidateNoEmptySegments(input); err != nil {
return nil, err
}

return &ApplicationGroup, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package parse

import (
"fmt"

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
)

// VirtualDesktopHostPoolid - The id for the virtual desktop host pool
type VirtualDesktopHostPoolid struct {
ResourceGroup string
Name string
}

// VirtualDesktopHostPoolID - Parses and validates the virtual desktop host pool
func VirtualDesktopHostPoolID(input string) (*VirtualDesktopHostPoolid, error) {
id, err := azure.ParseAzureResourceID(input)
if err != nil {
return nil, fmt.Errorf("[ERROR] Unable to parse Virtual Desktop Host Pool ID %q: %+v", input, err)
}

hostPool := VirtualDesktopHostPoolid{
ResourceGroup: id.ResourceGroup,
}

if hostPool.Name, err = id.PopSegment("hostpools"); err != nil {
return nil, err
}

if err := id.ValidateNoEmptySegments(input); err != nil {
return nil, err
}

return &hostPool, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package parse

import (
"fmt"

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
)

// DesktopVirtualizationWorkspaceId - The id for the virtual desktop workspace
type DesktopVirtualizationWorkspaceId struct {
ResourceGroup string
Name string
}

// DesktopVirtualizationWorkspaceID - Parses and validates the virtual desktop workspace
func DesktopVirtualizationWorkspaceID(input string) (*DesktopVirtualizationWorkspaceId, error) {
id, err := azure.ParseAzureResourceID(input)
if err != nil {
return nil, fmt.Errorf("[ERROR] Unable to parse Virtual Desktop Workspace ID %q: %+v", input, err)
}

workspace := DesktopVirtualizationWorkspaceId{
ResourceGroup: id.ResourceGroup,
}

if workspace.Name, err = id.PopSegment("workspaces"); err != nil {
return nil, err
}

if err := id.ValidateNoEmptySegments(input); err != nil {
return nil, err
}

return &workspace, nil
}
34 changes: 34 additions & 0 deletions azurerm/internal/services/desktopvirtualization/registration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package desktopvirtualization

import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

type Registration struct{}

// Registration - Name is the name of this Service
func (r Registration) Name() string {
return "DesktopVirtualization"
}

// WebsiteCategories returns a list of categories which can be used for the sidebar
func (r Registration) WebsiteCategories() []string {
return []string{
"DesktopVirtualization",
}
}

// SupportedDataSources returns the supported Data Sources supported by this Service
func (r Registration) SupportedDataSources() map[string]*schema.Resource {
return map[string]*schema.Resource{}
}

// SupportedResources returns the supported Resources supported by this Service
func (r Registration) SupportedResources() map[string]*schema.Resource {
return map[string]*schema.Resource{
"azurerm_virtual_desktop_workspace": resourceArmDesktopVirtualizationWorkspace(),
"azurerm_virtual_desktop_host_pool": resourceArmVirtualDesktopHostPool(),
"azurerm_virtual_desktop_application_group": resourceArmVirtualDesktopApplicationGroup(),
"azurerm_virtual_desktop_workspace_application_group_association": resourceArmVirtualDesktopWorkspaceApplicationGroupAssociation(),
}
}
Loading