terraform-provider-prismacloud icon indicating copy to clipboard operation
terraform-provider-prismacloud copied to clipboard

Provider produced inconsistent result after apply

Open Satyajeetsendha11 opened this issue 1 year ago • 3 comments

Hi Team, Below is the error.

Error: Provider produced inconsistent result after apply  │  │ When applying changes to prismacloud_policy.PC-GCP-GKE-151, provider │ "provider["registry.terraform.io/paloaltonetworks/prismacloud"]" produced │ an unexpected new value: Root resource 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

We are using Terraform to manage all the policies in our Prisma Cloud Console, our Terraform Provider Version is "1.3.7". How can we find the absent resource because our Policies is built-in policies and we imported that policy to Terraform to manage.

Your Environment

We manage 304 policy in Terraform but this error occured in our last commit.

  • Version used: "1.3.7"

Satyajeetsendha11 avatar May 12 '23 15:05 Satyajeetsendha11

:tada: Thanks for opening your first issue here! Welcome to the community!

We are also running into this error:

Terraform v1.5.6 Prisma Provider Version: 1.4.9

When applying changes to prismacloud_policy.random_named_policy, provider "provider[\"registry.terraform.io/paloaltonetworks/prismacloud\"]" produced an unexpected new value: Root resource was present, but now absent.

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

Interesting enough, although we got this error, TF did create the resource... But it didn't update state. So when we tried to run another plan and apply:

  1. Plan was fine and said it wanted to create policy named random_named_policy
  2. Apply failed with the following:
Error: 400/https://apiX.prismacloud.io/policy Error(msg:duplicate_name severity:error subject:name)
with prismacloud_policy.random_named_policy
on X.tf line xxx, in resource "prismacloud_policy" "random_named_policy":
resource "prismacloud_policy" "random_named_policy" {

Have you guys had a chance to review?

infosec-shinobi avatar Dec 12 '23 18:12 infosec-shinobi

@infosec-shinobi We are unable to replicate the error on our end. It would be helpful if you could share the resource template of the policy you are trying to create. We would be happy to assist you.

AnushreeHS avatar Jan 16 '24 09:01 AnushreeHS