diff --git a/third_party/terraform/tests/resource_compute_instance_test.go b/third_party/terraform/tests/resource_compute_instance_test.go index e6d4eb4e2bde..3e728d511209 100644 --- a/third_party/terraform/tests/resource_compute_instance_test.go +++ b/third_party/terraform/tests/resource_compute_instance_test.go @@ -4240,6 +4240,12 @@ resource "google_compute_instance" "foobar" { values = ["test"] } + node_affinities { + key = "tfacc" + operator = "NOT_IN" + values = ["not_here"] + } + node_affinities { key = "compute.googleapis.com/node-group-name" operator = "IN" @@ -4302,6 +4308,12 @@ resource "google_compute_instance" "foobar" { values = ["test", "updatedlabel"] } + node_affinities { + key = "tfacc" + operator = "NOT_IN" + values = ["not_here"] + } + node_affinities { key = "compute.googleapis.com/node-group-name" operator = "IN" diff --git a/third_party/terraform/utils/compute_instance_helpers.go b/third_party/terraform/utils/compute_instance_helpers.go index ba9ab707e556..f1cfc9348076 100644 --- a/third_party/terraform/utils/compute_instance_helpers.go +++ b/third_party/terraform/utils/compute_instance_helpers.go @@ -22,7 +22,7 @@ func instanceSchedulingNodeAffinitiesElemSchema() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{"IN", "NOT"}, false), + ValidateFunc: validation.StringInSlice([]string{"IN", "NOT_IN"}, false), }, "values": { Type: schema.TypeSet, diff --git a/third_party/terraform/website/docs/r/compute_instance.html.markdown b/third_party/terraform/website/docs/r/compute_instance.html.markdown index 4337d858fd7a..093d4cd5f9eb 100644 --- a/third_party/terraform/website/docs/r/compute_instance.html.markdown +++ b/third_party/terraform/website/docs/r/compute_instance.html.markdown @@ -333,7 +333,7 @@ The `node_affinities` block supports: * `key` (Required) - The key for the node affinity label. * `operator` (Required) - The operator. Can be `IN` for node-affinities - or `NOT` for anti-affinities. + or `NOT_IN` for anti-affinities. * `value` (Required) - The values for the node affinity label. diff --git a/third_party/terraform/website/docs/r/compute_instance_template.html.markdown b/third_party/terraform/website/docs/r/compute_instance_template.html.markdown index d6318fad751c..f304967080e7 100644 --- a/third_party/terraform/website/docs/r/compute_instance_template.html.markdown +++ b/third_party/terraform/website/docs/r/compute_instance_template.html.markdown @@ -394,7 +394,7 @@ The `node_affinities` block supports: * `key` (Required) - The key for the node affinity label. * `operator` (Required) - The operator. Can be `IN` for node-affinities - or `NOT` for anti-affinities. + or `NOT_IN` for anti-affinities. * `value` (Required) - The values for the node affinity label.