diff --git a/azurerm/internal/services/msi/client/client.go b/azurerm/internal/services/msi/client/client.go index 53176d1f4ac4..af38705b65cc 100644 --- a/azurerm/internal/services/msi/client/client.go +++ b/azurerm/internal/services/msi/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi" + "github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/msi/user_assigned_identity_data_source.go b/azurerm/internal/services/msi/user_assigned_identity_data_source.go index 9e812eeb51e6..30ef9f70d328 100644 --- a/azurerm/internal/services/msi/user_assigned_identity_data_source.go +++ b/azurerm/internal/services/msi/user_assigned_identity_data_source.go @@ -70,7 +70,7 @@ func dataSourceArmUserAssignedIdentityRead(d *schema.ResourceData, meta interfac d.Set("location", location.NormalizeNilable(resp.Location)) - if props := resp.IdentityProperties; props != nil { + if props := resp.UserAssignedIdentityProperties; props != nil { if principalId := props.PrincipalID; principalId != nil { d.Set("principal_id", principalId.String()) } diff --git a/azurerm/internal/services/msi/user_assigned_identity_resource.go b/azurerm/internal/services/msi/user_assigned_identity_resource.go index b284d41774a3..1af599b03d97 100644 --- a/azurerm/internal/services/msi/user_assigned_identity_resource.go +++ b/azurerm/internal/services/msi/user_assigned_identity_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi" + "github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -126,7 +126,7 @@ func resourceArmUserAssignedIdentityRead(d *schema.ResourceData, meta interface{ d.Set("resource_group_name", id.ResourceGroup) d.Set("location", location.NormalizeNilable(resp.Location)) - if props := resp.IdentityProperties; props != nil { + if props := resp.UserAssignedIdentityProperties; props != nil { if principalId := props.PrincipalID; principalId != nil { d.Set("principal_id", principalId.String()) } diff --git a/azurerm/internal/services/msi/user_assigned_identity_resource_test.go b/azurerm/internal/services/msi/user_assigned_identity_resource_test.go index 29971b038abe..16f5603f8efd 100644 --- a/azurerm/internal/services/msi/user_assigned_identity_resource_test.go +++ b/azurerm/internal/services/msi/user_assigned_identity_resource_test.go @@ -62,7 +62,7 @@ func (r UserAssignedIdentityResource) Exists(ctx context.Context, client *client return nil, fmt.Errorf("retrieving User Assigned Identity %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) } - return utils.Bool(resp.IdentityProperties != nil), nil + return utils.Bool(resp.UserAssignedIdentityProperties != nil), nil } func (r UserAssignedIdentityResource) basic(data acceptance.TestData) string { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/CHANGELOG.md similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/CHANGELOG.md rename to vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/CHANGELOG.md diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/client.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/client.go index 7abbf44fad96..172b8fa3eb81 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/client.go @@ -1,4 +1,4 @@ -// Package msi implements the Azure ARM Msi service API version 2015-08-31-preview. +// Package msi implements the Azure ARM Msi service API version 2018-11-30. // // The Managed Service Identity Client. package msi diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/models.go similarity index 84% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/models.go index 672c3f928247..2962468789c4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/models.go @@ -28,7 +28,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi" // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. type AzureEntityResource struct { @@ -63,8 +63,8 @@ type CloudErrorBody struct { // Identity describes an identity resource. type Identity struct { autorest.Response `json:"-"` - // IdentityProperties - READ-ONLY; The properties associated with the identity. - *IdentityProperties `json:"properties,omitempty"` + // UserAssignedIdentityProperties - READ-ONLY; The properties associated with the identity. + *UserAssignedIdentityProperties `json:"properties,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` // Location - The geo-location where the resource lives @@ -100,12 +100,12 @@ func (i *Identity) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var identityProperties IdentityProperties - err = json.Unmarshal(*v, &identityProperties) + var userAssignedIdentityProperties UserAssignedIdentityProperties + err = json.Unmarshal(*v, &userAssignedIdentityProperties) if err != nil { return err } - i.IdentityProperties = &identityProperties + i.UserAssignedIdentityProperties = &userAssignedIdentityProperties } case "tags": if v != nil { @@ -158,16 +158,101 @@ func (i *Identity) UnmarshalJSON(body []byte) error { return nil } -// IdentityProperties the properties associated with the identity. -type IdentityProperties struct { - // TenantID - READ-ONLY; The id of the tenant which the identity belongs to. - TenantID *uuid.UUID `json:"tenantId,omitempty"` - // PrincipalID - READ-ONLY; The id of the service principal object associated with the created identity. - PrincipalID *uuid.UUID `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The id of the app associated with the identity. This is a random generated UUID by MSI. - ClientID *uuid.UUID `json:"clientId,omitempty"` - // ClientSecretURL - READ-ONLY; The ManagedServiceIdentity DataPlane URL that can be queried to obtain the identity credentials. - ClientSecretURL *string `json:"clientSecretUrl,omitempty"` +// IdentityUpdate describes an identity resource. +type IdentityUpdate struct { + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // UserAssignedIdentityProperties - READ-ONLY; The properties associated with the identity. + *UserAssignedIdentityProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityUpdate. +func (iu IdentityUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iu.Location != nil { + objectMap["location"] = iu.Location + } + if iu.Tags != nil { + objectMap["tags"] = iu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityUpdate struct. +func (iu *IdentityUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + iu.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + iu.Tags = tags + } + case "properties": + if v != nil { + var userAssignedIdentityProperties UserAssignedIdentityProperties + err = json.Unmarshal(*v, &userAssignedIdentityProperties) + if err != nil { + return err + } + iu.UserAssignedIdentityProperties = &userAssignedIdentityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iu.Type = &typeVar + } + } + } + + return nil } // Operation operation supported by the Microsoft.ManagedIdentity REST API. @@ -377,8 +462,8 @@ type SystemAssignedIdentity struct { Location *string `json:"location,omitempty"` // Tags - Resource tags Tags map[string]*string `json:"tags"` - // IdentityProperties - READ-ONLY; The properties associated with the identity. - *IdentityProperties `json:"properties,omitempty"` + // SystemAssignedIdentityProperties - READ-ONLY; The properties associated with the identity. + *SystemAssignedIdentityProperties `json:"properties,omitempty"` // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource @@ -428,12 +513,12 @@ func (sai *SystemAssignedIdentity) UnmarshalJSON(body []byte) error { } case "properties": if v != nil { - var identityProperties IdentityProperties - err = json.Unmarshal(*v, &identityProperties) + var systemAssignedIdentityProperties SystemAssignedIdentityProperties + err = json.Unmarshal(*v, &systemAssignedIdentityProperties) if err != nil { return err } - sai.IdentityProperties = &identityProperties + sai.SystemAssignedIdentityProperties = &systemAssignedIdentityProperties } case "id": if v != nil { @@ -468,6 +553,18 @@ func (sai *SystemAssignedIdentity) UnmarshalJSON(body []byte) error { return nil } +// SystemAssignedIdentityProperties the properties associated with the system assigned identity. +type SystemAssignedIdentityProperties struct { + // TenantID - READ-ONLY; The id of the tenant which the identity belongs to. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // PrincipalID - READ-ONLY; The id of the service principal object associated with the created identity. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The id of the app associated with the identity. This is a random generated UUID by MSI. + ClientID *uuid.UUID `json:"clientId,omitempty"` + // ClientSecretURL - READ-ONLY; The ManagedServiceIdentity DataPlane URL that can be queried to obtain the identity credentials. + ClientSecretURL *string `json:"clientSecretUrl,omitempty"` +} + // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource // which has 'tags' and a 'location' type TrackedResource struct { @@ -653,3 +750,13 @@ func NewUserAssignedIdentitiesListResultPage(cur UserAssignedIdentitiesListResul uailr: cur, } } + +// UserAssignedIdentityProperties the properties associated with the user assigned identity. +type UserAssignedIdentityProperties struct { + // TenantID - READ-ONLY; The id of the tenant which the identity belongs to. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // PrincipalID - READ-ONLY; The id of the service principal object associated with the created identity. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The id of the app associated with the identity. This is a random generated UUID by MSI. + ClientID *uuid.UUID `json:"clientId,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/operations.go index 659fa33a3d93..cc0325e1c5f2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/operations.go @@ -81,7 +81,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2015-08-31-preview" + const APIVersion = "2018-11-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/systemassignedidentities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/systemassignedidentities.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/systemassignedidentities.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/systemassignedidentities.go index d1829be08297..10515ecd5937 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/systemassignedidentities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/systemassignedidentities.go @@ -84,7 +84,7 @@ func (client SystemAssignedIdentitiesClient) GetByScopePreparer(ctx context.Cont "scope": scope, } - const APIVersion = "2015-08-31-preview" + const APIVersion = "2018-11-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/userassignedidentities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/userassignedidentities.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/userassignedidentities.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/userassignedidentities.go index 670c9ce55bee..331ccdfc5777 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/userassignedidentities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/userassignedidentities.go @@ -88,12 +88,12 @@ func (client UserAssignedIdentitiesClient) CreateOrUpdatePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-08-31-preview" + const APIVersion = "2018-11-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - parameters.IdentityProperties = nil + parameters.UserAssignedIdentityProperties = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), @@ -167,7 +167,7 @@ func (client UserAssignedIdentitiesClient) DeletePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-08-31-preview" + const APIVersion = "2018-11-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client UserAssignedIdentitiesClient) GetPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-08-31-preview" + const APIVersion = "2018-11-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +320,7 @@ func (client UserAssignedIdentitiesClient) ListByResourceGroupPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-08-31-preview" + const APIVersion = "2018-11-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client UserAssignedIdentitiesClient) ListBySubscriptionPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-08-31-preview" + const APIVersion = "2018-11-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -507,7 +507,7 @@ func (client UserAssignedIdentitiesClient) ListBySubscriptionComplete(ctx contex // resourceGroupName - the name of the Resource Group to which the identity belongs. // resourceName - the name of the identity resource. // parameters - parameters to update the identity -func (client UserAssignedIdentitiesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, parameters Identity) (result Identity, err error) { +func (client UserAssignedIdentitiesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, parameters IdentityUpdate) (result Identity, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserAssignedIdentitiesClient.Update") defer func() { @@ -541,19 +541,19 @@ func (client UserAssignedIdentitiesClient) Update(ctx context.Context, resourceG } // UpdatePreparer prepares the Update request. -func (client UserAssignedIdentitiesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters Identity) (*http.Request, error) { +func (client UserAssignedIdentitiesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters IdentityUpdate) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceName": autorest.Encode("path", resourceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-08-31-preview" + const APIVersion = "2018-11-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - parameters.IdentityProperties = nil + parameters.UserAssignedIdentityProperties = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/version.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/version.go index 42534a9deca2..c324c23e68f5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " msi/2015-08-31-preview" + return "Azure-SDK-For-Go/" + Version() + " msi/2018-11-30" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 4c4dff502293..3e1b52a8a71c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -51,6 +51,7 @@ github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2020-05-01/media +github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-10-01/netapp github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-03-01/network @@ -74,7 +75,6 @@ github.com/Azure/azure-sdk-for-go/services/preview/hardwaresecuritymodules/mgmt/ github.com/Azure/azure-sdk-for-go/services/preview/maintenance/mgmt/2018-06-01-preview/maintenance github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2019-06-01/insights -github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/msi github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement github.com/Azure/azure-sdk-for-go/services/preview/policyinsights/mgmt/2019-10-01-preview/policyinsights github.com/Azure/azure-sdk-for-go/services/preview/portal/mgmt/2019-01-01-preview/portal