github.com/hashicorp/terraform-plugin-sdk@v1.17.2/terraform/path.go (about)

     1  package terraform
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/hashicorp/terraform-plugin-sdk/internal/addrs"
     7  )
     8  
     9  // PathObjectCacheKey is like PathCacheKey but includes an additional name
    10  // to be included in the key, for module-namespaced objects.
    11  //
    12  // The result of this function is guaranteed unique for any distinct pair
    13  // of path and name, but is not guaranteed to be in any particular format
    14  // and in particular should never be shown to end-users.
    15  func PathObjectCacheKey(path addrs.ModuleInstance, objectName string) string {
    16  	return fmt.Sprintf("%s|%s", path.String(), objectName)
    17  }