Documentation ¶
Index ¶
Constants ¶
const (
// Wildcard denotes a wildcard resource name
Wildcard = "*"
)
Variables ¶
var ( // ReRef represents a regular expression for Terraform resource references // in scraped HCL example manifests. ReRef = regexp.MustCompile(`\${(.+)}`) )
Functions ¶
This section is empty.
Types ¶
type Injector ¶
Injector resolves references using provider metadata
func NewInjector ¶
NewInjector initializes a new Injector
func (*Injector) InjectReferences ¶
InjectReferences injects cross-resource references using the provider metadata scraped from the Terraform registry.
func (*Injector) ResolveReferencesOfPaved ¶
func (rr *Injector) ResolveReferencesOfPaved(pm *PavedWithManifest, resolutionContext *ResolutionContext) error
ResolveReferencesOfPaved resolves references of a PavedWithManifest in the given resolution context.
type Parts ¶
Parts represents the components (resource name, example name & attribute name) parsed from an HCL reference.
func MatchRefParts ¶
MatchRefParts parses a Parts from an HCL reference string
func NewRefParts ¶
NewRefParts initializes a new Parts from the specified resource and example names.
func NewRefPartsFromResourceName ¶
NewRefPartsFromResourceName initializes a new Parts from the specified <resource name>.<example name> string.
func (Parts) GetResourceName ¶
GetResourceName returns the resource name or the wildcard for this Parts.
type PavedWithManifest ¶
type PavedWithManifest struct { Paved *fieldpath.Paved ManifestPath string ParamsPrefix []string Config *config.Resource Group string Version string ExampleName string // contains filtered or unexported fields }
PavedWithManifest represents an example manifest with a fieldpath.Paved
type ResolutionContext ¶
type ResolutionContext struct { WildcardNames bool Context map[string]*PavedWithManifest }
ResolutionContext represents a reference resolution context where wildcard or named references are used.
func PrepareLocalResolutionContext ¶
func PrepareLocalResolutionContext(exampleMeta registry.ResourceExample, rootName string) (*ResolutionContext, error)
PrepareLocalResolutionContext returns a ResolutionContext that can be used for resolving references between a target resource and its dependencies that are exemplified together with the resource in Terraform registry.