Skip to content

Commit

Permalink
Merge pull request #1 from terraform-providers/master
Browse files Browse the repository at this point in the history
Sync master from Terraform head
  • Loading branch information
ghostinthewires authored Jan 23, 2019
2 parents 55068f0 + 8983a66 commit 7c164f7
Show file tree
Hide file tree
Showing 836 changed files with 31,476 additions and 151,478 deletions.
3 changes: 1 addition & 2 deletions .gometalinter.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
"gotype",
"ineffassign",
"interfacer",
"megacheck",
"nakedret",
"misspell",
"staticcheck",
"structcheck",
"unparam",
"unconvert",
"unused",
"varcheck",
"vet",
"vetshadow"
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ install:

script:
- make test
- make vendor-status
- make lint
- make website-test

Expand Down
18 changes: 14 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
## 2.0.0 (Unreleased)
## 1.22.0 (Unreleased)

FEATURES:

* **New Resource:** `azurerm_ddos_protection_plan` [GH-2654]

IMPROVEMENTS:

* dependencies: switching to Go Modules [GH-2705]
* `azurerm_application_gateway` - support for the `http2` property [GH-2735]
* `azurerm_application_gateway` - support for the `file_upload_limit_mb` property [GH-2666]
* `azurerm_application_gateway` - Support for `pick_host_name_from_backend_address` and `pick_host_name_from_backend_http_settings` properties [GH-2658]
* `azurerm_cosmosdb_account` - support for the `EnableAggregationPipeline`, `MongoDBv3.4` and ` mongoEnableDocLevelTTL` capabilities [GH-2715]
* `azurerm_data_lake_store_file` - support file uploads greater then 4 megabytes [GH-2633]
* `azurerm_mssql_elasticpool` - support for setting `max_size_bytes` [GH-2346]
* `azurerm_signalr_service` - exporting `primary_access_key`, `secondary_access_key`, `primary_connection_string` and `secondary_connection_string` and secondary access keys and connection strings [GH-2655]
* `azurerm_subnet` - support for additional subnet delegation types [GH-2667]
* `azurerm_application_gateway` - support for the `file_upload_limit_mb` property [GH-2666]
: Adding upload limit

BUG FIXES:

* `azurerm_azuread_application` - fixing a bug where `reply_uris` was set incorrectly [GH-2729]
* `azurerm_batch_pool` - can now set multiple environment variables [GH-2685]
* `azurerm_cosmosdb_account` - prevent occasional error when deleting the resource [GH-2702]
* `azurerm_cosmosdb_account` - allow empty values for the `ip_range_filter` property [GH-2713]
* `azurerm_express_route_circuit` - added the `premium` SKU back to validation logic [GH-2692]
* `azurerm_firewall` - ensuring rules aren't removed during an update [GH-2663]
* service bus subscription name's can now start with a digit [GH-2672]
* `azurerm_notification_hub_namespace` - now polls on creation to handle eventual consistency [GH-2701]
* `azurerm_service_bus_subscription` - name's can now start with a digit [GH-2672]
* `azurerm_security_center` - increase the creation timeout to `30m` [GH-2724]

## 1.21.0 (January 11, 2019)

Expand Down
16 changes: 8 additions & 8 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ PKG_NAME=azurerm

#make sure we catch schema errors during testing
TF_SCHEMA_PANIC_ON_ERROR=1
GO111MODULE=on
GOFLAGS=-mod=vendor

default: build

Expand All @@ -30,7 +32,8 @@ debugacc: fmtcheck

fmt:
@echo "==> Fixing source code with gofmt..."
gofmt -s -w ./$(PKG_NAME)
# This logic should match the search logic in scripts/gofmtcheck.sh
gofmt -s -w `find . -name '*.go' | grep -v vendor`

# Currently required by tf-deploy compile
fmtcheck:
Expand All @@ -46,12 +49,9 @@ lint:

tools:
@echo "==> installing required tooling..."
go get -u github.com/kardianos/govendor
go get -u github.com/alecthomas/gometalinter
gometalinter --install

vendor-status:
@govendor status
@sh "$(CURDIR)/scripts/gogetcookie.sh"
GO111MODULE=off go get -u github.com/alecthomas/gometalinter
GO111MODULE=off gometalinter --install

test-compile:
@if [ "$(TEST)" = "./..." ]; then \
Expand All @@ -75,4 +75,4 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build build-docker test test-docker testacc vet fmt fmtcheck errcheck vendor-status test-compile website website-test
.PHONY: build build-docker test test-docker testacc vet fmt fmtcheck errcheck test-compile website website-test
69 changes: 0 additions & 69 deletions azurerm/azurerm_sweeper_test.go

This file was deleted.

