Skip to content

Commit

Permalink
Merge pull request #1 from terraform-providers/master
Browse files Browse the repository at this point in the history
pull
  • Loading branch information
lrxtom2 authored Jun 10, 2018
2 parents a4001cf + 07622b7 commit 8f6b05f
Show file tree
Hide file tree
Showing 151 changed files with 6,574 additions and 3,531 deletions.
29 changes: 26 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
## 1.7.0 (Unreleased)

UPGRADE NOTES:

~> **Please Note:** The field `overprovision` on the `azurerm_virtual_machine_scale_set` resource has changed from `false` to `true` to match the behaviour of Azure in this release. [GH-1322]

BUG FIXES:

* `azurerm_public_ip` - import not correctly reads the `domain_name_label` property into state [GH-1287]
* `azurerm_kubernetes_cluster` - `dns_prefix` is now required [GH-1333]
* `azurerm_network_interface` - ensuring that Public IP's/Private IP Addresses can be removed once assigned [GH-1295]
* `azurerm_public_ip` - setting the `domain_name_label` property into state [GH-1287]
* `azurerm_virtual_machine_scale_set` - the field `overprovision` has been updated to `true` by default rather than `false` to match Azure [GH-1322]
* `resource_arm_app_service_plan` - validation will now allow understores in the `name` property [GH-1351]

FEATURES:

* `azurerm_virtual_machine` - support for `write_accelerator_enabled` on Premium disks attached to MS-series machines [GH-964]

IMPROVEMENTS:

* `azurerm_dns_ns_record` - deprecated `record` properties in favor of a `records` list [GH-991]
* `azurerm_function_app` - adding the `identity` property [GH-1369]
* `azurerm_storage_account` - adding the `network_rules` property [GH-1334]
* `azurerm_virtual_machine_scale_set` - adding the `dns_settings` and `dns_servers` property [GH-1209]
* `azurerm_virtual_machine_scale_set` - adding the `ip_forwarding` property [GH-1209]
* dependencies: migrating to the un-deprecated Preview's for Container Instance, EventGrid, Log Analytics and SQL [GH-1322]
* dependencies: upgrading to `2018-01-01` of the EventGrid API [GH-1322]
* dependencies: upgrading to `2018-03-01` of the Monitor API [GH-1322]

## 1.6.0 (May 24, 2018)

