Skip to content

Commit

Permalink
Merge branch 'hashicorp:main' into Update-Basic-SKU-partition-count-f…
Browse files Browse the repository at this point in the history
…rom-1-to-3
  • Loading branch information
Gnana-Bharathi-K authored Dec 2, 2024
2 parents 41e5018 + 9287fe7 commit c3533d3
Show file tree
Hide file tree
Showing 231 changed files with 1,424 additions and 2,218 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
configuration-path: .github/labeler-pull-request-triage.yml
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: CodelyTV/pr-size-labeler@c7a55a022747628b50f3eb5bf863b9e796b8f274 # v1.10.1
- uses: CodelyTV/pr-size-labeler@1c3422395d899286d5ee2c809fd5aed264d5eb9b # v1.10.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/XS'
Expand Down
2 changes: 1 addition & 1 deletion .release/provider-schema.json

Large diffs are not rendered by default.

38 changes: 30 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
## 4.12.0 (Unreleased)
## 4.13.0 (Unreleased)

ENHANCEMENTS:

* `azurerm_cognitive_deployment` - add support for the `dynamic_throttling_enabled` property [GH-28100]

BUG:

* `azurerm_cdn_frontdoor_origin_group` - update validation of `interval_in_seconds` to match API behaviour [GH-28143]

## 4.12.0 (November 28, 2024)

FEATURES:

* **New Data Source**: `azurerm_mssql_managed_database` ([#27026](https://github.com/hashicorp/terraform-provider-azurerm/issues/27026))

BUG FIXES:

* `azurerm_application_insights_api_key` - fix condition that nil checks the list of available API keys to prevent an indefinate loop when keys created outside of Terraform are present [GH-28037]
* `azurerm_virtual_network_gateway` - fix crash issue when specifying `root_certificate ` or `revoked_certificate` [GH-28099]
* `azurerm_application_insights_api_key` - fix condition that nil checks the list of available API keys to prevent an indefinate loop when keys created outside of Terraform are present ([#28037](https://github.com/hashicorp/terraform-provider-azurerm/issues/28037))
* `azurerm_data_factory_linked_service_azure_sql_database` - send `tenant_id` only if it has been specified ([#28120](https://github.com/hashicorp/terraform-provider-azurerm/issues/28120))
* `azurerm_eventgrid_event_subscription` - fix crash when flattening `advanced_filter` ([#28110](https://github.com/hashicorp/terraform-provider-azurerm/issues/28110))
* `azurerm_virtual_network_gateway` - fix crash issue when specifying `root_certificate ` or `revoked_certificate` ([#28099](https://github.com/hashicorp/terraform-provider-azurerm/issues/28099))

ENHANCEMENTS:

* Data Source: `azurerm_logic_app_standard` - add support for the `public_network_access` property [GH-27913]
* Data Source: `azurerm_search_service` - add support for the `customer_managed_key_encryption_compliance_status` property [GH-27478]
* `azurerm_eventhub` - deprecate `namespace_name` and `resource_group_name` in favour of `namespace_id` [GH-28055]
* `azurerm_logic_app_standard` - add support for the `public_network_access` property [GH-27913]
* `azurerm_search_service` - add support for the `customer_managed_key_encryption_compliance_status` property [GH-27478]
* dependencies - update `go-azure-sdk` to `v0.20241128.1112539` ([#28137](https://github.com/hashicorp/terraform-provider-azurerm/issues/28137))
* `containerapps` - update api version to `2024-03-01` ([#28074](https://github.com/hashicorp/terraform-provider-azurerm/issues/28074))
* `Search` - update api version to `2024-06-01-preview` ([#27803](https://github.com/hashicorp/terraform-provider-azurerm/issues/27803))
* Data Source: `azurerm_logic_app_standard` - add support for the `public_network_access` property ([#27913](https://github.com/hashicorp/terraform-provider-azurerm/issues/27913))
* Data Source: `azurerm_search_service` - add support for the `customer_managed_key_encryption_compliance_status` property ([#27478](https://github.com/hashicorp/terraform-provider-azurerm/issues/27478))
* `azurerm_container_registry_task` - add validation on `cpu` as well as on `agent_pool_name`and `agent_setting` ([#28098](https://github.com/hashicorp/terraform-provider-azurerm/issues/28098))
* `azurerm_databricks_workspace` - add support for the `enhanced_security_compliance` block ([#26606](https://github.com/hashicorp/terraform-provider-azurerm/issues/26606))
* `azurerm_eventhub` - deprecate `namespace_name` and `resource_group_name` in favour of `namespace_id` ([#28055](https://github.com/hashicorp/terraform-provider-azurerm/issues/28055))
* `azurerm_logic_app_standard` - add support for the `public_network_access` property ([#27913](https://github.com/hashicorp/terraform-provider-azurerm/issues/27913))
* `azurerm_search_service` - add support for the `customer_managed_key_encryption_compliance_status` property ([#27478](https://github.com/hashicorp/terraform-provider-azurerm/issues/27478))
* `azurerm_cosmosdb_account` - add support for value `EnableNoSQLFullTextSearch` in the `capabilities.name` property ([#28114](https://github.com/hashicorp/terraform-provider-azurerm/issues/28114))

## 4.11.0 (November 22, 2024)

Expand Down
7 changes: 7 additions & 0 deletions examples/databricks/enhanced-security-compliance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Example: Databricks Workspace with Enhanced Security and Compliance

This example provisions a Databricks Workspace within Azure with Enhanced Security and Compliance settings enabled.

### Variables

* `prefix` - (Required) The prefix used for all resources in this example.
23 changes: 23 additions & 0 deletions examples/databricks/enhanced-security-compliance/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
provider "azurerm" {
features {}
}

resource "azurerm_resource_group" "example" {
name = "${var.prefix}-databricks-esc"
location = "West Europe"
}

resource "azurerm_databricks_workspace" "example" {
name = "${var.prefix}-DBW"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "premium"
managed_resource_group_name = "${var.prefix}-DBW-managed-esc"

enhanced_security_compliance {
automatic_cluster_update_enabled = true
compliance_security_profile_enabled = true
compliance_security_profile_standards = ["HIPAA", "PCI_DSS"]
enhanced_security_monitoring_enabled = true
}
}
7 changes: 7 additions & 0 deletions examples/databricks/enhanced-security-compliance/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

variable "prefix" {
description = "The Prefix used for all resources in this example"
}

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-azure-helpers v0.71.0
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241118.1115603
github.com/hashicorp/go-azure-sdk/sdk v0.20241118.1115603
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241128.1112539
github.com/hashicorp/go-azure-sdk/sdk v0.20241128.1112539
github.com/hashicorp/go-hclog v1.6.3
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-azure-helpers v0.71.0 h1:ra3aIRzg01g6MLKQ+yABcb6WJtrqRUDDgyuPLmyZ9lY=
github.com/hashicorp/go-azure-helpers v0.71.0/go.mod h1:BmbF4JDYXK5sEmFeU5hcn8Br21uElcqLfdQxjatwQKw=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241118.1115603 h1:YmPg9BwqWZdrNtaezgwt3rRLJipDrAEFQw/EJ54yFVs=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241118.1115603/go.mod h1:7mzEbFWcjAAO2xomo9oB8B3HbjLRIaS2gMulSfuOmvY=
github.com/hashicorp/go-azure-sdk/sdk v0.20241118.1115603 h1:7Nmi7O/vl4aTSGFARHb1QXxRNI1GlZ6wKD8046/bGBo=
github.com/hashicorp/go-azure-sdk/sdk v0.20241118.1115603/go.mod h1:dMKF6bXrgGmy1d3pLzkmBpG2JIHgSAV2/OMSCEgyMwE=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241128.1112539 h1:rHh2P5qcPObzpfAFafIjle3CowejFAHTfBJAHDkuSGk=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20241128.1112539/go.mod h1:oQAUu+aCHPCM0CDfsQTBnEkfUZ+sLhEW8Ssip9AeCLc=
github.com/hashicorp/go-azure-sdk/sdk v0.20241128.1112539 h1:6Ps2V/DBwBxWEjSx01fM+PqG+uIavHWvxmM2vb1N2Ok=
github.com/hashicorp/go-azure-sdk/sdk v0.20241128.1112539/go.mod h1:oI5R0fTbBx3K/sJBK5R/OlEy8ozdQjvctxVU9v3EDkc=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func resourceCdnFrontDoorOriginGroup() *pluginsdk.Resource {
"interval_in_seconds": {
Type: pluginsdk.TypeInt,
Required: true,
ValidateFunc: validation.IntBetween(5, 31536000),
ValidateFunc: validation.IntBetween(1, 255),
},

"path": {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/cognitive/cognitive_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts"
search "github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/services"
search "github.com/hashicorp/go-azure-sdk/resource-manager/search/2024-06-01-preview/services"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
commonValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
Expand Down
35 changes: 23 additions & 12 deletions internal/services/cognitive/cognitive_deployment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import (
)

type cognitiveDeploymentModel struct {
Name string `tfschema:"name"`
CognitiveAccountId string `tfschema:"cognitive_account_id"`
Model []DeploymentModelModel `tfschema:"model"`
RaiPolicyName string `tfschema:"rai_policy_name"`
Sku []DeploymentSkuModel `tfschema:"sku"`
VersionUpgradeOption string `tfschema:"version_upgrade_option"`
Name string `tfschema:"name"`
CognitiveAccountId string `tfschema:"cognitive_account_id"`
DynamicThrottlingEnabled bool `tfschema:"dynamic_throttling_enabled"`
Model []DeploymentModelModel `tfschema:"model"`
RaiPolicyName string `tfschema:"rai_policy_name"`
Sku []DeploymentSkuModel `tfschema:"sku"`
VersionUpgradeOption string `tfschema:"version_upgrade_option"`
}

type DeploymentModelModel struct {
Expand Down Expand Up @@ -74,6 +75,11 @@ func (r CognitiveDeploymentResource) Arguments() map[string]*pluginsdk.Schema {
ValidateFunc: cognitiveservicesaccounts.ValidateAccountID,
},

"dynamic_throttling_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
},

"model": {
Type: pluginsdk.TypeList,
Required: true,
Expand Down Expand Up @@ -220,6 +226,10 @@ func (r CognitiveDeploymentResource) Create() sdk.ResourceFunc {
properties.Properties.RaiPolicyName = &model.RaiPolicyName
}

if model.DynamicThrottlingEnabled {
properties.Properties.DynamicThrottlingEnabled = &model.DynamicThrottlingEnabled
}

if model.VersionUpgradeOption != "" {
option := deployments.DeploymentModelVersionUpgradeOption(model.VersionUpgradeOption)
properties.Properties.VersionUpgradeOption = &option
Expand Down Expand Up @@ -266,6 +276,10 @@ func (r CognitiveDeploymentResource) Update() sdk.ResourceFunc {

properties := resp.Model

if metadata.ResourceData.HasChange("dynamic_throttling_enabled") {
properties.Properties.DynamicThrottlingEnabled = pointer.To(model.DynamicThrottlingEnabled)
}

if metadata.ResourceData.HasChange("sku.0.capacity") {
properties.Sku.Capacity = pointer.To(model.Sku[0].Capacity)
}
Expand Down Expand Up @@ -323,12 +337,9 @@ func (r CognitiveDeploymentResource) Read() sdk.ResourceFunc {
if properties := model.Properties; properties != nil {
state.Model = flattenDeploymentModelModel(properties.Model)

if v := properties.RaiPolicyName; v != nil {
state.RaiPolicyName = *v
}
if v := properties.VersionUpgradeOption; v != nil {
state.VersionUpgradeOption = string(*v)
}
state.DynamicThrottlingEnabled = pointer.From(properties.DynamicThrottlingEnabled)
state.RaiPolicyName = pointer.From(properties.RaiPolicyName)
state.VersionUpgradeOption = string(pointer.From(properties.VersionUpgradeOption))
}
if sku := flattenDeploymentSkuModel(model.Sku); sku != nil {
state.Sku = sku
Expand Down
26 changes: 7 additions & 19 deletions internal/services/cognitive/cognitive_deployment_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ import (

type CognitiveDeploymentTestResource struct{}

func TestAccCognitiveDeploymentSequential(t *testing.T) {
// Only two OpenAI resources could be created per region, so run the tests sequentially.
// Refer to : https://learn.microsoft.com/en-us/azure/cognitive-services/openai/quotas-limits
acceptance.RunTestsInSequence(t, map[string]map[string]func(t *testing.T){
"deployment": {
"basic": TestAccCognitiveDeployment_basic,
"requiresImport": testAccCognitiveDeployment_requiresImport,
"complete": testAccCognitiveDeployment_complete,
"update": TestAccCognitiveDeployment_update,
},
})
}

func TestAccCognitiveDeployment_basic(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_cognitive_deployment", "test")
r := CognitiveDeploymentTestResource{}
Expand All @@ -47,7 +34,7 @@ func TestAccCognitiveDeployment_basic(t *testing.T) {
})
}

func testAccCognitiveDeployment_requiresImport(t *testing.T) {
func TestAccCognitiveDeployment_requiresImport(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_cognitive_deployment", "test")

r := CognitiveDeploymentTestResource{}
Expand All @@ -62,14 +49,15 @@ func testAccCognitiveDeployment_requiresImport(t *testing.T) {
})
}

func testAccCognitiveDeployment_complete(t *testing.T) {
func TestAccCognitiveDeployment_complete(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_cognitive_deployment", "test")
r := CognitiveDeploymentTestResource{}
data.ResourceSequentialTest(t, r, []acceptance.TestStep{
{
Config: r.complete(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("dynamic_throttling_enabled").HasValue("true"),
),
},
data.ImportStep(),
Expand Down Expand Up @@ -211,9 +199,9 @@ func (r CognitiveDeploymentTestResource) complete(data acceptance.TestData) stri
%s
resource "azurerm_cognitive_deployment" "test" {
name = "acctest-cd-%d"
cognitive_account_id = azurerm_cognitive_account.test.id
name = "acctest-cd-%d"
cognitive_account_id = azurerm_cognitive_account.test.id
dynamic_throttling_enabled = true
model {
format = "OpenAI"
name = "text-embedding-ada-002"
Expand All @@ -222,7 +210,7 @@ resource "azurerm_cognitive_deployment" "test" {
sku {
name = "Standard"
}
rai_policy_name = "RAI policy"
rai_policy_name = "Microsoft.DefaultV2"
version_upgrade_option = "OnceNewDefaultVersionAvailable"
}
`, template, data.RandomInteger)
Expand Down
2 changes: 1 addition & 1 deletion internal/services/containerapps/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/certificates"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/containerapps"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/containerappsrevisions"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/daprcomponents"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2024-02-02-preview/jobs"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2024-03-01/containerapps"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2024-03-01/managedenvironments"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/containerapps"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/managedenvironments"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2024-03-01/containerapps"
"github.com/hashicorp/terraform-provider-azurerm/internal/locks"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/containerapps/helpers"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/containerapps"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2024-03-01/containerapps"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/containerapps"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/managedenvironments"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2024-03-01/containerapps"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/containerapps/helpers"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down
2 changes: 1 addition & 1 deletion internal/services/containerapps/container_app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/containerapps"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2024-03-01/containerapps"
"github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2024-03-01/managedenvironments"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/containerapps/helpers"
Expand Down
Loading

0 comments on commit c3533d3

Please sign in to comment.