Skip to content

Commit

Permalink
Merge pull request #24238 from hashicorp/cleanup/kusto-ids
Browse files Browse the repository at this point in the history
`kusto`: removing (most of) the old Resource ID Parsers since these are now unused
  • Loading branch information
tombuildsstuff committed Dec 14, 2023
2 parents cd8da0d + a5f8759 commit 1d024de
Show file tree
Hide file tree
Showing 48 changed files with 32 additions and 4,315 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func resourceKustoAttachedDatabaseConfiguration() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validate.ClusterID,
ValidateFunc: clusters.ValidateClusterID,
},

"attached_database_names": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (r CosmosDBDataConnectionResource) Arguments() map[string]*schema.Schema {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validate.DatabaseID,
ValidateFunc: databases.ValidateDatabaseID,
},
"managed_identity_id": {
Type: pluginsdk.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/attacheddatabaseconfigurations"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -127,7 +127,7 @@ func (s KustoAttachedDatabaseConfigurationV0ToV1) Schema() map[string]*pluginsdk
func (s KustoAttachedDatabaseConfigurationV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.AttachedDatabaseConfigurationIDInsensitively(oldId)
newId, err := attacheddatabaseconfigurations.ParseAttachedDatabaseConfigurationIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"log"

"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/clusters"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -46,7 +46,7 @@ func (s KustoClusterCustomerManagedKeyV0ToV1) Schema() map[string]*pluginsdk.Sch
func (s KustoClusterCustomerManagedKeyV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.ClusterIDInsensitively(oldId)
newId, err := clusters.ParseClusterIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/clusters"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -243,7 +243,7 @@ func (s KustoAttachedClusterV0ToV1) Schema() map[string]*pluginsdk.Schema {
func (s KustoAttachedClusterV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.ClusterIDInsensitively(oldId)
newId, err := clusters.ParseClusterIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/clusterprincipalassignments"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -73,7 +73,7 @@ func (s KustoAttachedClusterPrincipalAssignmentV0ToV1) Schema() map[string]*plug
func (s KustoAttachedClusterPrincipalAssignmentV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.ClusterPrincipalAssignmentIDInsensitively(oldId)
newId, err := clusterprincipalassignments.ParsePrincipalAssignmentIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/dataconnections"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -111,7 +111,7 @@ func (s KustoDatabaseDataConnectionEventGridV0ToV1) Schema() map[string]*plugins
func (s KustoDatabaseDataConnectionEventGridV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.DataConnectionIDInsensitively(oldId)
newId, err := dataconnections.ParseDataConnectionIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/dataconnections"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -104,7 +104,7 @@ func (s KustoDatabaseDataConnectionEventHubV0ToV1) Schema() map[string]*pluginsd
func (s KustoDatabaseDataConnectionEventHubV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.DataConnectionIDInsensitively(oldId)
newId, err := dataconnections.ParseDataConnectionIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/dataconnections"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -102,7 +102,7 @@ func (s KustoDatabaseDataConnectionIotHub0ToV1) Schema() map[string]*pluginsdk.S
func (s KustoDatabaseDataConnectionIotHub0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.DataConnectionIDInsensitively(oldId)
newId, err := dataconnections.ParseDataConnectionIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/databases"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -60,7 +60,7 @@ func (s KustoDatabaseV0ToV1) Schema() map[string]*pluginsdk.Schema {
func (s KustoDatabaseV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.DatabaseIDInsensitively(oldId)
newId, err := databases.ParseDatabaseIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/databaseprincipalassignments"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -79,7 +79,7 @@ func (s KustoDatabasePrincipalAssignmentV0ToV1) Schema() map[string]*pluginsdk.S
func (s KustoDatabasePrincipalAssignmentV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.DatabasePrincipalAssignmentIDInsensitively(oldId)
newId, err := databaseprincipalassignments.ParseDatabasePrincipalAssignmentIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"log"

"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/scripts"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -67,7 +67,7 @@ func (s KustoDatabaseScriptV0ToV1) Schema() map[string]*pluginsdk.Schema {
func (s KustoDatabaseScriptV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.ScriptIDInsensitively(oldId)
newId, err := scripts.ParseScriptIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/managedprivateendpoints"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -62,7 +62,7 @@ func (s KustoManagedPrivateEndpointV0ToV1) Schema() map[string]*pluginsdk.Schema
func (s KustoManagedPrivateEndpointV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.ManagedPrivateEndpointsIDInsensitively(oldId)
newId, err := managedprivateendpoints.ParseManagedPrivateEndpointIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/managedprivateendpoints"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down Expand Up @@ -62,7 +62,7 @@ func (s KustoManagedPrivateEndpointV1ToV2) Schema() map[string]*pluginsdk.Schema
func (s KustoManagedPrivateEndpointV1ToV2) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
oldId := rawState["id"].(string)
newId, err := parse.ManagedPrivateEndpointsIDInsensitively(oldId)
newId, err := managedprivateendpoints.ParseManagedPrivateEndpointIDInsensitively(oldId)
if err != nil {
return nil, err
}
Expand Down
134 changes: 0 additions & 134 deletions internal/services/kusto/parse/attached_database_configuration.go

This file was deleted.

Loading

0 comments on commit 1d024de

Please sign in to comment.