diff --git a/builtin/providers/azurerm/import_arm_local_network_gateway_test.go b/builtin/providers/azurerm/import_arm_local_network_gateway_test.go index 8d8695bf63..6da4e96a54 100644 --- a/builtin/providers/azurerm/import_arm_local_network_gateway_test.go +++ b/builtin/providers/azurerm/import_arm_local_network_gateway_test.go @@ -3,22 +3,24 @@ package azurerm import ( "testing" + "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" ) func TestAccAzureRMLocalNetworkGateway_importBasic(t *testing.T) { resourceName := "azurerm_local_network_gateway.test" + rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testCheckAzureRMLocalNetworkGatewayDestroy, Steps: []resource.TestStep{ - resource.TestStep{ - Config: testAccAzureRMLocalNetworkGatewayConfig_basic, + { + Config: testAccAzureRMLocalNetworkGatewayConfig_basic(rInt), }, - resource.TestStep{ + { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/builtin/providers/azurerm/resource_arm_container_registry.go b/builtin/providers/azurerm/resource_arm_container_registry.go index 190d5352a4..efd03cd750 100644 --- a/builtin/providers/azurerm/resource_arm_container_registry.go +++ b/builtin/providers/azurerm/resource_arm_container_registry.go @@ -45,8 +45,9 @@ func resourceArmContainerRegistry() *schema.Resource { "sku": { Type: schema.TypeString, - Required: true, + Optional: true, ForceNew: true, + Default: string(containerregistry.Basic), DiffSuppressFunc: ignoreCaseDiffSuppressFunc, ValidateFunc: validation.StringInSlice([]string{ string(containerregistry.Basic), diff --git a/builtin/providers/azurerm/resource_arm_eventhub_namespace.go b/builtin/providers/azurerm/resource_arm_eventhub_namespace.go index c5875b502b..aa940dae27 100644 --- a/builtin/providers/azurerm/resource_arm_eventhub_namespace.go +++ b/builtin/providers/azurerm/resource_arm_eventhub_namespace.go @@ -171,9 +171,14 @@ func resourceArmEventHubNamespaceDelete(d *schema.ResourceData, meta interface{} resGroup := id.ResourceGroup name := id.Path["namespaces"] - _, error := namespaceClient.Delete(resGroup, name, make(chan struct{})) + deleteResp, error := namespaceClient.Delete(resGroup, name, make(chan struct{})) + resp := <-deleteResp err = <-error + if resp.StatusCode == http.StatusNotFound { + return nil + } + if err != nil { return fmt.Errorf("Error issuing Azure ARM delete request of EventHub Namespace '%s': %+v", name, err) } diff --git a/builtin/providers/azurerm/resource_arm_local_network_gateway.go b/builtin/providers/azurerm/resource_arm_local_network_gateway.go index e3af643b24..1a60053971 100644 --- a/builtin/providers/azurerm/resource_arm_local_network_gateway.go +++ b/builtin/providers/azurerm/resource_arm_local_network_gateway.go @@ -141,8 +141,14 @@ func resourceArmLocalNetworkGatewayDelete(d *schema.ResourceData, meta interface name := id.Path["localNetworkGateways"] resGroup := id.ResourceGroup - _, error := lnetClient.Delete(resGroup, name, make(chan struct{})) + deleteResp, error := lnetClient.Delete(resGroup, name, make(chan struct{})) + resp := <-deleteResp err = <-error + + if resp.StatusCode == http.StatusNotFound { + return nil + } + if err != nil { return fmt.Errorf("Error issuing Azure ARM delete request of local network gateway '%s': %s", name, err) } diff --git a/builtin/providers/azurerm/resource_arm_local_network_gateway_test.go b/builtin/providers/azurerm/resource_arm_local_network_gateway_test.go index a134614c52..13d5b336d4 100644 --- a/builtin/providers/azurerm/resource_arm_local_network_gateway_test.go +++ b/builtin/providers/azurerm/resource_arm_local_network_gateway_test.go @@ -5,6 +5,7 @@ import ( "net/http" "testing" + "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) @@ -12,13 +13,14 @@ import ( func TestAccAzureRMLocalNetworkGateway_basic(t *testing.T) { name := "azurerm_local_network_gateway.test" + rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testCheckAzureRMLocalNetworkGatewayDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMLocalNetworkGatewayConfig_basic, + Config: testAccAzureRMLocalNetworkGatewayConfig_basic(rInt), Check: resource.ComposeTestCheckFunc( testCheckAzureRMLocalNetworkGatewayExists(name), resource.TestCheckResourceAttr(name, "gateway_address", "127.0.0.1"), @@ -31,6 +33,7 @@ func TestAccAzureRMLocalNetworkGateway_basic(t *testing.T) { func TestAccAzureRMLocalNetworkGateway_disappears(t *testing.T) { name := "azurerm_local_network_gateway.test" + rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -38,7 +41,7 @@ func TestAccAzureRMLocalNetworkGateway_disappears(t *testing.T) { CheckDestroy: testCheckAzureRMLocalNetworkGatewayDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMLocalNetworkGatewayConfig_basic, + Config: testAccAzureRMLocalNetworkGatewayConfig_basic(rInt), Check: resource.ComposeTestCheckFunc( testCheckAzureRMLocalNetworkGatewayExists(name), resource.TestCheckResourceAttr(name, "gateway_address", "127.0.0.1"), @@ -146,17 +149,19 @@ func testCheckAzureRMLocalNetworkGatewayDestroy(s *terraform.State) error { return nil } -var testAccAzureRMLocalNetworkGatewayConfig_basic = ` +func testAccAzureRMLocalNetworkGatewayConfig_basic(rInt int) string { + return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "tftestingResourceGroup" + name = "acctest-%d" location = "West US" } resource "azurerm_local_network_gateway" "test" { - name = "tftestingLocalNetworkGateway" + name = "acctestlng-%d" location = "${azurerm_resource_group.test.location}" resource_group_name = "${azurerm_resource_group.test.name}" gateway_address = "127.0.0.1" address_space = ["127.0.0.0/8"] } -` +`, rInt, rInt) +} diff --git a/builtin/providers/azurerm/resource_arm_virtual_machine_test.go b/builtin/providers/azurerm/resource_arm_virtual_machine_test.go index c44c22f482..33010eaf95 100644 --- a/builtin/providers/azurerm/resource_arm_virtual_machine_test.go +++ b/builtin/providers/azurerm/resource_arm_virtual_machine_test.go @@ -1018,7 +1018,7 @@ resource "azurerm_virtual_machine" "test" { name = "osd-%d" caching = "ReadWrite" create_option = "FromImage" - disk_size_gb = "10" + disk_size_gb = "50" managed_disk_type = "Standard_LRS" } @@ -1089,7 +1089,7 @@ resource "azurerm_virtual_machine" "test" { name = "osd-%d" caching = "ReadWrite" create_option = "FromImage" - disk_size_gb = "10" + disk_size_gb = "50" } os_profile { @@ -1168,7 +1168,7 @@ resource "azurerm_virtual_machine" "test" { name = "osd-%d" caching = "ReadWrite" create_option = "FromImage" - disk_size_gb = "10" + disk_size_gb = "50" managed_disk_type = "Standard_LRS" } diff --git a/website/source/docs/providers/azurerm/r/container_registry.html.markdown b/website/source/docs/providers/azurerm/r/container_registry.html.markdown index 159a20b614..b71959ce29 100644 --- a/website/source/docs/providers/azurerm/r/container_registry.html.markdown +++ b/website/source/docs/providers/azurerm/r/container_registry.html.markdown @@ -58,7 +58,7 @@ The following arguments are supported: * `storage_account` - (Required) A Storage Account block as documented below - which must be located in the same data center as the Container Registry. -* `sku` - (Required) The SKU name of the the container registry. `Basic` is the only acceptable value at this time. +* `sku` - (Optional) The SKU name of the the container registry. `Basic` is the only acceptable value at this time. * `tags` - (Optional) A mapping of tags to assign to the resource.