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

bug: Root object was present, but now absent. #641

Open
jycamier opened this issue May 28, 2024 · 0 comments
Open

bug: Root object was present, but now absent. #641

jycamier opened this issue May 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jycamier
Copy link

Describe the bug

Impossible to apply some ressource which already exist.

To Reproduce

I've create a module which contains the following code

resource "lacework_resource_group" "aws_by_team" {
  name        = format("aws-%s", var.team_name)
  type        = "AWS"
  description = format("list all aws resources by tag team=%s", var.team_name)
  group {
    operator = "OR"
    filter {
      filter_name = "filter0"
      field       = "Resource Tag"
      operation   = "EQUALS"
      key         = "team"
      value       = var.aws_team_tag
    }
  }
}

resource "lacework_resource_group" "container_by_team" {
  name        = format("container-%s", var.team_name)
  type        = "CONTAINER"
  description = format("list all container resources by tag team=%s", var.team_name)
  group {
    operator = "OR"
    filter {
      filter_name = "filter0"
      field       = "Container Label"
      operation   = "EQUALS"
      key         = "io.kubernetes.pod.namespace"
      value       = var.k8s_namespaces
    }
  }
}

I call this code which is in a local module and I've add 2 import block because the 3 RG already exist.

module "exemple" {
  source = "../_modules/my_module"
  k8s_namespaces = [
    "foo",
    "bar",
  ]
  team_name = "foobar"
  aws_team_tag = ["foobar"]
}

import {
  id = "FOOBAR_D95DD495216E47DF1CA03E56D9E0E3C9EC335B4B2RC7ER6"
  to = module.exemple.lacework_resource_group.aws_by_team
}

import {
  id = "FOOBAR_E9843C68232C802B4E3A6292800D91A136BB25DE4BR12RB"
  to = module.exemple.lacework_resource_group.container_by_team
}

during the apply, the following errors come :

│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.exemple.lacework_resource_group.container_by_team, provider "provider[\"registry.terraform.io/lacework/lacework\"]" produced an
│ unexpected new value: Root object was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.exemple.lacework_resource_group.aws_by_team, provider "provider[\"registry.terraform.io/lacework/lacework\"]" produced an unexpected new
│ value: Root object was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Expected behavior
It works.

Please complete the following information):

  • OS: macOs Sonoma 14.4.1
  • Provider Version 1.19
@jycamier jycamier added the bug Something isn't working label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant