Skip to content

Commit

Permalink
azurerm_hdinsight_cluster deprecate min_instance_count (#7272)
Browse files Browse the repository at this point in the history
This address part of #7067.

min_instance_count has no effect during resource creation for
hdinsight cluster resource set. Besides, it actually cause plan skew if
user specified it to a non-zero value.
  • Loading branch information
magodo committed Jun 16, 2020
1 parent 49732ad commit 112e6ee
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 15 deletions.
3 changes: 3 additions & 0 deletions azurerm/helpers/azure/hdinsight.go
Expand Up @@ -665,10 +665,13 @@ func SchemaHDInsightNodeDefinition(schemaLocation string, definition HDInsightNo
}

if definition.CanSpecifyInstanceCount {
// TODO 3.0: remove this property
result["min_instance_count"] = &schema.Schema{
Type: schema.TypeInt,
Optional: true,
ForceNew: true,
Computed: true,
Deprecated: "this has been deprecated from the API and will be removed in version 3.0 of the provider",
ValidateFunc: validation.IntBetween(definition.MinInstanceCount, definition.MaxInstanceCount),
}
result["target_instance_count"] = &schema.Schema{
Expand Down
Expand Up @@ -382,7 +382,6 @@ resource "azurerm_hdinsight_hbase_cluster" "import" {
dynamic "worker_node" {
for_each = lookup(roles.value, "worker_node", [])
content {
min_instance_count = lookup(worker_node.value, "min_instance_count", null)
password = lookup(worker_node.value, "password", null)
ssh_keys = lookup(worker_node.value, "ssh_keys", null)
subnet_id = lookup(worker_node.value, "subnet_id", null)
Expand Down
Expand Up @@ -384,7 +384,6 @@ resource "azurerm_hdinsight_interactive_query_cluster" "import" {
dynamic "worker_node" {
for_each = lookup(roles.value, "worker_node", [])
content {
min_instance_count = lookup(worker_node.value, "min_instance_count", null)
password = lookup(worker_node.value, "password", null)
ssh_keys = lookup(worker_node.value, "ssh_keys", null)
subnet_id = lookup(worker_node.value, "subnet_id", null)
Expand Down
Expand Up @@ -389,7 +389,6 @@ resource "azurerm_hdinsight_kafka_cluster" "import" {
dynamic "worker_node" {
for_each = lookup(roles.value, "worker_node", [])
content {
min_instance_count = lookup(worker_node.value, "min_instance_count", null)
number_of_disks_per_node = worker_node.value.number_of_disks_per_node
password = lookup(worker_node.value, "password", null)
ssh_keys = lookup(worker_node.value, "ssh_keys", null)
Expand Down
Expand Up @@ -334,7 +334,6 @@ resource "azurerm_hdinsight_ml_services_cluster" "import" {
dynamic "worker_node" {
for_each = lookup(roles.value, "worker_node", [])
content {
min_instance_count = lookup(worker_node.value, "min_instance_count", null)
password = lookup(worker_node.value, "password", null)
ssh_keys = lookup(worker_node.value, "ssh_keys", null)
subnet_id = lookup(worker_node.value, "subnet_id", null)
Expand Down
Expand Up @@ -334,7 +334,6 @@ resource "azurerm_hdinsight_rserver_cluster" "import" {
dynamic "worker_node" {
for_each = lookup(roles.value, "worker_node", [])
content {
min_instance_count = lookup(worker_node.value, "min_instance_count", null)
password = lookup(worker_node.value, "password", null)
ssh_keys = lookup(worker_node.value, "ssh_keys", null)
subnet_id = lookup(worker_node.value, "subnet_id", null)
Expand Down
Expand Up @@ -384,7 +384,6 @@ resource "azurerm_hdinsight_spark_cluster" "import" {
dynamic "worker_node" {
for_each = lookup(roles.value, "worker_node", [])
content {
min_instance_count = lookup(worker_node.value, "min_instance_count", null)
password = lookup(worker_node.value, "password", null)
ssh_keys = lookup(worker_node.value, "ssh_keys", null)
subnet_id = lookup(worker_node.value, "subnet_id", null)
Expand Down
Expand Up @@ -304,7 +304,6 @@ resource "azurerm_hdinsight_storm_cluster" "import" {
dynamic "worker_node" {
for_each = lookup(roles.value, "worker_node", [])
content {
min_instance_count = lookup(worker_node.value, "min_instance_count", null)
password = lookup(worker_node.value, "password", null)
ssh_keys = lookup(worker_node.value, "ssh_keys", null)
subnet_id = lookup(worker_node.value, "subnet_id", null)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/hdinsight_hadoop_cluster.html.markdown
Expand Up @@ -200,7 +200,7 @@ A `worker_node` block supports the following:

* `vm_size` - (Required) The Size of the Virtual Machine which should be used as the Worker Nodes. Changing this forces a new resource to be created.

* `min_instance_count` - (Optional) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.
* `min_instance_count` - (Optional / **Deprecated** ) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.

* `password` - (Optional) The Password associated with the local administrator for the Worker Nodes. Changing this forces a new resource to be created.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/hdinsight_hbase_cluster.html.markdown
Expand Up @@ -196,7 +196,7 @@ A `worker_node` block supports the following:

* `vm_size` - (Required) The Size of the Virtual Machine which should be used as the Worker Nodes. Changing this forces a new resource to be created.

* `min_instance_count` - (Optional) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.
* `min_instance_count` - (Optional / **Deprecated** ) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.

* `password` - (Optional) The Password associated with the local administrator for the Worker Nodes. Changing this forces a new resource to be created.

Expand Down
Expand Up @@ -199,7 +199,7 @@ A `worker_node` block supports the following:

-> **NOTE:** High memory instances must be specified for the Head Node (Azure suggests a `Standard_D14_V2`).

* `min_instance_count` - (Optional) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.
* `min_instance_count` - (Optional / **Deprecated** ) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.

* `password` - (Optional) The Password associated with the local administrator for the Worker Nodes. Changing this forces a new resource to be created.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/hdinsight_kafka_cluster.html.markdown
Expand Up @@ -199,7 +199,7 @@ A `worker_node` block supports the following:

* `vm_size` - (Required) The Size of the Virtual Machine which should be used as the Worker Nodes. Changing this forces a new resource to be created.

* `min_instance_count` - (Optional) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.
* `min_instance_count` - (Optional / **Deprecated** ) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.

* `password` - (Optional) The Password associated with the local administrator for the Worker Nodes. Changing this forces a new resource to be created.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/hdinsight_ml_services_cluster.html.markdown
Expand Up @@ -197,7 +197,7 @@ A `worker_node` block supports the following:

* `vm_size` - (Required) The Size of the Virtual Machine which should be used as the Worker Nodes. Changing this forces a new resource to be created.

* `min_instance_count` - (Optional) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.
* `min_instance_count` - (Optional / **Deprecated** ) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.

* `password` - (Optional) The Password associated with the local administrator for the Worker Nodes. Changing this forces a new resource to be created.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/hdinsight_rserver_cluster.html.markdown
Expand Up @@ -195,7 +195,7 @@ A `worker_node` block supports the following:

* `vm_size` - (Required) The Size of the Virtual Machine which should be used as the Worker Nodes. Changing this forces a new resource to be created.

* `min_instance_count` - (Optional) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.
* `min_instance_count` - (Optional / **Deprecated** ) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.

* `password` - (Optional) The Password associated with the local administrator for the Worker Nodes. Changing this forces a new resource to be created.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/hdinsight_spark_cluster.html.markdown
Expand Up @@ -196,7 +196,7 @@ A `worker_node` block supports the following:

* `vm_size` - (Required) The Size of the Virtual Machine which should be used as the Worker Nodes. Changing this forces a new resource to be created.

* `min_instance_count` - (Optional) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.
* `min_instance_count` - (Optional / **Deprecated** ) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.

* `password` - (Optional) The Password associated with the local administrator for the Worker Nodes. Changing this forces a new resource to be created.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/hdinsight_storm_cluster.html.markdown
Expand Up @@ -182,7 +182,7 @@ A `worker_node` block supports the following:

* `vm_size` - (Required) The Size of the Virtual Machine which should be used as the Worker Nodes. Changing this forces a new resource to be created.

* `min_instance_count` - (Optional) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.
* `min_instance_count` - (Optional / **Deprecated** ) The minimum number of instances which should be run for the Worker Nodes. Changing this forces a new resource to be created.

* `password` - (Optional) The Password associated with the local administrator for the Worker Nodes. Changing this forces a new resource to be created.

Expand Down

0 comments on commit 112e6ee

Please sign in to comment.