Skip to content

Commit

Permalink
Merge branch 'main' into azurerm_communication_service_email_domain_a…
Browse files Browse the repository at this point in the history
…ssociation
  • Loading branch information
jkroepke authored Aug 5, 2024
2 parents 3072c8b + f988645 commit 29da675
Show file tree
Hide file tree
Showing 126 changed files with 3,897 additions and 1,090 deletions.
2 changes: 1 addition & 1 deletion .release/provider-schema.json

Large diffs are not rendered by default.

42 changes: 31 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
## 3.114.0 (Unreleased)
## 3.115.0 (Unreleased)

ENHANCEMENTS:

* `azurerm_cosmosdb_account` - avoid infinite diff to `default_identity_type` for legacy resources where an empty string is returned by the RP [GH-26525]
* `azurerm_monitor_data_collection_rule` - update `performance_counter.x.sampling_frequency_in_seconds` range `1` to `1800` [GH-26898]
* `azurerm_web_application_firewall_policy`: `excluded_rule_set.0.type` supports `Microsoft_BotManagerRuleSet` [GH-26903]

## 3.114.0 (August 01, 2024)

UPGRADE NOTES:
* **4.0 Beta:** This release includes a new feature-flag to opt-into the 4.0 Beta - which (when enabled) introduces a number of behavioural changes, field renames and removes some older deprecated resources and data sources. Please read the disclaimers carefully that are outlined in our [guide on how to opt-into the 4.0 Beta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/4.0-beta) before enabling this, as this will cause irreversible changes to your state. The 4.0 Beta is still a work-in-progress at this time and the changes listed in the [4.0 Upgrade Guide](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/4.0-upgrade-guide) may change. We're interested to hear your feedback which can be provided by following [this link](https://github.com/terraform-providers/terraform-provider-azurerm/issues/new?template=Beta_Feedback.md).

FEATURES:

* **New Resource:** `azurerm_stack_hci_logical_network` [GH-26473]
* **New Resource:** `azurerm_dev_center_network_connection` ([#26718](https://github.com/hashicorp/terraform-provider-azurerm/issues/26718))
* **New Resource:** `azurerm_stack_hci_logical_network` ([#26473](https://github.com/hashicorp/terraform-provider-azurerm/issues/26473))

ENHANCEMENTS:

* dependencies: updating `go-azure-helpers` to `v0.70.1` [GH-26757]
* `arckubernetes` - updating to use version `2024-01-01` [GH-26761]
* `data.azurerm_storage_account` - the `enable_https_traffic_only` property has been superseded by `https_traffic_only_enabled` [GH-26740]
* `azurerm_storage_account` - the `enable_https_traffic_only` property has been superseded by `https_traffic_only_enabled` [GH-26740]
* dependencies: updating `go-azure-helpers` to `v0.70.1` ([#26757](https://github.com/hashicorp/terraform-provider-azurerm/issues/26757))
* `arckubernetes` - updating to use version `2024-01-01` ([#26761](https://github.com/hashicorp/terraform-provider-azurerm/issues/26761))
* `data.azurerm_storage_account` - the `enable_https_traffic_only` property has been superseded by `https_traffic_only_enabled` ([#26740](https://github.com/hashicorp/terraform-provider-azurerm/issues/26740))
* `azurerm_log_analytics_cluster` - add support for setting `size_gb` to `100` [GH-#26865]
* `azurerm_storage_account` - the `enable_https_traffic_only` property has been superseded by `https_traffic_only_enabled` ([#26740](https://github.com/hashicorp/terraform-provider-azurerm/issues/26740))

BUG FIXES:

* `azurerm_dns_cname_record` - split create and update function to fix lifecycle - ignore [GH-26610]
* `azurerm_dns_srv_record` - split create and update function to fix lifecycle - ignore [GH-26627]
* `azurerm_linux_web_app` - correctly set `site_config.always_on` as configured during Update [GH-25753]
* `azurerm_linux_web_app_slot` - correctly set `site_config.always_on` as configured during Update [GH-25753]
* `azurerm_management_group_policy_remediation` - fix panic in deprecated schema change for 4.0 [GH-26767]
* `azurerm_dns_cname_record` - split create and update function to fix lifecycle - ignore ([#26610](https://github.com/hashicorp/terraform-provider-azurerm/issues/26610))
* `azurerm_dns_srv_record` - split create and update function to fix lifecycle - ignore ([#26627](https://github.com/hashicorp/terraform-provider-azurerm/issues/26627))
* `azurerm_kubernetes_cluster` - fix issue that prevented `max_count` from being updated ([#26417](https://github.com/hashicorp/terraform-provider-azurerm/issues/26417))
* `azurerm_linux_web_app` - correctly set `site_config.always_on` as configured during Update ([#25753](https://github.com/hashicorp/terraform-provider-azurerm/issues/25753))
* `azurerm_linux_web_app_slot` - correctly set `site_config.always_on` as configured during Update ([#25753](https://github.com/hashicorp/terraform-provider-azurerm/issues/25753))
* `azurerm_management_group_policy_remediation` - fix panic in deprecated schema change for 4.0 ([#26767](https://github.com/hashicorp/terraform-provider-azurerm/issues/26767))
* `azurerm_network_security_rule` - fix panic when updating `source_port_ranges` ([#26883](https://github.com/hashicorp/terraform-provider-azurerm/issues/26883))
* `azurerm_public_ip` - fix panix when updating `idle_timeout_in_minutes`

DEPRECATIONS:
* `azurerm_redis_cache` - `enable_non_ssl_port` has been superseded by `non_ssl_port_enabled` and `redis_configuration. enable_authentication` has been superseded by `redis_configuration.authentication_enabled` ([#26608](https://github.com/hashicorp/terraform-provider-azurerm/issues/26608))


## 3.113.0 (July 18, 2024)

Expand Down
21 changes: 11 additions & 10 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,21 @@ If you wish to work on the provider, you'll first need [Go](https://go.dev/) ins
First clone the repository to: `$GOPATH/src/github.com/hashicorp/terraform-provider-azurerm`

```sh
$ mkdir -p $GOPATH/src/github.com/hashicorp; cd $GOPATH/src/github.com/hashicorp
$ git clone git@github.com:hashicorp/terraform-provider-azurerm
$ cd $GOPATH/src/github.com/hashicorp/terraform-provider-azurerm
mkdir -p $GOPATH/src/github.com/hashicorp; cd $GOPATH/src/github.com/hashicorp
git clone git@github.com:hashicorp/terraform-provider-azurerm
cd $GOPATH/src/github.com/hashicorp/terraform-provider-azurerm
```

Once inside the provider directory, you can run `make tools` to install the dependent tooling required to compile the provider.

At this point you can compile the provider by running `make build`, which will build the provider and put the provider binary in the `$GOPATH/bin` directory.

```sh
$ make build
...
$ $GOPATH/bin/terraform-provider-azurerm
...
make build
# ... make output omitted ...
# The provider binary will be output to:
# $GOPATH/bin/terraform-provider-azurerm
# ...
```

You can also cross-compile if necessary:
Expand All @@ -63,7 +64,7 @@ GOOS=windows GOARCH=amd64 make build
In order to run the `Unit Tests` for the provider, you can run:

```sh
$ make test
make test
```

The majority of tests in the provider are `Acceptance Tests` - which provisions real resources in Azure. It's possible to run the entire acceptance test suite by running `make testacc` - however it's likely you'll want to run a subset, which you can do using a prefix, by running:
Expand Down Expand Up @@ -140,11 +141,11 @@ When `make generate` is run, this will then generate the following for this Reso
You can scaffold the documentation for a Data Source by running:

```sh
$ make scaffold-website BRAND_NAME="Resource Group" RESOURCE_NAME="azurerm_resource_group" RESOURCE_TYPE="data"
make scaffold-website BRAND_NAME="Resource Group" RESOURCE_NAME="azurerm_resource_group" RESOURCE_TYPE="data"
```

You can scaffold the documentation for a Resource by running:

```sh
$ make scaffold-website BRAND_NAME="Resource Group" RESOURCE_NAME="azurerm_resource_group" RESOURCE_TYPE="resource" RESOURCE_ID="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1"
make scaffold-website BRAND_NAME="Resource Group" RESOURCE_NAME="azurerm_resource_group" RESOURCE_TYPE="resource" RESOURCE_ID="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1"
```
17 changes: 5 additions & 12 deletions internal/acceptance/testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,14 @@ func (td TestData) DataSourceTestInSequence(t *testing.T, steps []TestStep) {
td.runAcceptanceSequentialTest(t, testCase)
}

var refreshStep = TestStep{
RefreshState: true,
}

func (td TestData) ResourceTest(t *testing.T, testResource types.TestResource, steps []TestStep) {
newSteps := make([]TestStep, 0)
for _, step := range steps {
if !step.ImportState {
newSteps = append(newSteps, step)
} else {
newSteps = append(newSteps, refreshStep)
newSteps = append(newSteps, step)
// Testing framework as of 1.6.0 no longer auto-refreshes state, so adding it back in here for all steps that update
// the config rather than having to modify 1000's of tests individually to add a refresh-only step
for index, step := range steps {
if !step.ImportState && index != 0 {
step.RefreshState = true
}
}
steps = newSteps

testCase := resource.TestCase{
PreCheck: func() { PreCheck(t) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ resource "azurerm_resource_group" "test" {
}
resource "azurerm_storage_account" "test" {
name = "accteststr%s"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
enable_https_traffic_only = false
account_tier = "Standard"
account_replication_type = "LRS"
name = "accteststr%s"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
https_traffic_only_enabled = false
account_tier = "Standard"
account_replication_type = "LRS"
}
data "azurerm_advisor_recommendations" "test" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ resource "azurerm_api_management_logger" "test" {
name = azurerm_eventhub.test.name
endpoint_uri = "${azurerm_eventhub_namespace.test.name}.servicebus.windows.net"
}
depends_on = [azurerm_role_assignment.test]
}
resource "azurerm_role_assignment" "test" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func TestAccAppServiceEnvironmentV3DataSource_basic(t *testing.T) {
check.That(data.ResourceName).Key("dns_suffix").HasValue(fmt.Sprintf("acctest-ase-%d.appserviceenvironment.net", data.RandomInteger)),
check.That(data.ResourceName).Key("ip_ssl_address_count").HasValue("0"),
check.That(data.ResourceName).Key("inbound_network_dependencies.#").HasValue("3"),
check.That(data.ResourceName).Key("linux_outbound_ip_addresses.#").HasValue("2"),
check.That(data.ResourceName).Key("location").HasValue(data.Locations.Primary),
check.That(data.ResourceName).Key("windows_outbound_ip_addresses.#").HasValue("2"),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func TestAccAppServiceEnvironmentV3_complete(t *testing.T) {
check.That(data.ResourceName).Key("cluster_setting.#").HasValue("3"),
check.That(data.ResourceName).Key("dns_suffix").HasValue(fmt.Sprintf("acctest-ase-%d.appserviceenvironment.net", data.RandomInteger)),
check.That(data.ResourceName).Key("inbound_network_dependencies.#").HasValue("3"),
check.That(data.ResourceName).Key("linux_outbound_ip_addresses.#").HasValue("2"),
check.That(data.ResourceName).Key("location").HasValue(data.Locations.Primary),
check.That(data.ResourceName).Key("windows_outbound_ip_addresses.#").HasValue("2"),
),
Expand Down
4 changes: 2 additions & 2 deletions internal/services/appservice/helpers/web_app_slot_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ func (s *SiteConfigLinuxWebAppSlot) DecodeDockerAppStack(input map[string]string

registryHost := trimURLScheme(applicationStack.DockerRegistryUrl)
dockerString := strings.TrimPrefix(s.LinuxFxVersion, "DOCKER|")
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost)
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost+"/")

s.ApplicationStack = []ApplicationStackLinux{applicationStack}
}
Expand Down Expand Up @@ -1471,7 +1471,7 @@ func (s *SiteConfigWindowsWebAppSlot) DecodeDockerAppStack(input map[string]stri

registryHost := trimURLScheme(applicationStack.DockerRegistryUrl)
dockerString := strings.TrimPrefix(s.WindowsFxVersion, "DOCKER|")
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost)
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost+"/")

s.ApplicationStack = []ApplicationStackWindows{applicationStack}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ func (s *SiteConfigWindows) DecodeDockerAppStack(input map[string]string) {

registryHost := trimURLScheme(applicationStack.DockerRegistryUrl)
dockerString := strings.TrimPrefix(s.WindowsFxVersion, "DOCKER|")
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost)
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost+"/")

s.ApplicationStack = []ApplicationStackWindows{applicationStack}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,11 +976,12 @@ resource "azurerm_linux_function_app" "test" {
}
}
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
worker_count = 3
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
health_check_eviction_time_in_min = 5
worker_count = 3
minimum_tls_version = "1.1"
scm_minimum_tls_version = "1.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3082,6 +3082,8 @@ resource "azurerm_linux_function_app" "test" {
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
health_check_eviction_time_in_min = 7
application_stack {
python_version = "3.9"
}
Expand Down
27 changes: 14 additions & 13 deletions internal/services/appservice/linux_web_app_slot_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1870,19 +1870,20 @@ resource "azurerm_linux_web_app_slot" "test" {
"third.aspx",
"hostingstart.html",
]
http2_enabled = true
scm_use_main_ip_restriction = true
local_mysql_enabled = true
managed_pipeline_mode = "Integrated"
remote_debugging_enabled = true
remote_debugging_version = "VS2022"
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health"
worker_count = 1
minimum_tls_version = "1.1"
scm_minimum_tls_version = "1.1"
http2_enabled = true
scm_use_main_ip_restriction = true
local_mysql_enabled = true
managed_pipeline_mode = "Integrated"
remote_debugging_enabled = true
remote_debugging_version = "VS2022"
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health"
health_check_eviction_time_in_min = 7
worker_count = 1
minimum_tls_version = "1.1"
scm_minimum_tls_version = "1.1"
cors {
allowed_origins = [
"http://www.contoso.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -919,11 +919,12 @@ resource "azurerm_windows_function_app" "test" {
}
}
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
worker_count = 3
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
health_check_eviction_time_in_min = 7
worker_count = 3
minimum_tls_version = "1.1"
scm_minimum_tls_version = "1.1"
Expand Down
14 changes: 12 additions & 2 deletions internal/services/automation/automation_certificate_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2023-11-01/certificate"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
)

func resourceAutomationCertificate() *pluginsdk.Resource {
return &pluginsdk.Resource{
resource := &pluginsdk.Resource{
Create: resourceAutomationCertificateCreateUpdate,
Read: resourceAutomationCertificateRead,
Update: resourceAutomationCertificateCreateUpdate,
Expand Down Expand Up @@ -69,7 +70,7 @@ func resourceAutomationCertificate() *pluginsdk.Resource {

"exportable": {
Type: pluginsdk.TypeBool,
Computed: true,
Default: false,
Optional: true,
},

Expand All @@ -79,6 +80,15 @@ func resourceAutomationCertificate() *pluginsdk.Resource {
},
},
}

if !features.FourPointOhBeta() {
resource.Schema["exportable"] = &pluginsdk.Schema{
Type: pluginsdk.TypeBool,
Computed: true,
Optional: true,
}
}
return resource
}

func resourceAutomationCertificateCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2023-11-01/schedule"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/migration"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down Expand Up @@ -90,9 +91,11 @@ func resourceAutomationJobSchedule() *pluginsdk.Resource {
},

"job_schedule_id": {
Type: pluginsdk.TypeString,
Optional: true,
Type: pluginsdk.TypeString,
Optional: true,
// NOTE: O+C this can remain as this can change if the runbook is updated but cannot be updated by the user
Computed: true,
ForceNew: features.FourPointOhBeta(),
ValidateFunc: validation.IsUUID,
},

Expand Down
3 changes: 2 additions & 1 deletion internal/services/automation/automation_runbook_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/helper"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down Expand Up @@ -154,7 +155,7 @@ func resourceAutomationRunbook() *pluginsdk.Resource {
"content": {
Type: pluginsdk.TypeString,
Optional: true,
Computed: true,
Computed: !features.FourPointOhBeta(),
AtLeastOneOf: []string{"content", "publish_content_link", "draft"},
ValidateFunc: validation.StringIsNotEmpty,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ resource "azurerm_automation_runbook" "test" {
value = "115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80"
}
}
lifecycle {
ignore_changes = [content]
}
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger)
}
Expand Down
Loading

0 comments on commit 29da675

Please sign in to comment.