DeviaVir / terraform-provider-gsuite

A @HashiCorp Terraform provider for managing G Suite resources.
MIT License
271 stars 77 forks source link

Creating group with aliases in single plan fails #142

Closed dortort closed 3 years ago

dortort commented 4 years ago

Creating a group with aliases often causes:

Error: rpc error: code = Unavailable desc = transport is closing

or at times, will stall at Still creating... and finally return the error:

Error: [ERROR] Error creating group: googleapi: Error 409: Entity already exists., duplicate

Creating the group without aliases in one "apply" and then adding the aliases in a following "apply" succeeds.

DeviaVir commented 4 years ago

Hi @dortort - thank you for reporting this issue.

Can you try if you still have this issue with this branch? https://github.com/DeviaVir/terraform-provider-gsuite/pull/143

You can run make dev from that branch, which will install into your ~/.terraform.d

DeviaVir commented 4 years ago

Closing, including this in release 0.1.48 - feel free to reopen if this is still an issue in that release.

dortort commented 4 years ago

I've tried with v0.1.50 and still encountered the issue. image Despite the error, the group is created, but without any aliases. The group creation, however, is not recorded in the state.

DeviaVir commented 4 years ago

That's an interesting error. Do you mind trying with 0.1.52? I was not able to reproduce that error but I was able to create a group with aliases in a single apply using that version.

dortort commented 4 years ago

I'll try. Here's the snippet I'm using, BTW:

resource "gsuite_group" "simple_forward" {
  count = length(var.email_forwards)

  name    = var.email_forwards[count.index].name
  email   = var.email_forwards[count.index].email
  aliases = lookup(var.email_forwards[count.index], "aliases", [])
}

resource "gsuite_group_member" "simple_forward" {
  count = length(var.email_forwards)

  group = var.email_forwards[count.index].email
  email = var.email_forwards[count.index].forward_to
}

Perhaps the issue is related to the use of a loop?

stale[bot] commented 3 years ago

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.