Skip to content

pulsar_permission_grant does not fail plan when the referenced namespace does not exist #209

Description

@Hongyi23

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.15.8
on darwin_arm64
provider registry.terraform.io/streamnative/pulsar v0.11.0

Affected Resource(s)

  • pulsar_permission_grant

Terraform Configuration Files

# A tenant that already exists, but the namespace "my-tenant/missing-ns" does NOT.
resource "pulsar_permission_grant" "example" {
  namespace = "my-tenant/missing-ns"
  role      = "my-role"
  actions   = ["produce", "consume"]
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

terraform plan should fail with a clear diagnostic when the grant references a namespace that does not exist, so the misconfiguration is caught at CI time, before the change is merged.

Actual Behavior

terraform plan succeeds (a false green). The failure only surfaces at terraform apply as a 404 Namespace not found error from the Pulsar API — after the change has already been merged and the CD pipeline runs.

The root cause is that pulsar_permission_grant performs no namespace-existence validation during plan. Since plan does not make live API calls for the resource, the missing dependency is silently ignored until apply.

Steps to Reproduce

  1. Ensure a tenant exists (e.g. my-tenant) but a namespace under it (e.g. my-tenant/missing-ns) does not.
  2. Declare a pulsar_permission_grant targeting my-tenant/missing-ns.
  3. Run terraform plan → it succeeds (no error).
  4. Run terraform apply → it fails with 404 Namespace not found.

Important Factoids

N/A

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions