Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
Dictionary is a map which defines ImportIDFunc for each resource type.
func NewDictionary ¶
func NewDictionary() *Dictionary
NewDictionary returns a new instance of Dictionary.
func (*Dictionary) ImportID ¶
func (d *Dictionary) ImportID(resourceType string, r Resource) (string, error)
ImportID calculates an import ID from a given resource.
func (*Dictionary) RegisterImportIDFunc ¶
func (d *Dictionary) RegisterImportIDFunc(resourceType string, f ImportIDFunc)
RegisterImportIDFunc registers an ImportIDFunc for a given resource type.
func (*Dictionary) RegisterImportIDFuncMap ¶
func (d *Dictionary) RegisterImportIDFuncMap(importIDFuncMap map[string]ImportIDFunc)
RegisterImportIDFuncMap is a helper method to register a map of ImportIDFunc.
type ImportIDFunc ¶
ImportIDFunc is a type of function which calculates an import ID from a given resource.
func ImportIDFuncByAttribute ¶
func ImportIDFuncByAttribute(key string) ImportIDFunc
ImportIDFuncByAttribute is a helper method to define an ImportIDFunc which simply uses a specific single attribute as an import ID.
func ImportIDFuncByMultiAttributes ¶
func ImportIDFuncByMultiAttributes(keys []string, sep string) ImportIDFunc
ImportIDFuncByMultiAttributes is a helper method to define an ImportIDFunc which joins multiple attributes by a given separater.
type Resource ¶
type Resource map[string]interface{}
Resource is a type which is equivalent to a type of Plan.ResourceChanges[].Change.After in hashicorp/terraform-json, but map[string]interface{} is too generic, so we give it a friendly alias. https://pkg.go.dev/github.com/hashicorp/terraform-json#Change