You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.
Terraform fails because vm_count is not specified.
$ terraform apply
╷
│ Error: Missing required argument
│
│ with google_compute_resource_policy.placement_policy,
│ on main.tf line 4, in resource "google_compute_resource_policy" "placement_policy":
│ 4: group_placement_policy {
│
│ "group_placement_policy.0.availability_domain_count": one of `group_placement_policy.0.availability_domain_count,group_placement_policy.0.vm_count` must be specified
╵
╷
│ Error: Missing required argument
│
│ with google_compute_resource_policy.placement_policy,
│ on main.tf line 4, in resource "google_compute_resource_policy" "placement_policy":
│ 4: group_placement_policy {
│
│ "group_placement_policy.0.vm_count": one of `group_placement_policy.0.availability_domain_count,group_placement_policy.0.vm_count` must be specified
╵
Important Factoids
The actual behavior is in line with the provider documentation but is enforcing a limitation that goes against the recommendation of the GCP documentation (See note in this section)
The equivelent gcloud command succeeds (note lack of --vm-count argument):
This looks like it's probably a valid enhancement request; I don't think it's a bug, since the provider is behaving as expected (and if it's a bug it's probably a persistent bug, which would be treated as an enhancement request). It looks like gcloud made --vm-count optional in 2020-03. And according to the API user guide it is possible to exclude the field (even though it's not marked optional in the API reference.
Currently vmCount and availabilityDomainCount are marked as at_least_one_of; it might be as simple as changing that to conflicts_with and marking them as optional, but I'm not sure. The logic of which subfields have to be specified and what behavior is expected if they aren't seems to also be influenced by the collocation field.
melinath
changed the title
google_compute_resource_policy incorrectly requires vm_count when used with "COLLOCATED"
Support optional vm_count for google_compute_resource_policy.group_placement_policy when collocation="COLLOCATED"
Apr 14, 2022
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
The resource policy should be created without a
vm_count
as described in the official documentation: https://cloud.google.com/compute/docs/instances/define-instance-placement#compact.Actual Behavior
Terraform fails because
vm_count
is not specified.Important Factoids
--vm-count
argument):The text was updated successfully, but these errors were encountered: