PaloAltoNetworks / pan-os-codegen

Generator for pango SDK and panos Terraform Provider
MIT License
4 stars 0 forks source link

Re-implement state import without tfid #148

Open kklimonda-cl opened 2 weeks ago

kklimonda-cl commented 2 weeks ago

Description

We want to drop Tfid attribute that is now common between all resources, and instead make use of the fact that the terraform ID used during state import can be any string value.

The new interface for creating import id would be based on provider functions, introduced in Terraform 1.8 and OpenTofu 1.8:

data "panos_address_group" "test_group" {
  location = {
    shared               = true
    from_panorama_shared = false
  }

  name = "test-group"
}

output "test_group_import_id" {
  value = provider::panos::create_import_id("panos_address_group", data.panos_address_group.test_group)
}

Implementation