7 changes: 4 additions & 3 deletions azurerm/helpers/azure/batch_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,11 @@ func ExpandBatchPoolStartTask(list []interface{}) (*batch.StartTask, error) {
envSettings := make([]batch.EnvironmentSetting, 0)

for k, v := range envMap {
envValue := v.(string)
theValue := v.(string)
theKey := k
envSetting := batch.EnvironmentSetting{
Name: &k,
Value: &envValue,
Name: &theKey,
Value: &theValue,
}

envSettings = append(envSettings, envSetting)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/helpers/suppress/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import (
)

func CaseDifference(_, old, new string, _ *schema.ResourceData) bool {
return strings.ToLower(old) == strings.ToLower(new)
return strings.EqualFold(old, new)
}
13 changes: 0 additions & 13 deletions azurerm/loadbalancer.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package azurerm

import (
"context"
"fmt"
"net/http"
"regexp"
"strings"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-08-01/network"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
)

Expand Down Expand Up @@ -127,17 +125,6 @@ func findLoadBalancerProbeByName(lb *network.LoadBalancer, name string) (*networ
return nil, -1, false
}

func loadbalancerStateRefreshFunc(ctx context.Context, client network.LoadBalancersClient, resourceGroupName string, loadbalancer string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
res, err := client.Get(ctx, resourceGroupName, loadbalancer, "")
if err != nil {
return nil, "", fmt.Errorf("Error issuing read request in loadbalancerStateRefreshFunc to Azure ARM for Load Balancer '%s' (RG: '%s'): %s", loadbalancer, resourceGroupName, err)
}

return res, *res.LoadBalancerPropertiesFormat.ProvisioningState, nil
}
}

func validateLoadBalancerPrivateIpAddressAllocation(v interface{}, _ string) (warnings []string, errors []error) {
value := strings.ToLower(v.(string))
if value != "static" && value != "dynamic" {
Expand Down
22 changes: 16 additions & 6 deletions azurerm/logic_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ import (

"github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2016-06-01/logic"
"github.com/hashicorp/terraform/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

// NOTE: this file is not a recommended way of developing Terraform resources; this exists to work around the fact that this API is dynamic (by it's nature)

func resourceLogicAppActionUpdate(d *schema.ResourceData, meta interface{}, logicAppId string, name string, vals map[string]interface{}) error {
return resourceLogicAppComponentUpdate(d, meta, "Action", "actions", logicAppId, name, vals)
func resourceLogicAppActionUpdate(d *schema.ResourceData, meta interface{}, logicAppId string, name string, vals map[string]interface{}, resourceName string) error {
return resourceLogicAppComponentUpdate(d, meta, "Action", "actions", logicAppId, name, vals, resourceName)
}

func resourceLogicAppTriggerUpdate(d *schema.ResourceData, meta interface{}, logicAppId string, name string, vals map[string]interface{}) error {
return resourceLogicAppComponentUpdate(d, meta, "Trigger", "triggers", logicAppId, name, vals)
func resourceLogicAppTriggerUpdate(d *schema.ResourceData, meta interface{}, logicAppId string, name string, vals map[string]interface{}, resourceName string) error {
return resourceLogicAppComponentUpdate(d, meta, "Trigger", "triggers", logicAppId, name, vals, resourceName)
}

func resourceLogicAppComponentUpdate(d *schema.ResourceData, meta interface{}, kind string, propertyName string, logicAppId string, name string, vals map[string]interface{}) error {
func resourceLogicAppComponentUpdate(d *schema.ResourceData, meta interface{}, kind string, propertyName string, logicAppId string, name string, vals map[string]interface{}, resourceName string) error {
client := meta.(*ArmClient).logicWorkflowsClient
ctx := meta.(*ArmClient).StopContext

Expand Down Expand Up @@ -54,8 +55,17 @@ func resourceLogicAppComponentUpdate(d *schema.ResourceData, meta interface{}, k
return fmt.Errorf("[ERROR] Error parsing Logic App Workflow - `WorkflowProperties.Definition` is nil")
}

resourceId := fmt.Sprintf("%s/%s/%s", *read.ID, propertyName, name)

definition := read.WorkflowProperties.Definition.(map[string]interface{})
vs := definition[propertyName].(map[string]interface{})

if requireResourcesToBeImported {
if _, hasExisting := vs[name]; hasExisting {
return tf.ImportAsExistsError(resourceName, resourceId)
}
}

vs[name] = vals
definition[propertyName] = vs

Expand All @@ -73,7 +83,7 @@ func resourceLogicAppComponentUpdate(d *schema.ResourceData, meta interface{}, k
}

if d.IsNewResource() {
d.SetId(fmt.Sprintf("%s/%s/%s", *read.ID, propertyName, name))
d.SetId(resourceId)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func Provider() terraform.ResourceProvider {
"azurerm_data_lake_store_firewall_rule": resourceArmDataLakeStoreFirewallRule(),
"azurerm_data_lake_store": resourceArmDataLakeStore(),
"azurerm_databricks_workspace": resourceArmDatabricksWorkspace(),
"azurerm_ddos_protection_plan": resourceArmDDoSProtectoinPlan(),
"azurerm_ddos_protection_plan": resourceArmDDoSProtectionPlan(),
"azurerm_dev_test_lab": resourceArmDevTestLab(),
"azurerm_dev_test_linux_virtual_machine": resourceArmDevTestLinuxVirtualMachine(),
"azurerm_dev_test_policy": resourceArmDevTestPolicy(),
Expand Down
Loading

0 comments on commit 7c164f7

Please sign in to comment.