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

MSI: refactoring to use an Embedded SDK #12715

Merged
merged 4 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
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