Documentation
¶
Overview ¶
Package discovery provides functionality for discovering Terragrunt configurations.
Index ¶
- type ConfigType
- type DependencyDiscovery
- func (d *DependencyDiscovery) DiscoverAllDependencies(ctx context.Context, opts *options.TerragruntOptions) error
- func (d *DependencyDiscovery) DiscoverDependencies(ctx context.Context, opts *options.TerragruntOptions, dCfg *DiscoveredConfig) error
- func (d *DependencyDiscovery) WithDiscoverExternalDependencies() *DependencyDiscovery
- func (d *DependencyDiscovery) WithDiscoveryContext(discoveryContext *DiscoveryContext) *DependencyDiscovery
- func (d *DependencyDiscovery) WithSuppressParseErrors() *DependencyDiscovery
- type DependencyDiscoveryOption
- type DiscoveredConfig
- type DiscoveredConfigs
- func (c DiscoveredConfigs) CycleCheck() (*DiscoveredConfig, error)
- func (c DiscoveredConfigs) Filter(configType ConfigType) DiscoveredConfigs
- func (c DiscoveredConfigs) FilterByPath(path string) DiscoveredConfigs
- func (c DiscoveredConfigs) Paths() []string
- func (c DiscoveredConfigs) RemoveByPath(path string) DiscoveredConfigs
- func (c DiscoveredConfigs) RemoveCycles() (DiscoveredConfigs, error)
- func (c DiscoveredConfigs) Sort() DiscoveredConfigs
- type Discovery
- func (d *Discovery) Discover(ctx context.Context, opts *options.TerragruntOptions) (DiscoveredConfigs, error)
- func (d *Discovery) WithDiscoverDependencies() *Discovery
- func (d *Discovery) WithDiscoverExternalDependencies() *Discovery
- func (d *Discovery) WithDiscoveryContext(discoveryContext *DiscoveryContext) *Discovery
- func (d *Discovery) WithHidden() *Discovery
- func (d *Discovery) WithMaxDependencyDepth(depth int) *Discovery
- func (d *Discovery) WithParseExclude() *Discovery
- func (d *Discovery) WithSort(sort Sort) *Discovery
- func (d *Discovery) WithSuppressParseErrors() *Discovery
- type DiscoveryContext
- type DiscoveryOption
- type Sort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigType ¶
type ConfigType string
ConfigType is the type of Terragrunt configuration.
const ( // ConfigTypeUnit is the type of Terragrunt configuration for a unit. ConfigTypeUnit ConfigType = "unit" // ConfigTypeStack is the type of Terragrunt configuration for a stack. ConfigTypeStack ConfigType = "stack" )
type DependencyDiscovery ¶ added in v0.75.7
type DependencyDiscovery struct {
// contains filtered or unexported fields
}
DependencyDiscovery is the configuration for a DependencyDiscovery.
func NewDependencyDiscovery ¶ added in v0.75.7
func NewDependencyDiscovery(cfgs DiscoveredConfigs, depthRemaining int) *DependencyDiscovery
func (*DependencyDiscovery) DiscoverAllDependencies ¶ added in v0.75.7
func (d *DependencyDiscovery) DiscoverAllDependencies(ctx context.Context, opts *options.TerragruntOptions) error
func (*DependencyDiscovery) DiscoverDependencies ¶ added in v0.75.7
func (d *DependencyDiscovery) DiscoverDependencies(ctx context.Context, opts *options.TerragruntOptions, dCfg *DiscoveredConfig) error
func (*DependencyDiscovery) WithDiscoverExternalDependencies ¶ added in v0.77.3
func (d *DependencyDiscovery) WithDiscoverExternalDependencies() *DependencyDiscovery
WithDiscoverExternalDependencies sets the DiscoverExternalDependencies flag to true.
func (*DependencyDiscovery) WithDiscoveryContext ¶ added in v0.77.14
func (d *DependencyDiscovery) WithDiscoveryContext(discoveryContext *DiscoveryContext) *DependencyDiscovery
func (*DependencyDiscovery) WithSuppressParseErrors ¶ added in v0.77.3
func (d *DependencyDiscovery) WithSuppressParseErrors() *DependencyDiscovery
WithSuppressParseErrors sets the SuppressParseErrors flag to true.
type DependencyDiscoveryOption ¶ added in v0.77.3
type DependencyDiscoveryOption func(*DependencyDiscovery)
DependencyDiscoveryOption is a function that modifies a DependencyDiscovery.
type DiscoveredConfig ¶
type DiscoveredConfig struct {
Parsed *config.TerragruntConfig
DiscoveryContext *DiscoveryContext
Type ConfigType
Path string
Dependencies DiscoveredConfigs
External bool
}
DiscoveredConfig represents a discovered Terragrunt configuration.
func (*DiscoveredConfig) ContainsDependencyInAncestry ¶ added in v0.75.7
func (c *DiscoveredConfig) ContainsDependencyInAncestry(path string) bool
ContainsDependencyInAncestry returns true if the DiscoveredConfig or any of its dependencies contains the given path as a dependency.
func (*DiscoveredConfig) Parse ¶ added in v0.77.14
func (c *DiscoveredConfig) Parse(ctx context.Context, opts *options.TerragruntOptions, suppressParseErrors bool) error
Parse parses the discovered configurations.
func (*DiscoveredConfig) String ¶
func (c *DiscoveredConfig) String() string
String returns a string representation of a DiscoveredConfig.
type DiscoveredConfigs ¶
type DiscoveredConfigs []*DiscoveredConfig
DiscoveredConfigs is a list of discovered Terragrunt configurations.
func (DiscoveredConfigs) CycleCheck ¶ added in v0.75.7
func (c DiscoveredConfigs) CycleCheck() (*DiscoveredConfig, error)
CycleCheck checks for cycles in the dependency graph. If a cycle is detected, it returns the first DiscoveredConfig that is part of the cycle, and an error. If no cycle is detected, it returns nil and nil.
func (DiscoveredConfigs) Filter ¶
func (c DiscoveredConfigs) Filter(configType ConfigType) DiscoveredConfigs
Filter filters the DiscoveredConfigs by config type.
func (DiscoveredConfigs) FilterByPath ¶
func (c DiscoveredConfigs) FilterByPath(path string) DiscoveredConfigs
FilterByPath filters the DiscoveredConfigs by path.
func (DiscoveredConfigs) Paths ¶
func (c DiscoveredConfigs) Paths() []string
Paths returns the paths of the DiscoveredConfigs.
func (DiscoveredConfigs) RemoveByPath ¶ added in v0.77.3
func (c DiscoveredConfigs) RemoveByPath(path string) DiscoveredConfigs
RemoveByPath removes the DiscoveredConfig with the given path from the DiscoveredConfigs.
func (DiscoveredConfigs) RemoveCycles ¶ added in v0.77.3
func (c DiscoveredConfigs) RemoveCycles() (DiscoveredConfigs, error)
RemoveCycles removes cycles from the dependency graph.
func (DiscoveredConfigs) Sort ¶
func (c DiscoveredConfigs) Sort() DiscoveredConfigs
Sort sorts the DiscoveredConfigs by path.
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery is the configuration for a Terragrunt discovery.
func NewDiscovery ¶
func NewDiscovery(dir string, opts ...DiscoveryOption) *Discovery
NewDiscovery creates a new Discovery.
func (*Discovery) Discover ¶
func (d *Discovery) Discover(ctx context.Context, opts *options.TerragruntOptions) (DiscoveredConfigs, error)
Discover discovers Terragrunt configurations in the WorkingDir.
func (*Discovery) WithDiscoverDependencies ¶ added in v0.75.7
WithDiscoverDependencies sets the DiscoverDependencies flag to true.
func (*Discovery) WithDiscoverExternalDependencies ¶ added in v0.75.7
WithDiscoverExternalDependencies sets the DiscoverExternalDependencies flag to true.
func (*Discovery) WithDiscoveryContext ¶ added in v0.77.14
func (d *Discovery) WithDiscoveryContext(discoveryContext *DiscoveryContext) *Discovery
WithDiscoveryContext sets the DiscoveryContext flag to the given context.
func (*Discovery) WithHidden ¶
WithHidden sets the Hidden flag to true.
func (*Discovery) WithMaxDependencyDepth ¶ added in v0.75.7
WithMaxDependencyDepth sets the MaxDependencyDepth flag to the given depth.
func (*Discovery) WithParseExclude ¶ added in v0.77.14
WithParseExclude sets the ParseExclude flag to true.
func (*Discovery) WithSuppressParseErrors ¶ added in v0.77.3
WithSuppressParseErrors sets the SuppressParseErrors flag to true.
type DiscoveryContext ¶ added in v0.77.14
DiscoveryContext is the context in which a DiscoveredConfig was discovered.
It's useful to know this information, because it can help us determine how the DiscoveredConfig should be processed later.
type DiscoveryOption ¶
type DiscoveryOption func(*Discovery)
DiscoveryOption is a function that modifies a Discovery.