PaloAltoNetworks / terraform-provider-prismacloud

Terraform PrismaCloud provider
https://www.terraform.io/docs/providers/prismacloud/
Mozilla Public License 2.0
54 stars 65 forks source link

Report modification attempts update instead of destroy & recreate #294

Open CanadaLifeKyle opened 2 months ago

CanadaLifeKyle commented 2 months ago

Describe the bug

When modifying a prismacloud_report resource, the terraform provider will attempt to modify the existing report. Aside from updating the notification or scheduling fields of a reoccurring report, the Prisma API does not allow for modification of a report.

This results in incomplete modifications of reports and terraform incorrectly reporting a successful apply.

Expected behavior

When making a modification to any field other than notify_to, notification_template_id or schedule, the report resource should be destroyed and recreated.

Current behavior

Terraform attempts a modification and reports success even when immutable values are affected.

Possible solution

Either destroy and recreate reports on modification; or add logic to allow modification in place when updating valid fields, otherwise destroy and recreate.

Your Environment

Terraform v1.9.1 Prismacloud provider 1.5.6

Terraform executed within Gitlab pipelines.