Documentation ¶
Overview ¶
Package terraform is the representation of a Terraform Module.
Index ¶
- type Input
- type Module
- type ModuleCall
- type Output
- type Position
- type Provider
- type Requirement
- type Resource
- type SectionFn
- func WithFooter(h string) SectionFn
- func WithHeader(h string) SectionFn
- func WithInputs(i []*Input) SectionFn
- func WithModuleCalls(mc []*ModuleCall) SectionFn
- func WithOptionalInputs(oi []*Input) SectionFn
- func WithOutputs(o []*Output) SectionFn
- func WithProviders(p []*Provider) SectionFn
- func WithRequiredInputs(ri []*Input) SectionFn
- func WithRequirements(r []*Requirement) SectionFn
- func WithResources(r []*Resource) SectionFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct { Name string Type string Description string Default interface{} Required bool Position Position }
Input represents a Terraform input.
type Module ¶
type Module interface { // HasHeader indicates if the module has header. HasHeader() bool HasFooter() bool // HasInputs indicates if the module has inputs. HasInputs() bool // HasModuleCalls indicates if the module has inputs. HasModuleCalls() bool // HasOutputs indicates if the module has outputs. HasOutputs() bool // HasProviders indicates if the module has providers. HasProviders() bool // HasRequirements indicates if the module has requirements. HasRequirements() bool // HasResources indicates if the module has resources. HasResources() bool }
Module represents a Terraform module. It consists of
- Header ('header' json key): Module header found in shape of multi line '*.tf' comments or an entire file - Footer ('footer' json key): Module footer found in shape of multi line '*.tf' comments or an entire file - Inputs ('inputs' json key): List of input 'variables' extracted from the Terraform module .tf files - ModuleCalls ('modules' json key): List of 'modules' extracted from the Terraform module .tf files - Outputs ('outputs' json key): List of 'outputs' extracted from Terraform module .tf files - Providers ('providers' json key): List of 'providers' extracted from resources used in Terraform module - Requirements ('requirements' json key): List of 'requirements' extracted from the Terraform module .tf files - Resources ('resources' json key): List of 'resources' extracted from the Terraform module .tf files
type ModuleCall ¶
ModuleCall represents a submodule called by Terraform module.
type Output ¶
type Output struct { Name string Description string Value interface{} Sensitive bool Position Position ShowValue bool }
Output represents a Terraform output.
type Requirement ¶
Requirement represents a requirement for Terraform module.
type Resource ¶
type Resource struct { Type string ProviderName string ProviderSource string Mode string Version string }
Resource represents a managed or data type that is created by the module
type SectionFn ¶
type SectionFn func(*module)
SectionFn is a callback function to add section data into module.
func WithFooter ¶ added in v0.2.0
WithFooter adds footer to Module.
func WithModuleCalls ¶
func WithModuleCalls(mc []*ModuleCall) SectionFn
WithModuleCalls adds Modulecalls to Module.
func WithOptionalInputs ¶
WithOptionalInputs adds optional inputs to Module.
func WithProviders ¶
WithProviders adds providers to Module.
func WithRequiredInputs ¶
WithRequiredInputs adds required inputs to Module.
func WithRequirements ¶
func WithRequirements(r []*Requirement) SectionFn
WithRequirements adds requirements to Module.
func WithResources ¶
WithResources adds resources to Module.