Skip to content

Commit

Permalink
Reviewer change request fixes
Browse files Browse the repository at this point in the history
- Adjust schema for accuracy and ordering
- Clarify response from expandAzureRmDataFactoryIntegrationRuntimeSelfHostedTypeProperties
- Adjust test names
- Rename files to match current refactor
  • Loading branch information
Christian Pearce authored and pearcec committed Jun 12, 2020
1 parent 07df537 commit 733cea7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
Expand Up @@ -47,30 +47,20 @@ func resourceArmDataFactoryIntegrationRuntimeSelfHosted() *schema.Resource {
),
},

"description": {
Type: schema.TypeString,
Optional: true,
},

"data_factory_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
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,
Expand All @@ -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,
},
},
}
Expand Down Expand Up @@ -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()
Expand Down
Expand Up @@ -58,7 +58,7 @@ provider "azurerm" {
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
name = "acctestRG-df-%d"
location = "%s"
}
Expand All @@ -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 {
Expand Down Expand Up @@ -167,7 +167,7 @@ resource "azurerm_virtual_machine_extension" "test" {
}
resource "azurerm_resource_group" "host" {
name = "acctesthostRG-%d"
name = "acctesthostRG-df-%d"
location = "%s"
}
Expand Down

0 comments on commit 733cea7

Please sign in to comment.