Expand Down Expand Up @@ -157,7 +180,7 @@ IMPROVEMENTS:
* `azurerm_app_service` - allow changing `client_affinity_enabled` without requiring a resource recreation ([#993](https://github.com/terraform-providers/terraform-provider-azurerm/issues/993))
* `azurerm_app_service` - support for configuring `LocalSCM` source control ([#826](https://github.com/terraform-providers/terraform-provider-azurerm/issues/826))
* `azurerm_app_service` - returning a clearer error message when the name (which needs to be globally unique) is in use ([#1037](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1037))
* `azurerm_cosmosdb_account` - increasing the maximum value for `max_interval_in_seconds` from 100s to 86400s (1 day) [[#1000](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1000)]
* `azurerm_cosmosdb_account` - increasing the maximum value for `max_interval_in_seconds` from 100s to 86400s (1 day) [[#1000](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1000)]
* `azurerm_function_app` - returning a clearer error message when the name (which needs to be globally unique) is in use ([#1037](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1037))
* `azurerm_network_interface` - support for attaching to Application Gateways ([#1027](https://github.com/terraform-providers/terraform-provider-azurerm/issues/1027))
* `azurerm_traffic_manager_endpoint` - adding support for `geo_mappings` ([#986](https://github.com/terraform-providers/terraform-provider-azurerm/issues/986))
Expand Down Expand Up @@ -335,4 +358,4 @@ IMPROVEMENTS:
* core - Upgrading `Azure/azure-sdk-for-go` to v11.2.2-beta ([#594](https://github.com/terraform-providers/terraform-provider-azurerm/issues/594))
* core - upgrading `Azure/go-autorest` to v9.5.2 ([#617](https://github.com/terraform-providers/terraform-provider-azurerm/issues/617))
* core - skipping Resource Provider Registration in AutoRest when opted-out ([#630](https://github.com/terraform-providers/terraform-provider-azurerm/issues/630))
* `azurerm_app_service` - exposing the Default Hostname as a Computed field
* `azurerm_app_service` - exposing the Default Hostname as a Computed field
12 changes: 6 additions & 6 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,26 @@ import (
"github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation"
"github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute"
"github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance"
"github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-04-01/containerinstance"
"github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry"
"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/eventgrid/mgmt/2017-09-15-preview/eventgrid"
"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"
"github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices"
keyVault "github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault"
"github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault"
"github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights"
"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/operationalinsights/mgmt/2015-11-01-preview/operationalinsights"
"github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement"
"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"
"github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement"
"github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql"
"github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2016-06-01/recoveryservices"
"github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2018-03-01/redis"
"github.com/Azure/azure-sdk-for-go/services/relay/mgmt/2017-04-01/relay"
Expand All @@ -43,7 +44,6 @@ import (
"github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler"
"github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search"
"github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus"
"github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage"
"github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager"
"github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web"
Expand Down
25 changes: 25 additions & 0 deletions azurerm/import_arm_storage_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,28 @@ func TestAccAzureRMStorageAccount_importEnableHttpsTrafficOnly(t *testing.T) {
},
})
}

func TestAccAzureRMStorageAccount_importNetworkRules(t *testing.T) {
resourceName := "azurerm_storage_account.testsa"

ri := acctest.RandInt()
rs := acctest.RandString(4)
config := testAccAzureRMStorageAccount_networkRules(ri, rs, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMStorageAccountDestroy,
Steps: []resource.TestStep{
{
Config: config,
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
4 changes: 2 additions & 2 deletions azurerm/resource_arm_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ func flattenAzureRmAppServiceMachineIdentity(identity *web.ManagedServiceIdentit
func validateAppServiceName(v interface{}, k string) (ws []string, es []error) {
value := v.(string)

if matched := regexp.MustCompile(`^[0-9a-zA-Z-]+$`).Match([]byte(value)); !matched {
es = append(es, fmt.Errorf("%q may only contain alphanumeric characters and dashes", k))
if matched := regexp.MustCompile(`^[0-9a-zA-Z-]{1,60}$`).Match([]byte(value)); !matched {
es = append(es, fmt.Errorf("%q may only contain alphanumeric characters and dashes and up to 60 characters in length", k))
}

return
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_app_service_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ func flattenAppServiceProperties(props *web.AppServicePlanProperties) []interfac
func validateAppServicePlanName(v interface{}, k string) (ws []string, es []error) {
value := v.(string)

if matched := regexp.MustCompile(`^[0-9a-zA-Z-]+$`).Match([]byte(value)); !matched {
es = append(es, fmt.Errorf("%q may only contain alphanumeric characters and dashes", k))
if matched := regexp.MustCompile(`^[0-9a-zA-Z-_]{1,60}$`).Match([]byte(value)); !matched {
es = append(es, fmt.Errorf("%q may only contain alphanumeric characters, dashes and underscores up to 60 characters in length", k))
}

return
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_app_service_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestAzureRMAppServicePlanName_validation(t *testing.T) {
},
{
Value: "hello_world",
ErrCount: 1,
ErrCount: 0,
},
{
Value: "helloworld21!",
Expand Down
145 changes: 145 additions & 0 deletions azurerm/resource_arm_cdn_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,69 @@ func TestAccAzureRMCdnEndpoint_withGeoFilters(t *testing.T) {
},
})
}
func TestAccAzureRMCdnEndpoint_fullFields(t *testing.T) {
resourceName := "azurerm_cdn_endpoint.test"
ri := acctest.RandInt()
config := testAccAzureRMCdnEndpoint_fullFields(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMCdnEndpointDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMCdnEndpointExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "is_http_allowed", "true"),
resource.TestCheckResourceAttr(resourceName, "is_https_allowed", "true"),
resource.TestCheckResourceAttr(resourceName, "origin_path", "/origin-path"),
resource.TestCheckResourceAttr(resourceName, "probe_path", "/origin-path/probe"),
resource.TestCheckResourceAttr(resourceName, "origin_host_header", "www.example.com"),
resource.TestCheckResourceAttr(resourceName, "optimization_type", "GeneralWebDelivery"),
resource.TestCheckResourceAttr(resourceName, "querystring_caching_behaviour", "UseQueryString"),
resource.TestCheckResourceAttr(resourceName, "content_types_to_compress.#", "1"),
resource.TestCheckResourceAttr(resourceName, "is_compression_enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "geo_filter.#", "1"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
resource.TestCheckResourceAttr(resourceName, "tags.environment", "Production"),
),
},
},
})
}

func TestAccAzureRMCdnEndpoint_isHttpAndHttpsAllowedUpdate(t *testing.T) {
resourceName := "azurerm_cdn_endpoint.test"
ri := acctest.RandInt()
location := testLocation()
config := testAccAzureRMCdnEndpoint_isHttpAndHttpsAllowed(ri, location, "true", "false")
updatedConfig := testAccAzureRMCdnEndpoint_isHttpAndHttpsAllowed(ri, location, "false", "true")

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMCdnEndpointDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMCdnEndpointExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "is_http_allowed", "true"),
resource.TestCheckResourceAttr(resourceName, "is_https_allowed", "false"),
),
},
{
Config: updatedConfig,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMCdnEndpointExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "is_http_allowed", "false"),
resource.TestCheckResourceAttr(resourceName, "is_https_allowed", "true"),
),
},
},
})
}

func testCheckAzureRMCdnEndpointExists(name string) resource.TestCheckFunc {
return func(s *terraform.State) error {
Expand Down Expand Up @@ -427,6 +490,7 @@ resource "azurerm_cdn_endpoint" "test" {
}
`, rInt, location, rInt, rInt)
}

func testAccAzureRMCdnEndpoint_optimized(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
Expand Down Expand Up @@ -459,3 +523,84 @@ resource "azurerm_cdn_endpoint" "test" {
}
`, rInt, location, rInt, rInt)
}

func testAccAzureRMCdnEndpoint_fullFields(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "%s"
}
resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard_Verizon"
}
resource "azurerm_cdn_endpoint" "test" {
name = "acctestcdnend%d"
profile_name = "${azurerm_cdn_profile.test.name}"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
is_http_allowed = true
is_https_allowed = true
content_types_to_compress = ["text/html"]
is_compression_enabled = true
querystring_caching_behaviour = "UseQueryString"
origin_host_header = "www.example.com"
optimization_type = "GeneralWebDelivery"
origin_path = "/origin-path"
probe_path = "/origin-path/probe"
origin {
name = "acceptanceTestCdnOrigin1"
host_name = "www.example.com"
https_port = 443
http_port = 80
}
geo_filter {
relative_path = "/some-example-endpoint"
action = "Allow"
country_codes = ["GB"]
}
tags {
environment = "Production"
}
}
`, rInt, location, rInt, rInt)
}

func testAccAzureRMCdnEndpoint_isHttpAndHttpsAllowed(rInt int, location string, isHttpAllowed string, isHttpsAllowed string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "%s"
}
resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard_Verizon"
}
resource "azurerm_cdn_endpoint" "test" {
name = "acctestcdnend%d"
profile_name = "${azurerm_cdn_profile.test.name}"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
is_http_allowed = %s
is_https_allowed = %s
origin {
name = "acceptanceTestCdnOrigin1"
host_name = "www.example.com"
https_port = 443
http_port = 80
}
}
`, rInt, location, rInt, rInt, isHttpAllowed, isHttpsAllowed)
}
66 changes: 66 additions & 0 deletions azurerm/resource_arm_cdn_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,56 @@ func TestAccAzureRMCdnProfile_NonStandardCasing(t *testing.T) {
})
}

func TestAccAzureRMCdnProfile_basicToStandardAkamai(t *testing.T) {
resourceName := "azurerm_cdn_profile.test"
ri := acctest.RandInt()
preConfig := testAccAzureRMCdnProfile_basic(ri, testLocation())
postConfig := testAccAzureRMCdnProfile_standardAkamai(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMCdnProfileDestroy,
Steps: []resource.TestStep{
{
Config: preConfig,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMCdnProfileExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "sku", "Standard_Verizon"),
),
},
{
Config: postConfig,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMCdnProfileExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "sku", "Standard_Akamai"),
),
},
},
})
}

func TestAccAzureRMCdnProfile_standardAkamai(t *testing.T) {
resourceName := "azurerm_cdn_profile.test"
ri := acctest.RandInt()
config := testAccAzureRMCdnProfile_standardAkamai(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMCdnProfileDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMCdnProfileExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "sku", "Standard_Akamai"),
),
},
},
})
}

func testCheckAzureRMCdnProfileExists(name string) resource.TestCheckFunc {
return func(s *terraform.State) error {
// Ensure we have enough information in state to look up in API
Expand Down Expand Up @@ -266,3 +316,19 @@ resource "azurerm_cdn_profile" "test" {
}
`, rInt, location, rInt)
}

func testAccAzureRMCdnProfile_standardAkamai(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "%s"
}
resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard_Akamai"
}
`, rInt, location, rInt)
}
2 changes: 1 addition & 1 deletion azurerm/resource_arm_container_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance"
"github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-04-01/containerinstance"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
Expand Down
Loading

0 comments on commit 8f6b05f

Please sign in to comment.