imperva / terraform-provider-incapsula

This package is a plugin for Terraform, and is designed to be used to auto-provision sites in Incapsula via Incapsula’s API from the terraform cli/yaml configurations.
Mozilla Public License 2.0
44 stars 72 forks source link

User Caching Issue Completely Blocks Ability to `terraform apply` #434

Open ren3gadem4rm0t opened 4 months ago

ren3gadem4rm0t commented 4 months ago

Confirmation

Terraform and Imperva provider version

Terraform v1.5.7 on darwin_arm64

Affected resource(s)

incapsula_account_user

Terraform configuration files

Omitted

Debug output

n/a

Panic output

n/a

Expected output

Resources created/updated.

Actual output

Error: Error status code 409 from Incapsula service when adding User exampleuser@example.org: {"errors": [{"status":409, "id": "omitted", "source" : {"pointer":"/v3/idm-users"}, "title" : "Resource already exist [USER]", "detail": "User exampleuser@example.org already exist"}]}

with module. user_accounts. incapsula_account_user.parent._account_user["exampleuser@example.org_0000000"],
on modules/user_accounts/main.tf line 1, in resource "incapsula_account_user" "parent_account_user":
1: resource "incapsula_account_user" "parent_account_user" {

Releasing state lock. This may take a few moments...

then, removing the user from the state file via terraform state rm ...:

╷
│ Error: Error status code 404 from Incapsula service when getting User exampleuser@example.org: {"errors":[{"status":404,"id":"omitted","source":{"pointer":"/v3/idm-users/exampleuser@example.org"},"title":"The requested item was not found","detail":"User with email exampleuser@example.org does not exist"}]}
│ 
│ 
╵

Steps to reproduce

  1. terraform plan
  2. terraform apply
  3. terraform state rm [resource here]
  4. terraform apply

Additional factoids

This issue exists outside of the terraform provider, within the Imperva API. However, while present it completely blocks the ability to manage any aspects of Imperva via terraform.

We've been completely blocked for 6 days.

References

No response