Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider produced inconsistent final plan after resource googleworkspace_group_settings creation #463

Open
ankitg4 opened this issue Aug 23, 2023 · 1 comment

Comments

@ankitg4
Copy link

ankitg4 commented Aug 23, 2023

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
1.5.5

Affected Resource(s)

Please list the resources as a list, for example:
googleworkspace_group_settings

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

terraform.tfvars

map_for_groups = {
  Crisis_Team = {
    description = "crisis"
    owners = [
      "[email protected]",
    ]
    members = [
      "[email protected]",
    ]
  },
}

Module

module "group" {
  source = "./group-module"

  for_each                       = var.map_for_groups
  id                             = "${each.key}@${each.value.domain}"
  display_name                   = each.key
  description                    = each.value.description
  domain                         = each.value.domain
  owners                         = each.value.owners != null ? each.value.owners : []
  managers                       = each.value.managers != null ? each.value.managers : []
  members                        = each.value.members != null ? each.value.members : []
....
}

variables.tf

variable "map_for_groups" {
  type = map(object({
    domain                         = optional(string, "yy.com")
    owners                         = optional(list(string))
    managers                       = optional(list(string))
    description                    = optional(string, "group created with terraform")
    members                        = optional(list(string))
...
  }))
}

group-module/group-setting.tf

resource "googleworkspace_group" "create_group" {
  email       = var.id
  name        = var.display_name
  description = var.description
  aliases     = var.aliases
}

resource "googleworkspace_group_settings" "group_settings" {
  email                          = googleworkspace_group.create_group.email
  ......
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

no error

Actual Behavior

module.group["Crisis_Team"].googleworkspace_group.create_group: Creating...
module.group["Crisis_Team"].googleworkspace_group.create_group: Still creating... [10s elapsed]
module.group["Crisis_Team"].googleworkspace_group.create_group: Creation complete after 18s [id=02u6wntf0n043jl]
module.group["Crisis_Team"].googleworkspace_group_members.group_members_add[0]: Creating...
module.group["Crisis_Team"].googleworkspace_group_members.group_members_add[0]: Creation complete after 4s [id=groups/02u6wntf0n043jl]

│ Error: Provider produced inconsistent final plan

│ When expanding the plan for
│ module.group["Crisis_Team"].googleworkspace_group_settings.group_settings
│ to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/googleworkspace" produced an invalid new
│ value for .email: was
│ cty.StringVal("[email protected]"), but now
│ cty.StringVal("[email protected]").

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

time=2023-08-23T08:50:15Z level=error msg=Terraform invocation failed in /workspace/infrastructure/base/application/.terragrunt-cache/yaM8PfjkdTwTAPISn07Jj8aUYTY/_r_3GVArpItcTrZkN8HTLMN-K6Q prefix=[/workspace/infrastructure/base/application]
time=2023-08-23T08:50:15Z level=error msg=1 error occurred:
* [/workspace/infrastructure/base/application/.terragrunt-cache/yaM8PfjkdTwTAPISn07Jj8aUYTY/_r_3GVArpItcTrZkN8HTLMN-K6Q] exit status 1

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
@ankitg4 ankitg4 changed the title Provider produced inconsistent final plan after resource creation Provider produced inconsistent final plan after resource googleworkspace_group_settings creation Aug 23, 2023
@ankitg4
Copy link
Author

ankitg4 commented Aug 23, 2023

module.group["Crisis_Team"].googleworkspace_group_settings.group_settings.email case is getting changed to lower unexpectedly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant