You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kklimonda-cl
changed the title
Implement create_import_id Terraform function that dispatches call to per-resource functions based on the resource name
Implement create_import_id Terraform function to convert resources into import IDs
Aug 30, 2024
Implementation
Basics
Function signature:
provider::panos::create_import_id(string, object)
string -- this is resource name (e.g. panos_address_group)
object -- this is an instance of the resource that Import ID is being generated for
Example code
Basic implementation would look similar to the following:
Instead of switching on resourceAsn value, it would be cleaner to generate a map of resource name -> creator function that can be then used like:
Usage Examples
The text was updated successfully, but these errors were encountered: