From 76c2629c42c7d4adc850070de876b7e54a1265b7 Mon Sep 17 00:00:00 2001 From: Robert Lippens Date: Mon, 18 Mar 2019 14:05:14 -0700 Subject: [PATCH 1/7] add primary and secondary keys, endpoint --- azurerm/data_source_batch_account.go | 27 ++++++++++++++++++++++ azurerm/resource_arm_batch_account.go | 26 +++++++++++++++++++++ website/docs/d/batch_account.html.markdown | 6 +++++ website/docs/r/batch_account.html.markdown | 6 +++++ 4 files changed, 65 insertions(+) diff --git a/azurerm/data_source_batch_account.go b/azurerm/data_source_batch_account.go index f3de32673217..23be7edc66bf 100644 --- a/azurerm/data_source_batch_account.go +++ b/azurerm/data_source_batch_account.go @@ -3,6 +3,7 @@ package azurerm import ( "fmt" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2017-09-01/batch" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -28,6 +29,20 @@ func dataSourceArmBatchAccount() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "primary_shared_key": { + Type: schema.TypeString, + Sensitive: true, + Computed: true, + }, + "secondary_shared_key": { + Type: schema.TypeString, + Sensitive: true, + Computed: true, + }, + "account_endpoint": { + Type: schema.TypeString, + Computed: true, + }, "tags": tagsForDataSourceSchema(), }, } @@ -52,6 +67,18 @@ func dataSourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) err d.Set("name", name) d.Set("resource_group_name", resourceGroup) + d.Set("account_endpoint", resp.AccountEndpoint) + + if d.Get("pool_allocation_mode") == string(batch.BatchService) { + keys, err := client.GetKeys(ctx, resourceGroup, name) + + if err != nil { + return err + } + + d.Set("primary_shared_key", keys.Primary) + d.Set("secondary_shared_key", keys.Secondary) + } if location := resp.Location; location != nil { d.Set("location", azureRMNormalizeLocation(*location)) diff --git a/azurerm/resource_arm_batch_account.go b/azurerm/resource_arm_batch_account.go index b75e3fa4ea06..39fcad964205 100644 --- a/azurerm/resource_arm_batch_account.go +++ b/azurerm/resource_arm_batch_account.go @@ -48,6 +48,20 @@ func resourceArmBatchAccount() *schema.Resource { string(batch.UserSubscription), }, false), }, + "primary_shared_key": { + Type: schema.TypeString, + Sensitive: true, + Computed: true, + }, + "secondary_shared_key": { + Type: schema.TypeString, + Sensitive: true, + Computed: true, + }, + "account_endpoint": { + Type: schema.TypeString, + Computed: true, + }, "tags": tagsSchema(), }, } @@ -137,8 +151,20 @@ func resourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading the state of Batch account %q: %+v", name, err) } + if d.Get("pool_allocation_mode") == string(batch.BatchService) { + keys, err := client.GetKeys(ctx, resourceGroupName, name) + + if err != nil { + return err + } + + d.Set("primary_shared_key", keys.Primary) + d.Set("secondary_shared_key", keys.Secondary) + } + d.Set("name", resp.Name) d.Set("resource_group_name", resourceGroupName) + d.Set("account_endpoint", resp.AccountEndpoint) if location := resp.Location; location != nil { d.Set("location", azureRMNormalizeLocation(*location)) diff --git a/website/docs/d/batch_account.html.markdown b/website/docs/d/batch_account.html.markdown index 729bf76f060d..dbcda9887e96 100644 --- a/website/docs/d/batch_account.html.markdown +++ b/website/docs/d/batch_account.html.markdown @@ -44,4 +44,10 @@ The following attributes are exported: * `storage_account_id` - The ID of the Storage Account used for this Batch account. +* `primary_shared_key` - The Batch account primary shared key. + +* `secondary_shared_key` - The Batch account secondary shared key. + +* `account_endpoint` - The account endpoint used to interact with the Batch service. + * `tags` - A map of tags assigned to the Batch account. diff --git a/website/docs/r/batch_account.html.markdown b/website/docs/r/batch_account.html.markdown index b36a1e9a796f..16fc245560bf 100644 --- a/website/docs/r/batch_account.html.markdown +++ b/website/docs/r/batch_account.html.markdown @@ -61,3 +61,9 @@ The following arguments are supported: The following attributes are exported: * `id` - The Batch account ID. + +* `primary_shared_key` - The Batch account primary shared key. + +* `secondary_shared_key` - The Batch account secondary shared key. + +* `account_endpoint` - The account endpoint used to interact with the Batch service. \ No newline at end of file From 301a3dd7feedff0e244f93960efa3184fb7da971 Mon Sep 17 00:00:00 2001 From: Robert Lippens Date: Mon, 18 Mar 2019 14:10:35 -0700 Subject: [PATCH 2/7] shared -> access terminology fix --- azurerm/data_source_batch_account.go | 8 ++++---- azurerm/resource_arm_batch_account.go | 8 ++++---- website/docs/d/batch_account.html.markdown | 4 ++-- website/docs/r/batch_account.html.markdown | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/azurerm/data_source_batch_account.go b/azurerm/data_source_batch_account.go index 23be7edc66bf..fcb8579d2afe 100644 --- a/azurerm/data_source_batch_account.go +++ b/azurerm/data_source_batch_account.go @@ -29,12 +29,12 @@ func dataSourceArmBatchAccount() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "primary_shared_key": { + "primary_access_key": { Type: schema.TypeString, Sensitive: true, Computed: true, }, - "secondary_shared_key": { + "secondary_access_key": { Type: schema.TypeString, Sensitive: true, Computed: true, @@ -76,8 +76,8 @@ func dataSourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) err return err } - d.Set("primary_shared_key", keys.Primary) - d.Set("secondary_shared_key", keys.Secondary) + d.Set("primary_access_key", keys.Primary) + d.Set("secondary_access_key", keys.Secondary) } if location := resp.Location; location != nil { diff --git a/azurerm/resource_arm_batch_account.go b/azurerm/resource_arm_batch_account.go index 39fcad964205..987974031164 100644 --- a/azurerm/resource_arm_batch_account.go +++ b/azurerm/resource_arm_batch_account.go @@ -48,12 +48,12 @@ func resourceArmBatchAccount() *schema.Resource { string(batch.UserSubscription), }, false), }, - "primary_shared_key": { + "primary_access_key": { Type: schema.TypeString, Sensitive: true, Computed: true, }, - "secondary_shared_key": { + "secondary_access_key": { Type: schema.TypeString, Sensitive: true, Computed: true, @@ -158,8 +158,8 @@ func resourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) error return err } - d.Set("primary_shared_key", keys.Primary) - d.Set("secondary_shared_key", keys.Secondary) + d.Set("primary_access_key", keys.Primary) + d.Set("secondary_access_key", keys.Secondary) } d.Set("name", resp.Name) diff --git a/website/docs/d/batch_account.html.markdown b/website/docs/d/batch_account.html.markdown index dbcda9887e96..d8e17b43f5bc 100644 --- a/website/docs/d/batch_account.html.markdown +++ b/website/docs/d/batch_account.html.markdown @@ -44,9 +44,9 @@ The following attributes are exported: * `storage_account_id` - The ID of the Storage Account used for this Batch account. -* `primary_shared_key` - The Batch account primary shared key. +* `primary_access_key` - The Batch account primary access key. -* `secondary_shared_key` - The Batch account secondary shared key. +* `secondary_access_key` - The Batch account secondary access key. * `account_endpoint` - The account endpoint used to interact with the Batch service. diff --git a/website/docs/r/batch_account.html.markdown b/website/docs/r/batch_account.html.markdown index 16fc245560bf..e70d2749fbb8 100644 --- a/website/docs/r/batch_account.html.markdown +++ b/website/docs/r/batch_account.html.markdown @@ -62,8 +62,8 @@ The following attributes are exported: * `id` - The Batch account ID. -* `primary_shared_key` - The Batch account primary shared key. +* `primary_access_key` - The Batch account primary access key. -* `secondary_shared_key` - The Batch account secondary shared key. +* `secondary_access_key` - The Batch account secondary access key. * `account_endpoint` - The account endpoint used to interact with the Batch service. \ No newline at end of file From 96668376fd8d82a279b574668ab2e357a34b8e2c Mon Sep 17 00:00:00 2001 From: Robert Lippens Date: Mon, 18 Mar 2019 14:34:23 -0700 Subject: [PATCH 3/7] move pool allocation check below last possible set --- azurerm/data_source_batch_account.go | 22 +++++++++++----------- azurerm/resource_arm_batch_account.go | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/azurerm/data_source_batch_account.go b/azurerm/data_source_batch_account.go index fcb8579d2afe..07bd292e7d40 100644 --- a/azurerm/data_source_batch_account.go +++ b/azurerm/data_source_batch_account.go @@ -69,17 +69,6 @@ func dataSourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) err d.Set("resource_group_name", resourceGroup) d.Set("account_endpoint", resp.AccountEndpoint) - if d.Get("pool_allocation_mode") == string(batch.BatchService) { - keys, err := client.GetKeys(ctx, resourceGroup, name) - - if err != nil { - return err - } - - d.Set("primary_access_key", keys.Primary) - d.Set("secondary_access_key", keys.Secondary) - } - if location := resp.Location; location != nil { d.Set("location", azureRMNormalizeLocation(*location)) } @@ -91,6 +80,17 @@ func dataSourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) err d.Set("pool_allocation_mode", props.PoolAllocationMode) } + if d.Get("pool_allocation_mode").(string) == string(batch.BatchService) { + keys, err := client.GetKeys(ctx, resourceGroup, name) + + if err != nil { + return err + } + + d.Set("primary_access_key", keys.Primary) + d.Set("secondary_access_key", keys.Secondary) + } + flattenAndSetTags(d, resp.Tags) return nil diff --git a/azurerm/resource_arm_batch_account.go b/azurerm/resource_arm_batch_account.go index 987974031164..fcac0b4b99d4 100644 --- a/azurerm/resource_arm_batch_account.go +++ b/azurerm/resource_arm_batch_account.go @@ -151,17 +151,6 @@ func resourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error reading the state of Batch account %q: %+v", name, err) } - if d.Get("pool_allocation_mode") == string(batch.BatchService) { - keys, err := client.GetKeys(ctx, resourceGroupName, name) - - if err != nil { - return err - } - - d.Set("primary_access_key", keys.Primary) - d.Set("secondary_access_key", keys.Secondary) - } - d.Set("name", resp.Name) d.Set("resource_group_name", resourceGroupName) d.Set("account_endpoint", resp.AccountEndpoint) @@ -177,6 +166,17 @@ func resourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) error d.Set("pool_allocation_mode", props.PoolAllocationMode) } + if d.Get("pool_allocation_mode").(string) == string(batch.BatchService) { + keys, err := client.GetKeys(ctx, resourceGroupName, name) + + if err != nil { + return err + } + + d.Set("primary_access_key", keys.Primary) + d.Set("secondary_access_key", keys.Secondary) + } + flattenAndSetTags(d, resp.Tags) return nil From f709aa47aa94aaa8999a6f61c0f5485ca574d1c6 Mon Sep 17 00:00:00 2001 From: Robert Lippens Date: Mon, 18 Mar 2019 14:48:17 -0700 Subject: [PATCH 4/7] add disclaimer for userSubscription mode --- website/docs/d/batch_account.html.markdown | 2 ++ website/docs/r/batch_account.html.markdown | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/website/docs/d/batch_account.html.markdown b/website/docs/d/batch_account.html.markdown index d8e17b43f5bc..64bb46c981fb 100644 --- a/website/docs/d/batch_account.html.markdown +++ b/website/docs/d/batch_account.html.markdown @@ -51,3 +51,5 @@ The following attributes are exported: * `account_endpoint` - The account endpoint used to interact with the Batch service. * `tags` - A map of tags assigned to the Batch account. + +~> **NOTE:** When `pool_allocation_mode` is set to `BatchService`, primary and secondary access keys can be retrieved after the batch account has been created. See [documentation](https://docs.microsoft.com/en-us/azure/batch/batch-api-basics) for more information. \ No newline at end of file diff --git a/website/docs/r/batch_account.html.markdown b/website/docs/r/batch_account.html.markdown index e70d2749fbb8..4752161f096e 100644 --- a/website/docs/r/batch_account.html.markdown +++ b/website/docs/r/batch_account.html.markdown @@ -66,4 +66,6 @@ The following attributes are exported: * `secondary_access_key` - The Batch account secondary access key. -* `account_endpoint` - The account endpoint used to interact with the Batch service. \ No newline at end of file +* `account_endpoint` - The account endpoint used to interact with the Batch service. + +~> **NOTE:** When `pool_allocation_mode` is set to `BatchService`, primary and secondary access keys can be retrieved after the batch account has been created. See [documentation](https://docs.microsoft.com/en-us/azure/batch/batch-api-basics) for more information. \ No newline at end of file From 57aab85c664bc81e095b667d72cb97cd3bc33a87 Mon Sep 17 00:00:00 2001 From: Robert Lippens Date: Mon, 18 Mar 2019 14:50:11 -0700 Subject: [PATCH 5/7] fix note wording --- website/docs/d/batch_account.html.markdown | 2 +- website/docs/r/batch_account.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/d/batch_account.html.markdown b/website/docs/d/batch_account.html.markdown index 64bb46c981fb..917037879ab4 100644 --- a/website/docs/d/batch_account.html.markdown +++ b/website/docs/d/batch_account.html.markdown @@ -52,4 +52,4 @@ The following attributes are exported: * `tags` - A map of tags assigned to the Batch account. -~> **NOTE:** When `pool_allocation_mode` is set to `BatchService`, primary and secondary access keys can be retrieved after the batch account has been created. See [documentation](https://docs.microsoft.com/en-us/azure/batch/batch-api-basics) for more information. \ No newline at end of file +~> **NOTE:** Primary and secondary access keys are only available when `pool_allocation_mode` is set to `BatchService`. See [documentation](https://docs.microsoft.com/en-us/azure/batch/batch-api-basics) for more information. \ No newline at end of file diff --git a/website/docs/r/batch_account.html.markdown b/website/docs/r/batch_account.html.markdown index 4752161f096e..749a61bd8533 100644 --- a/website/docs/r/batch_account.html.markdown +++ b/website/docs/r/batch_account.html.markdown @@ -68,4 +68,4 @@ The following attributes are exported: * `account_endpoint` - The account endpoint used to interact with the Batch service. -~> **NOTE:** When `pool_allocation_mode` is set to `BatchService`, primary and secondary access keys can be retrieved after the batch account has been created. See [documentation](https://docs.microsoft.com/en-us/azure/batch/batch-api-basics) for more information. \ No newline at end of file +~> **NOTE:** Primary and secondary access keys are only available when `pool_allocation_mode` is set to `BatchService`. See [documentation](https://docs.microsoft.com/en-us/azure/batch/batch-api-basics) for more information. \ No newline at end of file From 79a8c8ec879d39901c607a8bfd597a464c1e1101 Mon Sep 17 00:00:00 2001 From: kt Date: Mon, 18 Mar 2019 17:11:12 -0700 Subject: [PATCH 6/7] wrap errors --- azurerm/data_source_batch_account.go | 2 +- azurerm/resource_arm_batch_account.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/data_source_batch_account.go b/azurerm/data_source_batch_account.go index 07bd292e7d40..71735a8ca1fd 100644 --- a/azurerm/data_source_batch_account.go +++ b/azurerm/data_source_batch_account.go @@ -84,7 +84,7 @@ func dataSourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) err keys, err := client.GetKeys(ctx, resourceGroup, name) if err != nil { - return err + return fmt.Errorf("Cannot read keys for Batch account %q (resource group %q): %v", name, resourceGroupName, err) } d.Set("primary_access_key", keys.Primary) diff --git a/azurerm/resource_arm_batch_account.go b/azurerm/resource_arm_batch_account.go index fcac0b4b99d4..6c77aa632832 100644 --- a/azurerm/resource_arm_batch_account.go +++ b/azurerm/resource_arm_batch_account.go @@ -170,7 +170,7 @@ func resourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) error keys, err := client.GetKeys(ctx, resourceGroupName, name) if err != nil { - return err + return fmt.Errorf("Cannot read keys for Batch account %q (resource group %q): %v", name, resourceGroupName, err) } d.Set("primary_access_key", keys.Primary) From 3fa841dacd7fdc4dd7c58830c763686d7d6e51dc Mon Sep 17 00:00:00 2001 From: kt Date: Mon, 18 Mar 2019 17:42:28 -0700 Subject: [PATCH 7/7] fix typo --- azurerm/data_source_batch_account.go | 2 +- azurerm/resource_arm_batch_account.go | 50 +++++++++---------- .../resource_arm_eventhub_namespace_test.go | 6 +-- go.mod | 2 +- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/azurerm/data_source_batch_account.go b/azurerm/data_source_batch_account.go index 71735a8ca1fd..45491b9ffd6b 100644 --- a/azurerm/data_source_batch_account.go +++ b/azurerm/data_source_batch_account.go @@ -84,7 +84,7 @@ func dataSourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) err keys, err := client.GetKeys(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Cannot read keys for Batch account %q (resource group %q): %v", name, resourceGroupName, err) + return fmt.Errorf("Cannot read keys for Batch account %q (resource group %q): %v", name, resourceGroup, err) } d.Set("primary_access_key", keys.Primary) diff --git a/azurerm/resource_arm_batch_account.go b/azurerm/resource_arm_batch_account.go index 6c77aa632832..8eb7e547ca92 100644 --- a/azurerm/resource_arm_batch_account.go +++ b/azurerm/resource_arm_batch_account.go @@ -73,7 +73,7 @@ func resourceArmBatchAccountCreate(d *schema.ResourceData, meta interface{}) err log.Printf("[INFO] preparing arguments for Azure Batch account creation.") - resourceGroupName := d.Get("resource_group_name").(string) + resourceGroup := d.Get("resource_group_name").(string) name := d.Get("name").(string) location := azureRMNormalizeLocation(d.Get("location").(string)) storageAccountId := d.Get("storage_account_id").(string) @@ -81,10 +81,10 @@ func resourceArmBatchAccountCreate(d *schema.ResourceData, meta interface{}) err tags := d.Get("tags").(map[string]interface{}) if requireResourcesToBeImported && d.IsNewResource() { - existing, err := client.Get(ctx, resourceGroupName, name) + existing, err := client.Get(ctx, resourceGroup, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Batch Account %q (Resource Group %q): %s", name, resourceGroupName, err) + return fmt.Errorf("Error checking for presence of existing Batch Account %q (Resource Group %q): %s", name, resourceGroup, err) } } @@ -107,22 +107,22 @@ func resourceArmBatchAccountCreate(d *schema.ResourceData, meta interface{}) err } } - future, err := client.Create(ctx, resourceGroupName, name, parameters) + future, err := client.Create(ctx, resourceGroup, name, parameters) if err != nil { - return fmt.Errorf("Error creating Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err) + return fmt.Errorf("Error creating Batch account %q (Resource Group %q): %+v", name, resourceGroup, err) } if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("Error waiting for creation of Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err) + return fmt.Errorf("Error waiting for creation of Batch account %q (Resource Group %q): %+v", name, resourceGroup, err) } - read, err := client.Get(ctx, resourceGroupName, name) + read, err := client.Get(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error retrieving Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err) + return fmt.Errorf("Error retrieving Batch account %q (Resource Group %q): %+v", name, resourceGroup, err) } if read.ID == nil { - return fmt.Errorf("Cannot read Batch account %q (resource group %q) ID", name, resourceGroupName) + return fmt.Errorf("Cannot read Batch account %q (resource group %q) ID", name, resourceGroup) } d.SetId(*read.ID) @@ -139,20 +139,20 @@ func resourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) error return err } name := id.Path["batchAccounts"] - resourceGroupName := id.ResourceGroup + resourceGroup := id.ResourceGroup - resp, err := client.Get(ctx, resourceGroupName, name) + resp, err := client.Get(ctx, resourceGroup, name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { d.SetId("") - log.Printf("[DEBUG] Batch Account %q was not found in Resource Group %q - removing from state!", name, resourceGroupName) + log.Printf("[DEBUG] Batch Account %q was not found in Resource Group %q - removing from state!", name, resourceGroup) return nil } return fmt.Errorf("Error reading the state of Batch account %q: %+v", name, err) } d.Set("name", resp.Name) - d.Set("resource_group_name", resourceGroupName) + d.Set("resource_group_name", resourceGroup) d.Set("account_endpoint", resp.AccountEndpoint) if location := resp.Location; location != nil { @@ -167,10 +167,10 @@ func resourceArmBatchAccountRead(d *schema.ResourceData, meta interface{}) error } if d.Get("pool_allocation_mode").(string) == string(batch.BatchService) { - keys, err := client.GetKeys(ctx, resourceGroupName, name) + keys, err := client.GetKeys(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Cannot read keys for Batch account %q (resource group %q): %v", name, resourceGroupName, err) + return fmt.Errorf("Cannot read keys for Batch account %q (resource group %q): %v", name, resourceGroup, err) } d.Set("primary_access_key", keys.Primary) @@ -193,7 +193,7 @@ func resourceArmBatchAccountUpdate(d *schema.ResourceData, meta interface{}) err return err } name := id.Path["batchAccounts"] - resourceGroupName := id.ResourceGroup + resourceGroup := id.ResourceGroup storageAccountId := d.Get("storage_account_id").(string) tags := d.Get("tags").(map[string]interface{}) @@ -207,17 +207,17 @@ func resourceArmBatchAccountUpdate(d *schema.ResourceData, meta interface{}) err Tags: expandTags(tags), } - if _, err = client.Update(ctx, resourceGroupName, name, parameters); err != nil { - return fmt.Errorf("Error updating Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err) + if _, err = client.Update(ctx, resourceGroup, name, parameters); err != nil { + return fmt.Errorf("Error updating Batch account %q (Resource Group %q): %+v", name, resourceGroup, err) } - read, err := client.Get(ctx, resourceGroupName, name) + read, err := client.Get(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error retrieving Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err) + return fmt.Errorf("Error retrieving Batch account %q (Resource Group %q): %+v", name, resourceGroup, err) } if read.ID == nil { - return fmt.Errorf("Cannot read Batch account %q (resource group %q) ID", name, resourceGroupName) + return fmt.Errorf("Cannot read Batch account %q (resource group %q) ID", name, resourceGroup) } d.SetId(*read.ID) @@ -234,16 +234,16 @@ func resourceArmBatchAccountDelete(d *schema.ResourceData, meta interface{}) err return err } name := id.Path["batchAccounts"] - resourceGroupName := id.ResourceGroup + resourceGroup := id.ResourceGroup - future, err := client.Delete(ctx, resourceGroupName, name) + future, err := client.Delete(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error deleting Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err) + return fmt.Errorf("Error deleting Batch account %q (Resource Group %q): %+v", name, resourceGroup, err) } if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { if !response.WasNotFound(future.Response()) { - return fmt.Errorf("Error waiting for deletion of Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err) + return fmt.Errorf("Error waiting for deletion of Batch account %q (Resource Group %q): %+v", name, resourceGroup, err) } } diff --git a/azurerm/resource_arm_eventhub_namespace_test.go b/azurerm/resource_arm_eventhub_namespace_test.go index 414a21e2fb3a..b5a8cce01a9a 100644 --- a/azurerm/resource_arm_eventhub_namespace_test.go +++ b/azurerm/resource_arm_eventhub_namespace_test.go @@ -217,7 +217,7 @@ func TestAccAzureRMEventHubNamespace_BasicWithTagsUpdate(t *testing.T) { func TestAccAzureRMEventHubNamespace_BasicWithCapacity(t *testing.T) { resourceName := "azurerm_eventhub_namespace.test" ri := tf.AccRandTimeInt() - config := testAccAzureRMEventHubNamespace_capacity(ri, testLocation(), 20) + config := testAccAzureRMEventHubNamespace_capacity(ri, testLocation(), 100) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -238,7 +238,7 @@ func TestAccAzureRMEventHubNamespace_BasicWithCapacity(t *testing.T) { func TestAccAzureRMEventHubNamespace_BasicWithCapacityUpdate(t *testing.T) { resourceName := "azurerm_eventhub_namespace.test" ri := tf.AccRandTimeInt() - preConfig := testAccAzureRMEventHubNamespace_capacity(ri, testLocation(), 20) + preConfig := testAccAzureRMEventHubNamespace_capacity(ri, testLocation(), 100) postConfig := testAccAzureRMEventHubNamespace_capacity(ri, testLocation(), 2) resource.ParallelTest(t, resource.TestCase{ @@ -494,7 +494,7 @@ resource "azurerm_eventhub_namespace" "test" { sku = "Standard" capacity = "2" auto_inflate_enabled = true - maximum_throughput_units = 20 + maximum_throughput_units = 100 } `, rInt, location, rInt) } diff --git a/go.mod b/go.mod index 5ac068c39d66..0175e8451e76 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.6.3 // indirect github.com/hashicorp/go-azure-helpers v0.0.0-20181211121309-38db96513363 github.com/hashicorp/go-cleanhttp v0.0.0-20170211013415-3573b8b52aa7 // indirect - github.com/hashicorp/go-getter v0.0.0-20180226183729-64040d90d4ab // indirect + github.com/hashicorp/go-getter v0.0.0-20180226183729-64040d90d4ab github.com/hashicorp/go-hclog v0.0.0-20170903163258-8105cc0a3736 // indirect github.com/hashicorp/go-multierror v1.0.0 github.com/hashicorp/go-plugin v0.0.0-20170816151819-a5174f84d7f8 // indirect