Skip to content

Commit

Permalink
Merge branch 'main' into nginxaas_nap
Browse files Browse the repository at this point in the history
  • Loading branch information
arpith-f5 committed Jan 13, 2025
2 parents e39ad7f + 9f709c8 commit d472fb0
Show file tree
Hide file tree
Showing 45 changed files with 989 additions and 340 deletions.
2 changes: 1 addition & 1 deletion .release/provider-schema.json

Large diffs are not rendered by default.

24 changes: 21 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
## 4.4.0 (Unreleased)
## 4.5.0 (Unreleased)

ENHANCEMENTS:

* **New Resource**: `azurerm_stack_hci_virtual_hard_disk` [GH-27474]

BUG FIXES:

* `azurerm_mssql_database` - now creates successfully when elastic pool is hyperscale [GH-27505]

## 4.4.0 (October 04, 2024)

ENHANCEMENTS:

* dependencies - update `github.com/hashicorp/go-azure-sdk` to `v0.20240923.1151247` [GH-27491]
* `azurerm_site_recovery_replicated_vm` - support for the `target_virtual_machine_size` property [GH-27480]
* dependencies - update `github.com/hashicorp/go-azure-sdk` to `v0.20240923.1151247` ([#27491](https://github.com/hashicorp/terraform-provider-azurerm/issues/27491))
* `azurerm_site_recovery_replicated_vm` - support for the `target_virtual_machine_size` property ([#27480](https://github.com/hashicorp/terraform-provider-azurerm/issues/27480))

BUG FIXES:

* `azurerm_app_service_certificate` - `key_vault_secret_id` can now be versionless ([#27537](https://github.com/hashicorp/terraform-provider-azurerm/issues/27537))
* `azurerm_linux_virtual_machine_scale_set` - prevent crash when `auto_upgrade_minor_version_enabled` is nil ([#27353](https://github.com/hashicorp/terraform-provider-azurerm/issues/27353))
* `azurerm_role_assignment` - correctly parse ID when it's a root or provider scope ([#27237](https://github.com/hashicorp/terraform-provider-azurerm/issues/27237))
* `azurerm_storage_blob` - `source_content` is now ForceNew ([#27508](https://github.com/hashicorp/terraform-provider-azurerm/issues/27508))
* `azurerm_virtual_network_gateway_connection` - revert `shared_key` to Optional and Computed ([#27560](https://github.com/hashicorp/terraform-provider-azurerm/issues/27560))

## 4.3.0 (September 19, 2024)

Expand Down
13 changes: 2 additions & 11 deletions examples/sql-azure/sql_server_auditing_log_analytics/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,16 @@ resource "azurerm_monitor_diagnostic_setting" "example" {
target_resource_id = "${azurerm_mssql_server.example.id}/databases/master"
log_analytics_workspace_id = azurerm_log_analytics_workspace.example.id

log {
enabled_log {
category = "SQLSecurityAuditEvents"
enabled = true

retention_policy {
enabled = false
}
}

metric {
category = "AllMetrics"

retention_policy {
enabled = false
}
}

lifecycle {
ignore_changes = [log, metric]
ignore_changes = [enabled_log, metric]
}
}

Expand Down
3 changes: 3 additions & 0 deletions internal/services/authorization/models.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package authorization

import "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/rolemanagementpolicies"
Expand Down
30 changes: 28 additions & 2 deletions internal/services/authorization/parse/role_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,18 @@ func (id RoleAssignmentId) AzureResourceID() string {
return fmt.Sprintf(fmtString, id.Name)
}

fmtString := "/subscriptions/%s/providers/Microsoft.Authorization/roleAssignments/%s"
return fmt.Sprintf(fmtString, id.SubscriptionID, id.Name)
if id.SubscriptionID != "" {
fmtString := "/subscriptions/%s/providers/Microsoft.Authorization/roleAssignments/%s"
return fmt.Sprintf(fmtString, id.SubscriptionID, id.Name)
}

if id.ResourceProvider != "" {
fmtString := "/providers/%s/providers/Microsoft.Authorization/roleAssignments/%s"
return fmt.Sprintf(fmtString, id.ResourceProvider, id.Name)
}

fmtString := "/providers/Microsoft.Authorization/roleAssignments/%s"
return fmt.Sprintf(fmtString, id.Name)
}

func (id RoleAssignmentId) ID() string {
Expand Down Expand Up @@ -179,6 +189,22 @@ func RoleAssignmentID(input string) (*RoleAssignmentId, error) {
}
roleAssignmentId.Name = idParts[1]
roleAssignmentId.ManagementGroup = strings.TrimPrefix(idParts[0], "/providers/Microsoft.Management/managementGroups/")
case strings.HasPrefix(input, "/providers/") && !strings.HasPrefix(input, "/providers/Microsoft.Authorization/roleAssignments"):
idParts := strings.Split(input, "/providers/Microsoft.Authorization/roleAssignments/")
if len(idParts) != 2 {
return nil, fmt.Errorf("could not parse Role Assignment ID %q for Resource Provider", input)
}
if idParts[1] == "" {
return nil, fmt.Errorf("ID was missing a value for the roleAssignments element")
}
roleAssignmentId.Name = idParts[1]
roleAssignmentId.ResourceProvider = strings.TrimPrefix(idParts[0], "/providers/")
case strings.HasPrefix(input, "/providers/Microsoft.Authorization/roleAssignments"):
name := strings.TrimPrefix(input, "/providers/Microsoft.Authorization/roleAssignments/")
if name == "" {
return nil, fmt.Errorf("ID was missing a value for the roleAssignments element")
}
roleAssignmentId.Name = name
default:
return nil, fmt.Errorf("could not parse Role Assignment ID %q", input)
}
Expand Down
24 changes: 24 additions & 0 deletions internal/services/authorization/parse/role_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,30 @@ func TestRoleAssignmentID(t *testing.T) {
TenantId: "34567812-3456-7653-6742-345678901234",
},
},
{
Input: "/providers/Microsoft.Capacity/providers/Microsoft.Authorization/roleAssignments/23456781-2349-8764-5631-234567890121",
Expected: &RoleAssignmentId{
SubscriptionID: "",
ResourceGroup: "",
ResourceProvider: "Microsoft.Capacity",
ResourceScope: "",
ManagementGroup: "",
Name: "23456781-2349-8764-5631-234567890121",
TenantId: "34567812-3456-7653-6742-345678901234",
},
},
{
Input: "/providers/Microsoft.Authorization/roleAssignments/23456781-2349-8764-5631-234567890121",
Expected: &RoleAssignmentId{
SubscriptionID: "",
ResourceGroup: "",
ResourceProvider: "",
ResourceScope: "",
ManagementGroup: "",
Name: "23456781-2349-8764-5631-234567890121",
TenantId: "34567812-3456-7653-6742-345678901234",
},
},
}

for _, v := range testData {
Expand Down
1 change: 1 addition & 0 deletions internal/services/azurestackhci/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ func (r Registration) Resources() []sdk.Resource {
StackHCIDeploymentSettingResource{},
StackHCILogicalNetworkResource{},
StackHCIStoragePathResource{},
StackHCIVirtualHardDiskResource{},
}
}
Loading

0 comments on commit d472fb0

Please sign in to comment.