PaloAltoNetworks / terraform-provider-panos

Terraform Panos provider
https://www.terraform.io/docs/providers/panos/
Mozilla Public License 2.0
87 stars 70 forks source link

template/template_stack: can't both be enforced yet conflicting #295

Open cyphermox opened 3 years ago

cyphermox commented 3 years ago

Likely closes #294

The template and template_stack objects are enforced when running plan/apply against imported objects; otherwise the engine would want to completely replace the objects, which would likely cause consistency issues with the rest of the configuration.

Since they are both enforced; they can't also be conflicting; that leads to an impossible scenario where you must but can't define both a template and template_stack.

Signed-off-by: Mathieu Trudel-Lapierre mtrudel@stack8.com

Description

Make these schema fields not conflicting

Motivation and Context

See above

How Has This Been Tested?

I am running this against a subset of my production config with good results (ie. terraform plan shows no changes to be applied when running the proposed code, with template_stack and template both set on panorama-defined zones).

Types of changes

Checklist

welcome-to-palo-alto-networks[bot] commented 3 years ago

:tada: Thanks for opening this pull request! We really appreciate contributors like you! :raised_hands:

cyphermox commented 3 years ago

This isn't tested yet, I need to figure out how to build the provider first. I submitted the PR right away to have a discussion if the approach is right; I believe making changes non-destructive is more important than preserving this particular conflict in the schema.

cyphermox commented 3 years ago

Yeah, that code change alone doesn't seem to work; I've built the provider and using it locally, but it still complains about conflicts.

cyphermox commented 3 years ago

@shinmog I think this is ready for review.