Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_hdinsight_interactive_query_cluster - Updating the deprecation message from #21981 #22062

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ var hdInsightInteractiveQueryClusterHeadNodeDefinition = HDInsightNodeDefinition
}

var hdInsightInteractiveQueryClusterWorkerNodeDefinition = HDInsightNodeDefinition{
CanSpecifyInstanceCount: true,
MinInstanceCount: 1,
CanSpecifyDisks: false,
CanAutoScaleByCapacity: true,
CanAutoScaleOnSchedule: true,
CanSpecifyInstanceCount: true,
MinInstanceCount: 1,
CanSpecifyDisks: false,
CanAutoScaleByCapacityDeprecated4PointOh: true,
CanAutoScaleOnSchedule: true,
}

var hdInsightInteractiveQueryClusterZookeeperNodeDefinition = HDInsightNodeDefinition{
Expand Down Expand Up @@ -147,10 +147,9 @@ func resourceHDInsightInteractiveQueryCluster() *pluginsdk.Resource {
"zookeeper_node": SchemaHDInsightNodeDefinition("roles.0.zookeeper_node", hdInsightInteractiveQueryClusterZookeeperNodeDefinition, true),
},
},
Deprecated: "HDInsight interactive query clusters can no longer be configured through `autoscale.0.capacity`. Use `autoscale.0.recurrence` instead.",
}
} else {
hdInsightInteractiveQueryClusterWorkerNodeDefinition.CanAutoScaleByCapacity = false
hdInsightInteractiveQueryClusterWorkerNodeDefinition.CanAutoScaleByCapacityDeprecated4PointOh = false
resource.Schema["roles"] = &pluginsdk.Schema{
Type: pluginsdk.TypeList,
Required: true,
Expand Down
33 changes: 33 additions & 0 deletions internal/services/hdinsight/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,8 @@ type HDInsightNodeDefinition struct {
FixedTargetInstanceCount *int32
CanAutoScaleByCapacity bool
CanAutoScaleOnSchedule bool
// todo remove in 4.0
CanAutoScaleByCapacityDeprecated4PointOh bool
}

func SchemaHDInsightNodeDefinition(schemaLocation string, definition HDInsightNodeDefinition, required bool) *pluginsdk.Schema {
Expand Down Expand Up @@ -1117,6 +1119,37 @@ func SchemaHDInsightNodeDefinition(schemaLocation string, definition HDInsightNo
}
}
}
// managing `azurerm_hdinsight_interactive_query_cluster` autoscaling through `capacity` doesn't work so we'll deprecate this portion of the schema for 4.0
if definition.CanAutoScaleByCapacityDeprecated4PointOh {
autoScales["capacity"] = &pluginsdk.Schema{
Type: pluginsdk.TypeList,
Optional: true,
MaxItems: 1,
ConflictsWith: []string{
fmt.Sprintf("%s.0.autoscale.0.recurrence", schemaLocation),
},
Deprecated: "HDInsight interactive query clusters can no longer be configured through `autoscale.0.capacity`. Use `autoscale.0.recurrence` instead.",
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"min_instance_count": {
Type: pluginsdk.TypeInt,
Required: true,
ValidateFunc: countValidation,
},
"max_instance_count": {
Type: pluginsdk.TypeInt,
Required: true,
ValidateFunc: countValidation,
},
},
},
}
if definition.CanAutoScaleOnSchedule {
autoScales["capacity"].ConflictsWith = []string{
fmt.Sprintf("%s.0.autoscale.0.recurrence", schemaLocation),
}
}
}
if definition.CanAutoScaleOnSchedule {
autoScales["recurrence"] = &pluginsdk.Schema{
Type: pluginsdk.TypeList,
Expand Down