Skip to content

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

Open
@jycamier

Description

@jycamier

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions