From 972720feb95737738c77604a3d719502cf43f4e8 Mon Sep 17 00:00:00 2001 From: Christian Pearce Date: Fri, 15 May 2020 11:08:42 -0400 Subject: [PATCH] Reviewer change request fixes - Adjust schema for accuracy and ordering - Clarify response from expandAzureRmDataFactoryIntegrationRuntimeSelfHostedTypeProperties - Adjust test names - Rename files to match current refactor --- ...actory_integration_runtime_self_hosted.go} | 33 ++++++++++--------- ...y_integration_runtime_self_hosted_test.go} | 8 ++--- 2 files changed, 22 insertions(+), 19 deletions(-) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_integration_runtime_self_hosted.go => data_factory_integration_runtime_self_hosted.go} (97%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_integration_runtime_self_hosted_test.go => data_factory_integration_runtime_self_hosted_test.go} (98%) diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_integration_runtime_self_hosted.go b/azurerm/internal/services/datafactory/data_factory_integration_runtime_self_hosted.go similarity index 97% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_integration_runtime_self_hosted.go rename to azurerm/internal/services/datafactory/data_factory_integration_runtime_self_hosted.go index a73900135f34a..8b72e0e4f4eeb 100644 --- a/azurerm/internal/services/datafactory/resource_arm_data_factory_integration_runtime_self_hosted.go +++ b/azurerm/internal/services/datafactory/data_factory_integration_runtime_self_hosted.go @@ -47,11 +47,6 @@ func resourceArmDataFactoryIntegrationRuntimeSelfHosted() *schema.Resource { ), }, - "description": { - Type: schema.TypeString, - Optional: true, - }, - "data_factory_name": { Type: schema.TypeString, Required: true, @@ -59,18 +54,13 @@ func resourceArmDataFactoryIntegrationRuntimeSelfHosted() *schema.Resource { ValidateFunc: validate.DataFactoryName(), }, - "auth_key_1": { - Type: schema.TypeString, - Computed: true, - }, + "resource_group_name": azure.SchemaResourceGroupName(), - "auth_key_2": { + "description": { Type: schema.TypeString, - Computed: true, + Optional: true, }, - "resource_group_name": azure.SchemaResourceGroupName(), - "rbac_authorization": { Type: schema.TypeSet, Optional: true, @@ -84,7 +74,16 @@ func resourceArmDataFactoryIntegrationRuntimeSelfHosted() *schema.Resource { }, }, }, - Set: resourceArmDataFactoryIntegrationRuntimeSelfHostedRbacAuthorizationHash, + }, + + "auth_key_1": { + Type: schema.TypeString, + Computed: true, + }, + + "auth_key_2": { + Type: schema.TypeString, + Computed: true, }, }, } @@ -117,7 +116,11 @@ func resourceArmDataFactoryIntegrationRuntimeSelfHostedCreateUpdate(d *schema.Re selfHostedIntegrationRuntime := datafactory.SelfHostedIntegrationRuntime{ Description: &description, Type: datafactory.TypeSelfHosted, - SelfHostedIntegrationRuntimeTypeProperties: expandAzureRmDataFactoryIntegrationRuntimeSelfHostedTypeProperties(d), + } + + properties := expandAzureRmDataFactoryIntegrationRuntimeSelfHostedTypeProperties(d) + if properties != nil { + selfHostedIntegrationRuntime.SelfHostedIntegrationRuntimeTypeProperties = properties } basicIntegrationRuntime, _ := selfHostedIntegrationRuntime.AsBasicIntegrationRuntime() diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_integration_runtime_self_hosted_test.go b/azurerm/internal/services/datafactory/tests/data_factory_integration_runtime_self_hosted_test.go similarity index 98% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_integration_runtime_self_hosted_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_integration_runtime_self_hosted_test.go index 243648be05b30..6bf8b4c8c7278 100644 --- a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_integration_runtime_self_hosted_test.go +++ b/azurerm/internal/services/datafactory/tests/data_factory_integration_runtime_self_hosted_test.go @@ -58,7 +58,7 @@ provider "azurerm" { } resource "azurerm_resource_group" "test" { - name = "acctestRG-%d" + name = "acctestRG-df-%d" location = "%s" } @@ -69,11 +69,11 @@ resource "azurerm_data_factory" "test" { } resource "azurerm_data_factory_integration_runtime_self_hosted" "test" { - name = "self-integration-runtime" + name = "acctestSIR%d" data_factory_name = azurerm_data_factory.test.name resource_group_name = azurerm_resource_group.test.name } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } func testAccAzureRMDataFactoryIntegrationRuntimeSelfHosted_rbac(data acceptance.TestData) string { @@ -167,7 +167,7 @@ resource "azurerm_virtual_machine_extension" "test" { } resource "azurerm_resource_group" "host" { - name = "acctesthostRG-%d" + name = "acctesthostRG-df-%d" location = "%s" }