Skip to content

Commit baa8d11

Browse files
Merge branch 'hashicorp:main' into fix-dv-hp-regtoken
2 parents f59d172 + f5f4260 commit baa8d11

File tree

563 files changed

+63847
-25401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

563 files changed

+63847
-25401
lines changed

.github/workflows/depscheck.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-go@v2
1919
with:
20-
go-version: '1.16.7'
20+
go-version: '1.17.3'
2121
- run: bash scripts/gogetcookie.sh
2222
- run: make tools
2323
- run: make depscheck

.github/workflows/gencheck.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v2
1616
- uses: actions/setup-go@v2
1717
with:
18-
go-version: '1.16.7'
18+
go-version: '1.17.3'
1919
- run: bash scripts/gogetcookie.sh
2020
- run: make tools
2121
- run: make gencheck

.github/workflows/golint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-go@v2
1919
with:
20-
go-version: '1.16.7'
20+
go-version: '1.17.3'
2121
- uses: golangci/golangci-lint-action@v2
2222
with:
2323
version: 'v1.41.1'

.github/workflows/gradually-deprecated.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
fetch-depth: 0
1818
- uses: actions/setup-go@v2
1919
with:
20-
go-version: '1.16.7'
20+
go-version: '1.17.3'
2121
- run: ./scripts/run-gradually-deprecated.sh

.github/workflows/link-milestone.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v2
2020
- uses: actions/setup-go@v2
2121
with:
22-
go-version: '1.16.7'
22+
go-version: '1.17.3'
2323
- run: |
2424
go install github.com/stephybun/link-milestone@latest
2525
link-milestone

.github/workflows/tflint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-go@v2
1919
with:
20-
go-version: '1.16.7'
20+
go-version: '1.17.3'
2121
- run: bash scripts/gogetcookie.sh
2222
- run: make tools
2323
- run: make tflint

.github/workflows/thirty-two-bit.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-go@v2
1919
with:
20-
go-version: '1.16.7'
20+
go-version: '1.17.3'
2121
- run: bash scripts/gogetcookie.sh
2222
- run: make tools
2323
- run: GOARCH=386 GOOS=linux go build -o 32bitbuild .

.github/workflows/unit-test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-go@v2
1919
with:
20-
go-version: '1.16.7'
20+
go-version: '1.17.3'
2121
- run: bash scripts/gogetcookie.sh
2222
- run: make test
2323
env:

.github/workflows/validate-examples.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-go@v2
1818
with:
19-
go-version: '1.16.7'
19+
go-version: '1.17.3'
2020
- run: bash scripts/gogetcookie.sh
2121
- run: make tools
2222
- run: make validate-examples

.github/workflows/website-lint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-go@v2
1818
with:
19-
go-version: '1.16.7'
19+
go-version: '1.17.3'
2020
- run: bash scripts/gogetcookie.sh
2121
- run: make tools
2222
- run: make website-lint

.go-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.16.7
1+
1.17.3

CHANGELOG.md

+46-15
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,58 @@
1-
## 2.85.0 (Unreleased)
1+
## 2.86.0 (Unreleased)
2+
3+
IMPROVEMENTS:
4+
5+
* compute: updating to use API Version `2021-07-01` [GH-14174]
6+
* databricks: updating the embedded SDK to use the new Resource ID Parsers [GH-14157]
7+
* datalake: updating the embedded SDK to use the new Resource ID Parsers [GH-14158]
8+
* maps: updating the embedded SDK to use the new Resource ID Parsers [GH-14155]
9+
* powerbi: updating the embedded SDK to use the new Resource ID Parsers [GH-14154]
10+
* relay: updating the embedded SDK to use the new Resource ID Parsers [GH-14153]
11+
* signalr: updating the embedded SDK to use the new Resource ID Parsers [GH-14150]
12+
* storage: updating to use API Version `2021-04-01` [GH-14083]
13+
* videoanalyzer: updating the embedded SDK to use the new Resource ID Parsers [GH-14135]
14+
* `azurerm_orchestrated_virtual_machine_scale_set` - added support for VMSS Flex public preview [GH-14003]
15+
* `azurerm_machine_learning_workspace` - support for the `encryption` block [GH-14120]
16+
17+
BUG FIXES:
18+
19+
* `azurerm_linux_virtual_machine_scale_set` - `source_image_reference.offer` and `source_image_reference.publisher` are now ForceNew [GH-14165]
20+
* `azurerm_windows_virtual_machine_scale_set` - `source_image_reference.offer` and `source_image_reference.publisher` are now ForceNew [GH-14165]
21+
* `azurerm_network_watcher_flow_log` - now locks on the network security group to prevent `AnotherOperationInProgress` errors [GH-14160]
22+
23+
## 2.85.0 (November 12, 2021)
224

325
FEATURES:
426

5-
* **New Data Source:** `azurerm_batch_application` [GH-14043]
27+
* **New Data Source:** `azurerm_batch_application` ([#14043](https://github.com/hashicorp/terraform-provider-azurerm/issues/14043))
28+
* **New Resource:** `azurerm_monitor_private_link_scope` ([#14098](https://github.com/hashicorp/terraform-provider-azurerm/issues/14098))
29+
* **New Resource:** `azurerm_mysql_flexible_server_firewall_rule` ([#14136](https://github.com/hashicorp/terraform-provider-azurerm/issues/14136))
30+
* **New Resource:** `azurerm_synapse_workspace_aad_admin` ([#13600](https://github.com/hashicorp/terraform-provider-azurerm/issues/13600))
631

732
IMPROVEMENTS:
833

9-
* dependencies: upgrading to `v0.17.0` of `github.com/hashicorp/go-azure-helpers` [GH-14060]
10-
* dependencies: upgrading to `v2.8.0` of `github.com/hashicorp/terraform-plugin-sdk` [GH-14060]
11-
* `azurerm_application_insights` - support for the `internet_ingestion_enabled` and `internet_query_enabled` properties [GH-14035]
12-
* `azurerm_security_center_subscription_pricing` - `resource_type` can now be set to `OpenSourceRelationalDatabases` [GH-14103]
34+
* dependencies: upgrading to `v0.17.1` of `github.com/hashicorp/go-azure-helpers` ([#14141](https://github.com/hashicorp/terraform-provider-azurerm/issues/14141))
35+
* dependencies: upgrading to `v2.8.0` of `github.com/hashicorp/terraform-plugin-sdk` ([#14060](https://github.com/hashicorp/terraform-provider-azurerm/issues/14060))
36+
* `azurerm_application_insights` - support for the `internet_ingestion_enabled` and `internet_query_enabled` properties ([#14035](https://github.com/hashicorp/terraform-provider-azurerm/issues/14035))
37+
* `azurerm_backup_protected_vm` - support for the `exclude_disk_luns` and `include_disk_luns` properties ([#14097](https://github.com/hashicorp/terraform-provider-azurerm/issues/14097))
38+
* `azurerm_managed_disk_resource` - support for the `disk_iops_read_only` and `disk_mbps_read_only` properties ([#14025](https://github.com/hashicorp/terraform-provider-azurerm/issues/14025))
39+
* `azurerm_security_center_subscription_pricing` - `resource_type` can now be set to `OpenSourceRelationalDatabases` ([#14103](https://github.com/hashicorp/terraform-provider-azurerm/issues/14103))
40+
* `azurerm_storage_encryption_scope` - allow versionless `key_vault_key_id` ([#14085](https://github.com/hashicorp/terraform-provider-azurerm/issues/14085))
41+
* `azurerm_sql_managed_instance` - support for the `identity` block ([#14052](https://github.com/hashicorp/terraform-provider-azurerm/issues/14052))
42+
* `azurerm_virtual_network_gateway` - enable configuration of an active-active zone redundant gateway with P2S ([#14124](https://github.com/hashicorp/terraform-provider-azurerm/issues/14124))
1343

1444
BUG FIXES:
1545

16-
* Data Source: `azurerm_redis_cache` - parsing the `subnet_id` response value case-insensitively [GH-14108]
17-
* Data Source: `azurerm_redis_cache` - ensuring that `shard_count` always has a value set [GH-14108]
18-
* Data Source: `azurerm_consumption_budget_resource_group` - add missing `threshold_type` property in the schema [GH-14125]
19-
* Data Source: `azurerm_consumption_budget_subscription` - add missing `threshold_type` property in the schema [GH-14125]
20-
* `azurerm_api_management_certificate` - set `subject` property from correct field [GH-14026]
21-
* `azurerm_app_service_virtual_network_swift_connection` - fixing a panic when checking for an existing resource during creation [GH-14070]
22-
* `azurerm_redis_cache` - parsing the `subnet_id` response value case-insensitively [GH-14108]
23-
* `azurerm_redis_cache` - ensuring that `shard_count` always has a value set [GH-14108]
24-
* `azurerm_storage_blob` - ensuring that `cache_control` is sent during updates [GH-14100]
46+
* Data Source: `azurerm_redis_cache` - parsing the `subnet_id` response value case-insensitively ([#14108](https://github.com/hashicorp/terraform-provider-azurerm/issues/14108))
47+
* Data Source: `azurerm_redis_cache` - ensuring that `shard_count` always has a value set ([#14108](https://github.com/hashicorp/terraform-provider-azurerm/issues/14108))
48+
* Data Source: `azurerm_consumption_budget_resource_group` - add missing `threshold_type` property in the schema ([#14125](https://github.com/hashicorp/terraform-provider-azurerm/issues/14125))
49+
* Data Source: `azurerm_consumption_budget_subscription` - add missing `threshold_type` property in the schema ([#14125](https://github.com/hashicorp/terraform-provider-azurerm/issues/14125))
50+
* `azurerm_api_management_certificate` - set `subject` property from correct field ([#14026](https://github.com/hashicorp/terraform-provider-azurerm/issues/14026))
51+
* `azurerm_app_service_virtual_network_swift_connection` - fixing a panic when checking for an existing resource during creation ([#14070](https://github.com/hashicorp/terraform-provider-azurerm/issues/14070))
52+
* `azurerm_frontdoor_resource` - route engines are no longer removed on update ([#14093](https://github.com/hashicorp/terraform-provider-azurerm/issues/14093))
53+
* `azurerm_redis_cache` - parsing the `subnet_id` response value case-insensitively ([#14108](https://github.com/hashicorp/terraform-provider-azurerm/issues/14108))
54+
* `azurerm_redis_cache` - ensuring that `shard_count` always has a value set ([#14108](https://github.com/hashicorp/terraform-provider-azurerm/issues/14108))
55+
* `azurerm_storage_blob` - ensuring that `cache_control` is sent during updates ([#14100](https://github.com/hashicorp/terraform-provider-azurerm/issues/14100))
2556

2657
## 2.84.0 (November 05, 2021)
2758

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Further [usage documentation is available on the Terraform website](https://regi
6161
## Developer Requirements
6262

6363
* [Terraform](https://www.terraform.io/downloads.html) version 0.12.x + (but 1.x is recommended)
64-
* [Go](https://golang.org/doc/install) version 1.16.x (to build the provider plugin)
64+
* [Go](https://golang.org/doc/install) version 1.17.x (to build the provider plugin)
6565

6666
### On Windows
6767

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/google/go-cmp v0.5.6
2020
github.com/google/uuid v1.1.2
2121
github.com/hashicorp/errwrap v1.1.0 // indirect
22-
github.com/hashicorp/go-azure-helpers v0.17.0
22+
github.com/hashicorp/go-azure-helpers v0.17.1
2323
github.com/hashicorp/go-getter v1.5.4
2424
github.com/hashicorp/go-hclog v0.16.1 // indirect
2525
github.com/hashicorp/go-multierror v1.1.1

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
249249
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
250250
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
251251
github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg=
252-
github.com/hashicorp/go-azure-helpers v0.17.0 h1:HQF6kVNzofmwOhbRK/h/RWEVl/zu6kjB6mjoIxFL0A0=
253-
github.com/hashicorp/go-azure-helpers v0.17.0/go.mod h1:L4ny2lW2muOESZR1XjbM59c3Pq+7SA9Yt1Nry5UfKZc=
252+
github.com/hashicorp/go-azure-helpers v0.17.1 h1:qkvhSgyPzK3UwWQDocGLFmZ9iRjTj1Dv4CzeyhwfoIs=
253+
github.com/hashicorp/go-azure-helpers v0.17.1/go.mod h1:L4ny2lW2muOESZR1XjbM59c3Pq+7SA9Yt1Nry5UfKZc=
254254
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
255255
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
256256
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=

helpers/azure/sku.go

+50
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import (
44
"fmt"
55
"strconv"
66
"strings"
7+
8+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute"
9+
"github.com/hashicorp/terraform-provider-azurerm/utils"
710
)
811

912
func SplitSku(sku string) (string, int32, error) {
@@ -20,3 +23,50 @@ func SplitSku(sku string) (string, int32, error) {
2023

2124
return skuParts[0], int32(capacity), nil
2225
}
26+
27+
func ExpandOrchestratedVirtualMachineScaleSetSku(input string, capacity int) (*compute.Sku, error) {
28+
skuParts := strings.Split(input, "_")
29+
30+
if len(skuParts) < 2 || strings.Contains(input, "__") || strings.Contains(input, " ") {
31+
return nil, fmt.Errorf("'sku_name'(%q) is not formatted properly.", input)
32+
}
33+
34+
sku := &compute.Sku{
35+
Name: utils.String(input),
36+
Capacity: utils.Int64(int64(capacity)),
37+
Tier: utils.String("Standard"),
38+
}
39+
40+
return sku, nil
41+
}
42+
43+
func FlattenOrchestratedVirtualMachineScaleSetSku(input *compute.Sku) (*string, error) {
44+
var skuName string
45+
if input != nil && input.Name != nil {
46+
if strings.HasPrefix(strings.ToLower(*input.Name), "standard") {
47+
skuName = *input.Name
48+
} else {
49+
skuName = fmt.Sprintf("Standard_%s", *input.Name)
50+
}
51+
52+
return &skuName, nil
53+
}
54+
55+
return nil, fmt.Errorf("Sku struct 'name' is nil")
56+
}
57+
58+
func ValidateOrchestratedVirtualMachineScaleSetSku(input interface{}, key string) (warnings []string, errors []error) {
59+
v, ok := input.(string)
60+
if !ok {
61+
errors = append(errors, fmt.Errorf("expected %q to be a string", key))
62+
return
63+
}
64+
65+
skuParts := strings.Split(v, "_")
66+
67+
if len(skuParts) < 2 || strings.Contains(v, "__") || strings.Contains(v, " ") {
68+
errors = append(errors, fmt.Errorf("%q(%q) is not formatted properly.", key, v))
69+
}
70+
71+
return
72+
}

internal/acceptance/testcase.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,23 @@ import (
1313
"github.com/hashicorp/terraform-provider-azurerm/internal/provider"
1414
)
1515

16-
// lintignore:AT001
1716
func (td TestData) DataSourceTest(t *testing.T, steps []TestStep) {
1817
// DataSources don't need a check destroy - however since this is a wrapper function
1918
// and not matching the ignore pattern `XXX_data_source_test.go`, this needs to be explicitly opted out
19+
20+
// lintignore:AT001
2021
testCase := resource.TestCase{
2122
PreCheck: func() { PreCheck(t) },
2223
Steps: steps,
2324
}
2425
td.runAcceptanceTest(t, testCase)
2526
}
2627

27-
// lintignore:AT001
2828
func (td TestData) DataSourceTestInSequence(t *testing.T, steps []TestStep) {
2929
// DataSources don't need a check destroy - however since this is a wrapper function
3030
// and not matching the ignore pattern `XXX_data_source_test.go`, this needs to be explicitly opted out
31+
32+
// lintignore:AT001
3133
testCase := resource.TestCase{
3234
PreCheck: func() { PreCheck(t) },
3335
Steps: steps,
@@ -36,7 +38,6 @@ func (td TestData) DataSourceTestInSequence(t *testing.T, steps []TestStep) {
3638
td.runAcceptanceSequentialTest(t, testCase)
3739
}
3840

39-
// lintignore:AT001
4041
func (td TestData) ResourceTest(t *testing.T, testResource types.TestResource, steps []TestStep) {
4142
testCase := resource.TestCase{
4243
PreCheck: func() { PreCheck(t) },
@@ -54,17 +55,17 @@ func (td TestData) ResourceTest(t *testing.T, testResource types.TestResource, s
5455

5556
// ResourceTestIgnoreCheckDestroyed skips the check to confirm the resource test has been destroyed.
5657
// This is done because certain resources can't actually be deleted.
57-
// lintignore:AT001
5858
func (td TestData) ResourceTestSkipCheckDestroyed(t *testing.T, steps []TestStep) {
59+
// lintignore:AT001
5960
testCase := resource.TestCase{
6061
PreCheck: func() { PreCheck(t) },
6162
Steps: steps,
6263
}
6364
td.runAcceptanceTest(t, testCase)
6465
}
6566

66-
// lintignore:AT001
6767
func (td TestData) ResourceSequentialTestSkipCheckDestroyed(t *testing.T, steps []TestStep) {
68+
// lintignore:AT001
6869
testCase := resource.TestCase{
6970
PreCheck: func() { PreCheck(t) },
7071
Steps: steps,
@@ -132,7 +133,7 @@ func (td TestData) providers() map[string]func() (*schema.Provider, error) {
132133
func (td TestData) externalProviders() map[string]resource.ExternalProvider {
133134
return map[string]resource.ExternalProvider{
134135
"azuread": {
135-
VersionConstraint: "=1.5.1",
136+
VersionConstraint: "=2.8.0",
136137
Source: "registry.terraform.io/hashicorp/azuread",
137138
},
138139
}

internal/services/apimanagement/api_management_api_operation_policy_resource.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ func resourceApiManagementApiOperationPolicy() *pluginsdk.Resource {
2323
Read: resourceApiManagementAPIOperationPolicyRead,
2424
Update: resourceApiManagementAPIOperationPolicyCreateUpdate,
2525
Delete: resourceApiManagementAPIOperationPolicyDelete,
26-
// TODO: replace this with an importer which validates the ID during import
27-
Importer: pluginsdk.DefaultImporter(),
26+
Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error {
27+
_, err := parse.ApiOperationPolicyID(id)
28+
return err
29+
}),
2830

2931
Timeouts: &pluginsdk.ResourceTimeout{
3032
Create: pluginsdk.DefaultTimeout(30 * time.Minute),

internal/services/apimanagement/api_management_api_operation_policy_resource_test.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66
"testing"
77

88
"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2020-12-01/apimanagement"
9-
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
109
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
1110
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
1211
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
12+
"github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse"
1313
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
1414
"github.com/hashicorp/terraform-provider-azurerm/utils"
1515
)
@@ -94,18 +94,14 @@ func TestAccApiManagementAPIOperationPolicy_rawXml(t *testing.T) {
9494
}
9595

9696
func (ApiManagementApiOperationPolicyResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
97-
id, err := azure.ParseAzureResourceID(state.ID)
97+
id, err := parse.ApiOperationPolicyID(state.ID)
9898
if err != nil {
9999
return nil, err
100100
}
101-
resourceGroup := id.ResourceGroup
102-
serviceName := id.Path["service"]
103-
apiName := id.Path["apis"]
104-
operationID := id.Path["operations"]
105101

106-
resp, err := clients.ApiManagement.ApiOperationPoliciesClient.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML)
102+
resp, err := clients.ApiManagement.ApiOperationPoliciesClient.Get(ctx, id.ResourceGroup, id.ServiceName, id.ApiName, id.OperationName, apimanagement.PolicyExportFormatXML)
107103
if err != nil {
108-
return nil, fmt.Errorf("reading ApiManagementApi Operation Policy (%s): %+v", id, err)
104+
return nil, fmt.Errorf("reading %s: %+v", *id, err)
109105
}
110106

111107
return utils.Bool(resp.ID != nil), nil

0 commit comments

Comments
 (0)