diff --git a/azurerm/config.go b/azurerm/config.go index 273745fc2ac1..35109c6ef152 100644 --- a/azurerm/config.go +++ b/azurerm/config.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" + resourcesprofile "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" appinsights "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights" "github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation" "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2017-09-01/batch" @@ -57,6 +57,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions" "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/policy" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" "github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler" "github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search" "github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus" @@ -274,7 +275,7 @@ type ArmClient struct { // Resources managementLocksClient locks.ManagementLocksClient deploymentsClient resources.DeploymentsClient - providersClient resources.ProvidersClient + providersClient resourcesprofile.ProvidersClient resourcesClient resources.Client resourceGroupsClient resources.GroupsClient subscriptionsClient subscriptions.Client @@ -1042,13 +1043,14 @@ func (c *ArmClient) registerResourcesClients(endpoint, subscriptionId string, au c.configureClient(&resourceGroupsClient.Client, auth) c.resourceGroupsClient = resourceGroupsClient - providersClient := resources.NewProvidersClientWithBaseURI(endpoint, subscriptionId) - c.configureClient(&providersClient.Client, auth) - c.providersClient = providersClient - subscriptionsClient := subscriptions.NewClientWithBaseURI(endpoint) c.configureClient(&subscriptionsClient.Client, auth) c.subscriptionsClient = subscriptionsClient + + // this has to come from the Profile since this is shared with Stack + providersClient := resourcesprofile.NewProvidersClientWithBaseURI(endpoint, subscriptionId) + c.configureClient(&providersClient.Client, auth) + c.providersClient = providersClient } func (c *ArmClient) registerSchedulerClients(endpoint, subscriptionId string, auth autorest.Authorizer) { diff --git a/azurerm/data_source_dns_zone.go b/azurerm/data_source_dns_zone.go index 8a741758ce52..65564d22cacf 100644 --- a/azurerm/data_source_dns_zone.go +++ b/azurerm/data_source_dns_zone.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) diff --git a/azurerm/resource_arm_container_registry_migrate_test.go b/azurerm/resource_arm_container_registry_migrate_test.go index 22e088a9d74d..6e24d9035965 100644 --- a/azurerm/resource_arm_container_registry_migrate_test.go +++ b/azurerm/resource_arm_container_registry_migrate_test.go @@ -6,7 +6,7 @@ import ( "reflect" "testing" - "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_resource_group.go b/azurerm/resource_arm_resource_group.go index 216d94d65878..c1f89a3d0c01 100644 --- a/azurerm/resource_arm_resource_group.go +++ b/azurerm/resource_arm_resource_group.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" diff --git a/azurerm/resource_arm_template_deployment.go b/azurerm/resource_arm_template_deployment.go index 3f9e3c491e36..cdad713d91e5 100644 --- a/azurerm/resource_arm_template_deployment.go +++ b/azurerm/resource_arm_template_deployment.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" diff --git a/azurerm/resource_arm_template_deployment_test.go b/azurerm/resource_arm_template_deployment_test.go index b4d510337cbd..e5032e7c1866 100644 --- a/azurerm/resource_arm_template_deployment_test.go +++ b/azurerm/resource_arm_template_deployment_test.go @@ -49,6 +49,24 @@ func TestAccAzureRMTemplateDeployment_disappears(t *testing.T) { }) } +func TestAccAzureRMTemplateDeployment_nestedTemplate(t *testing.T) { + ri := acctest.RandInt() + config := testAccAzureRMTemplateDeployment_nestedTemplate(ri, testLocation()) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testCheckAzureRMTemplateDeploymentDestroy, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMTemplateDeploymentExists("azurerm_template_deployment.test"), + ), + }, + }, + }) +} + func TestAccAzureRMTemplateDeployment_withParams(t *testing.T) { ri := acctest.RandInt() config := testAccAzureRMTemplateDeployment_withParams(ri, testLocation()) @@ -324,6 +342,65 @@ DEPLOY `, rInt, location, rInt) } +func testAccAzureRMTemplateDeployment_nestedTemplate(rInt int, location string) string { + return fmt.Sprintf(` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_template_deployment" "test" { + name = "acctesttemplate-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + + template_body = <