Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into b-image-osdisk_as_list
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed Jun 28, 2018
2 parents fce51c7 + 4f762df commit a9d730e
Show file tree
Hide file tree
Showing 136 changed files with 10,143 additions and 1,348 deletions.
32 changes: 22 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
## 1.8.0 (Unreleased)
## 1.9.0 (Unreleased)
## 1.8.0 (June 28, 2018)

FEATURES:

* **New Resource:** `azurerm_dns_caa_record` support ([#1450](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1450))
* **New Resource:** `azurerm_virtual_machine_data_disk_attachment` ([#1207](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1207))

IMPROVEMENTS:

* dependencies: upgrading to v10.11.4 of `Azure/go-autorest` [GH-1418]
* dependencies: upgrading to v17.4.0 of `Azure/azure-sdk-for-go` [GH-1418]
* `azurerm_log_analytics_solution` - support for Sovereign Clouds [GH-1410]
* `azurerm_log_analytics_workspace` - support for Sovereign Clouds [GH-1410]
* `azurerm_log_analytics_workspace` - support for the `PerGB2018` SKU [GH-1079]
* `azurerm_sql_database` - support for importing from a bacpac backup [GH-972]
* `azurerm_network_interface` - addtional validation on properties [GH-1403]
* `azurerm_arm_loadbalancer` - addtional validation on properties [GH-1403]
* dependencies: upgrading to v10.11.4 of `Azure/go-autorest` ([#1418](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1418))
* dependencies: upgrading to v17.4.0 of `Azure/azure-sdk-for-go` ([#1418](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1418))
* `azurerm_lb` - addtional validation on properties ([#1403](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1403))
* `azurerm_application_gateway` - support for the `match` block for Probes ([#1446](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1446))
* `azurerm_log_analytics_solution` - support for Sovereign Clouds ([#1410](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1410))
* `azurerm_log_analytics_workspace` - support for Sovereign Clouds ([#1410](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1410))
* `azurerm_log_analytics_workspace` - support for the `PerGB2018` SKU ([#1079](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1079))
* `azurerm_mysql_server` - `GeneralPurpose` and `MemoryOptimized` sku tiers now allow 4tb for the `storage_mb` property ([#1449](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1449))
* `azurerm_network_interface` - addtional validation on properties ([#1403](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1403))
* `azurerm_postgresql_server` - `GeneralPurpose` and `MemoryOptimized` sku tiers now allow 4tb for the `storage_mb` property ([#1449](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1449))
* `azurerm_postgresql_server` - adding support for version 10.0 ([#1457](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1457))
* `azurerm_route_table` - adding the disable BGP propagation property ([#1435](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1435))
* `azurerm_sql_database` - support for importing from a bacpac backup ([#972](https://github.com/terraform-providers/terraform-provider-azurerm/issues/972))
* `azurerm_virtual_machine` - support for setting the TimeZone on Windows ([#1265](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1265))

BUG FIXES:

* validation: ensuring IPv4/MAC addresses are detected correctly [GH-1431]
* validation: ensuring IPv4/MAC addresses are detected correctly ([#1431](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1431))

## 1.7.0 (June 16, 2018)

Expand Down
4 changes: 2 additions & 2 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice"
"github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb"
"github.com/Azure/azure-sdk-for-go/services/datalake/store/mgmt/2016-11-01/account"
"github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns"
"github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns"
"github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2018-01-01/eventgrid"
"github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub"
"github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac"
Expand All @@ -28,7 +28,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault"
"github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2018-03-01/insights"
"github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-12-01/mysql"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
"github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-12-01/postgresql"
"github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-01-01-preview/authorization"
"github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights"
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_dns_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns"
"github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns"
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources"
"github.com/hashicorp/terraform/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_public_ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package azurerm
import (
"fmt"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
"github.com/hashicorp/terraform/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_virtual_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package azurerm
import (
"fmt"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
"github.com/hashicorp/terraform/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/express_route_circuit.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package azurerm
import (
"fmt"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
"github.com/hashicorp/errwrap"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand Down
15 changes: 15 additions & 0 deletions azurerm/helpers/azure/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,18 @@ func ValidateResourceID(i interface{}, k string) (_ []string, errors []error) {

return
}

//true for a resource ID or an empty string
func ValidateResourceIDOrEmpty(i interface{}, k string) (_ []string, errors []error) {
v, ok := i.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected type of %q to be string", k))
return
}

if v == "" {
return
}

return ValidateResourceID(i, k)
}
31 changes: 31 additions & 0 deletions azurerm/helpers/azure/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,34 @@ func TestHelper_AzureResourceID(t *testing.T) {
})
}
}

func TestAzureResourceIDOrEmpty(t *testing.T) {
cases := []struct {
ID string
Errors int
}{
{
ID: "",
Errors: 0,
},
{
ID: "nonsense",
Errors: 1,
},
//as this function just calls TestAzureResourceId lets not be as comprehensive
{
ID: "/providers/provider.name/",
Errors: 0,
},
}

for _, tc := range cases {
t.Run(tc.ID, func(t *testing.T) {
_, errors := ValidateResourceIDOrEmpty(tc.ID, "test")

if len(errors) < tc.Errors {
t.Fatalf("Expected TestAzureResourceIdOrEmpty to have %d not %d errors for %q", tc.Errors, len(errors), tc.ID)
}
})
}
}
54 changes: 54 additions & 0 deletions azurerm/import_arm_dns_caa_record_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package azurerm

import (
"testing"

"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccAzureRMDnsCaaRecord_importBasic(t *testing.T) {
resourceName := "azurerm_dns_caa_record.test"

ri := acctest.RandInt()
config := testAccAzureRMDnsCaaRecord_basic(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMDnsCaaRecordDestroy,
Steps: []resource.TestStep{
{
Config: config,
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureRMDnsCaaRecord_importWithTags(t *testing.T) {
resourceName := "azurerm_dns_caa_record.test"

ri := acctest.RandInt()
config := testAccAzureRMDnsCaaRecord_withTags(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMDnsCaaRecordDestroy,
Steps: []resource.TestStep{
{
Config: config,
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
58 changes: 58 additions & 0 deletions azurerm/import_arm_virtual_machine_data_disk_attachment_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package azurerm

import (
"testing"

"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccAzureRMVirtualMachineDataDiskAttachment_importBasic(t *testing.T) {
resourceName := "azurerm_virtual_machine_data_disk_attachment.test"
ri := acctest.RandInt()
location := testLocation()
config := testAccAzureRMVirtualMachineDataDiskAttachment_basic(ri, location)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMVirtualMachineDataDiskAttachmentDestroy,
Steps: []resource.TestStep{
{
Config: config,
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureRMVirtualMachineDataDiskAttachment_importMultipleDisks(t *testing.T) {
ri := acctest.RandInt()
location := testLocation()
config := testAccAzureRMVirtualMachineDataDiskAttachment_multipleDisks(ri, location)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMVirtualMachineDataDiskAttachmentDestroy,
Steps: []resource.TestStep{
{
Config: config,
},
{
ResourceName: "azurerm_virtual_machine_data_disk_attachment.first",
ImportState: true,
ImportStateVerify: true,
},
{
ResourceName: "azurerm_virtual_machine_data_disk_attachment.second",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
2 changes: 1 addition & 1 deletion azurerm/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"regexp"
"strings"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
Expand Down
Loading

0 comments on commit a9d730e

Please sign in to comment.