DeviaVir / terraform-provider-gsuite

A @HashiCorp Terraform provider for managing G Suite resources.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

boolean attributes for "gsuite_group_settings" produce errors

ryno75 opened this issue · comments

Terraform Version: 0.11.14

When using the gsuite_group_settings resource and you supply boolean style attributes (like the following example) you will receive an error like:

gsuite_group_settings.foo: [ERROR] Something went wrong while updating group settings: googleapi: Error 400: Invalid value for: 0 is not a valid value, invalid

Looks like the go code is converting the booleans to ints (true to 0 and false to 1)

Here's an example that will reproduce the problem:

resource "gsuite_group_settings" "foo" {
  email = "${gsuite_group.foo.email}"

  allow_external_members        = "false"
  show_in_group_directory       = true
  members_can_post_as_the_group = true
  message_moderation_level      = "MODERATE_NON_MEMBERS"
  who_can_join                  = "INVITED_CAN_JOIN"
  who_can_discover_group        = "ALL_IN_DOMAIN_CAN_DISCOVER"
  who_can_view_membership       = "ALL_IN_DOMAIN_CAN_VIEW"
}

A workaround is to put the boolean values in quotes thus rendering them as strings and not booleans.

Supplying boolean attributes as actual HCL booleans should work because 1) the example code for group_settings documents it as such and 2) it is idiomatically correct.

commented

I can't reproduce this issue on terraform 0.12, is this still an issue on the latest version of this provider for you?

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.