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

incapsula_acl_security_rule Error: Provider produced inconsistent result after apply #49

Closed ferrangb7 closed 3 years ago

ferrangb7 commented 3 years ago

When adding ACL rules, the plan looks good but it looks like the provider is unable to apply incapsula_acl_security_rule resources. Using provider incapsula v2.1.0

PLAN

# incapsula_acl_security_rule.acl-blacklist-ip will be created
+ resource "incapsula_acl_security_rule" "acl-blacklist-ip" {
      + id      = (known after apply)
      + ips     = "172.22.150.110/32, 172.21.150.130/32"
      + rule_id = "api.acl.blacklisted_ips"
      + site_id = 89***
    }

APPLY

running "terraform apply":
incapsula_acl_security_rule.acl-blacklist-ip: Creating...

Error: Provider produced inconsistent result after apply

When applying changes to
incapsula_acl_security_rule.acl-blacklist-ip,
provider "incapsula" produced an unexpected new value for was present, but now
absent.

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

any idea what to do here?

Thank you.

seanmcelroy commented 3 years ago

I am pretty sure this is related to the new "Policy Management" feature they rolled out, as now there are no ACL's, they exist as Policies. I think someone at Imperva didn't think about the implications of that feature as it relates to their API and this provider.

anandkunal commented 3 years ago

Hi @ferrangb7 @seanmcelroy - we've gone ahead and added policy management to the provider. You can find an example in the docs: https://registry.terraform.io/providers/imperva/incapsula/latest/docs/resources/policy as well as in examples/example.tf (grep for Security Policies). I'm going to go ahead and close this out. If you run into issues with policies, please file another issue. Thanks and sorry for the delay.