Skip to content

Commit

Permalink
update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhang3 committed Dec 3, 2024
2 parents e90d460 + 9287fe7 commit af5459f
Show file tree
Hide file tree
Showing 328 changed files with 3,120 additions and 3,190 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.

39 changes: 38 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
## 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 ([#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:

* 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)

NOTES:
Expand All @@ -24,7 +61,7 @@ ENHANCEMENTS:
* `azurerm_virtual_network` - `Informatica.DataManagement/organizations` is a valid `service_delegation` ([#27993](https://github.com/hashicorp/terraform-provider-azurerm/issues/27993))
* `azurerm_web_application_firewall_policy` - `1.1` is now accepted as a valid `version` for `Microsoft_BotManagerRuleSet` rule types ([#28039](https://github.com/hashicorp/terraform-provider-azurerm/issues/28039))

BUG:
BUG FIXES:

* `azurerm_api_management` - `public_ip_address_id` is no longer required when `zone` has been set ([#27976](https://github.com/hashicorp/terraform-provider-azurerm/issues/27976))
* `azurerm_api_management_diagnostic` - raise and error when `operation_name_format` is used with and `identity` that is not `applicationinsights` ([#27630](https://github.com/hashicorp/terraform-provider-azurerm/issues/27630))
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 @@ -109,7 +109,7 @@ func resourceApplicationInsightsAPIKeyCreate(d *pluginsdk.ResourceData, meta int
}
}

for existingAPIKeyList.Model != nil && len(existingAPIKeyList.Model.Value) > 0 {
if existingAPIKeyList.Model != nil && len(existingAPIKeyList.Model.Value) > 0 {
for _, existingAPIKey := range existingAPIKeyList.Model.Value {
existingAPIKeyId, err = apikeys.ParseApiKeyIDInsensitively(*existingAPIKey.Id)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func TestAccClientConfigDataSource_basic(t *testing.T) {

func (d ClientConfigDataSource) basic() string {
return `
provider "azurerm" {
features {}
}
data "azurerm_client_config" "current" {
}
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ resource "azuread_group" "test" {

func (r PimActiveRoleAssignmentResource) noExpiration(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azurerm_subscription" "primary" {}
data "azurerm_client_config" "test" {}
Expand Down Expand Up @@ -201,6 +205,10 @@ resource "azurerm_pim_active_role_assignment" "test" {

func (PimActiveRoleAssignmentResource) expirationByDurationHours(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azurerm_subscription" "primary" {}
data "azurerm_client_config" "test" {}
Expand Down Expand Up @@ -240,6 +248,10 @@ resource "azurerm_pim_active_role_assignment" "test" {

func (PimActiveRoleAssignmentResource) expirationByDurationDays(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azurerm_subscription" "primary" {}
data "azurerm_client_config" "test" {}
Expand Down Expand Up @@ -285,6 +297,10 @@ resource "azurerm_pim_active_role_assignment" "test" {

func (PimActiveRoleAssignmentResource) importSetup(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azurerm_subscription" "primary" {}
data "azurerm_client_config" "test" {}
Expand Down Expand Up @@ -339,6 +355,10 @@ resource "azurerm_pim_active_role_assignment" "import" {

func (PimActiveRoleAssignmentResource) expirationByDate(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azurerm_subscription" "primary" {}
data "azurerm_client_config" "test" {}
Expand Down Expand Up @@ -384,6 +404,10 @@ resource "azurerm_pim_active_role_assignment" "test" {

func (PimActiveRoleAssignmentResource) pending(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azurerm_subscription" "primary" {}
data "azurerm_client_config" "test" {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ func (r PimEligibleRoleAssignmentResource) Exists(ctx context.Context, client *c

func (PimEligibleRoleAssignmentResource) template(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azuread_domains" "test" {
only_initial = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ data "azurerm_role_definition" "test" {
name = "%s"
}
provider "azurerm" {
features {}
}
resource "azurerm_marketplace_role_assignment" "test" {
role_definition_id = "${data.azurerm_role_definition.test.id}"
principal_id = "${data.azurerm_client_config.test.object_id}"
Expand All @@ -222,6 +226,10 @@ resource "azurerm_marketplace_role_assignment" "test" {

func (RoleAssignmentMarketplaceResource) roleNameConfig(id string, roleName string) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azurerm_client_config" "test" {
}
Expand Down Expand Up @@ -259,6 +267,10 @@ resource "azurerm_marketplace_role_assignment" "import" {

func (RoleAssignmentMarketplaceResource) builtinConfig(id string, roleName string) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
data "azurerm_client_config" "test" {
}
Expand Down Expand Up @@ -292,6 +304,10 @@ resource "azuread_service_principal" "test" {
application_id = azuread_application.test.application_id
}
provider "azurerm" {
features {}
}
resource "azurerm_marketplace_role_assignment" "test" {
name = "%s"
role_definition_name = "%s"
Expand All @@ -318,6 +334,10 @@ resource "azuread_service_principal" "test" {
application_id = azuread_application.test.application_id
}
provider "azurerm" {
features {}
}
resource "azurerm_marketplace_role_assignment" "test" {
name = "%s"
role_definition_name = "%s"
Expand All @@ -342,6 +362,10 @@ resource "azuread_group" "test" {
security_enabled = true
}
provider "azurerm" {
features {}
}
resource "azurerm_marketplace_role_assignment" "test" {
name = "%s"
role_definition_name = "%s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ func (r RoleAssignmentResource) Exists(ctx context.Context, client *clients.Clie

func (RoleAssignmentResource) emptyNameConfig() string {
return `
provider "azurerm" {
features {}
}
data "azurerm_subscription" "primary" {}
data "azurerm_client_config" "test" {}
Expand Down
4 changes: 4 additions & 0 deletions internal/services/batch/batch_pool_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,10 @@ resource "azurerm_batch_pool" "test" {

func (BatchPoolResource) networkConfiguration(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-%[1]d-batchpool"
location = "%[2]s"
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
Loading

0 comments on commit af5459f

Please sign in to comment.