PaloAltoNetworks / terraform-provider-prismacloudcompute

Terraform provider for Prisma Cloud Compute
https://registry.terraform.io/providers/PaloAltoNetworks/prismacloudcompute/latest
Mozilla Public License 2.0
24 stars 28 forks source link

Unable to import prismacloudcompute_custom_rule #46

Closed jeremyp-synopsys closed 1 year ago

jeremyp-synopsys commented 2 years ago

Describe the bug

I have a pre-existing custom rule (fooBarRule) in the console. Unable to import using either the prisma internal id (_id) or the name field.

Expected behavior

Import custom rule with ID to state

Current behavior

No matter the value used for resource ID, the response is always "Error: error reading custom rule: custom rule '0' not found" with the value always a 0

Steps to reproduce

  1. Define below resource in plan
    resource "prismacloudcompute_custom_rule" "foo_bar_rule" {
    name = "fooBarRule"
    type = "filesystem"
    description = "for testing"
    message = "%proc.name wrote to file %file.path"
    script = "file.path startswith \"/foo\""
    }
  2. Attempt to import using one of below import commands (with appropriate ID)
    terraform import prismacloudcompute_custom_rule.foo_bar_rule  "fooBarRule"
    terraform import prismacloudcompute_custom_rule.foo_bar_rule  123
  3. Debug log output
    
    2022-02-15T17:18:04.271-0500 [DEBUG] provider.terraform-provider-prismacloudcompute_v0.5.0: plugin address: address=/var/folders/b3/9rfgjst512374v8z7wcz6p1w0000gn/T/plugin2829399928 network=unix timestamp=2022-02-15T17:18:04.271-0500
    2022-02-15T17:18:04.289-0500 [WARN]  ValidateProviderConfig from "provider[\"registry.terraform.io/paloaltonetworks/prismacloudcompute\"]" changed the config value, but that value is unused
    2022-02-15T17:18:04.421-0500 [ERROR] vertex "import prismacloudcompute_custom_rule.foo_bar_rule result" error: error reading custom rule: custom rule '0' not found
    2022-02-15T17:18:04.421-0500 [ERROR] vertex "prismacloudcompute_custom_rule.foo_bar_rule (import id \"123\")" error: error reading custom rule: custom rule '0' not found
    ╷
    │ Error: error reading custom rule: custom rule '0' not found
    │
    │
    ╵

2022-02-15T17:18:04.530-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"



## Context

This is 

## Your Environment

- Version used: Console - 22.01.840
- TF CLI - 1.1.4
maxboynton commented 1 year ago

Issue has been addressed in the v0.8.0 release (https://github.com/PaloAltoNetworks/terraform-provider-prismacloudcompute/pull/71).