Skip to content

Commit

Permalink
Merge pull request #12715 from terraform-providers/f/msi-embedded-sdk
Browse files Browse the repository at this point in the history
MSI: refactoring to use an Embedded SDK
  • Loading branch information
tombuildsstuff authored Jul 23, 2021
2 parents aa60cd5 + 7290be5 commit 58db766
Show file tree
Hide file tree
Showing 37 changed files with 1,293 additions and 2,091 deletions.
6 changes: 3 additions & 3 deletions azurerm/internal/services/msi/client/client.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package client

import (
"github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/msi/sdk/managedidentity"
)

type Client struct {
UserAssignedIdentitiesClient *msi.UserAssignedIdentitiesClient
UserAssignedIdentitiesClient *managedidentity.ManagedIdentityClient
}

func NewClient(o *common.ClientOptions) *Client {
UserAssignedIdentitiesClient := msi.NewUserAssignedIdentitiesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
UserAssignedIdentitiesClient := managedidentity.NewManagedIdentityClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&UserAssignedIdentitiesClient.Client, o.ResourceManagerAuthorizer)

return &Client{
Expand Down
113 changes: 0 additions & 113 deletions azurerm/internal/services/msi/parse/user_assigned_identity.go

This file was deleted.

13 changes: 13 additions & 0 deletions azurerm/internal/services/msi/parse/user_assigned_identity_id.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package parse

import "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/msi/sdk/managedidentity"

// these are here primarily to enable migration over

func UserAssignedIdentityID(input string) (*managedidentity.UserAssignedIdentitiesId, error) {
return managedidentity.ParseUserAssignedIdentitiesID(input)
}

func UserAssignedIdentityIDInsensitively(input string) (*managedidentity.UserAssignedIdentitiesId, error) {
return managedidentity.ParseUserAssignedIdentitiesIDInsensitively(input)
}
229 changes: 0 additions & 229 deletions azurerm/internal/services/msi/parse/user_assigned_identity_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions azurerm/internal/services/msi/resourceids.go

This file was deleted.

15 changes: 15 additions & 0 deletions azurerm/internal/services/msi/sdk/managedidentity/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package managedidentity

import "github.com/Azure/go-autorest/autorest"

type ManagedIdentityClient struct {
Client autorest.Client
baseUri string
}

func NewManagedIdentityClientWithBaseURI(endpoint string) ManagedIdentityClient {
return ManagedIdentityClient{
Client: autorest.NewClientWithUserAgent(userAgent()),
baseUri: endpoint,
}
}
Loading

0 comments on commit 58db766

Please sign in to comment.