Documentation
¶
Index ¶
- func DetectModuleSourceType(source string) (string, string)
- func GetProviderFromResourceType(resourceType string) (string, error)
- func LooksLikeLocalModuleSource(source string) bool
- func ParseTerraformModules(ctx context.Context, files model.FileMetadatas) (map[string]ParsedModule, error)
- type ModuleAttributesInfo
- type ModuleParseResult
- type ParsedModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectModuleSourceType ¶
nolint:gocritic
func GetProviderFromResourceType ¶
GetProviderFromResourceType extracts the provider name from a Terraform resource type. For example: "aws_s3_bucket" → "aws", "azurerm_network_interface" → "azurerm"
func LooksLikeLocalModuleSource ¶
LooksLikeLocalModuleSource uses heuristics to determine if the resolved source string is likely local
func ParseTerraformModules ¶
func ParseTerraformModules(ctx context.Context, files model.FileMetadatas) (map[string]ParsedModule, error)
nolint:gocyclo ParseTerraformModules parses HCL content and extracts module source/version, resolving locals/variables if possible.
Types ¶
type ModuleAttributesInfo ¶
type ModuleParseResult ¶
type ModuleParseResult struct {
Module ParsedModule
Error error
}
type ParsedModule ¶
type ParsedModule struct {
Name string
AbsSource string
Source string
Version string
IsLocal bool
SourceType string // local, git, registry, etc.
RegistryScope string // public, private, or "" (non-registry)
AttributesData map[string]ModuleAttributesInfo
}
func ParseAllModuleVariables ¶
func ParseAllModuleVariables(ctx context.Context, modules map[string]ParsedModule, rootDir string) []ParsedModule
Click to show internal directories.
Click to hide internal directories.