Documentation ¶
Overview ¶
Package tfconf is the representation of a Terraform Module
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct { Name string `json:"name" xml:"name" yaml:"name"` Type types.String `json:"type" xml:"type" yaml:"type"` Description types.String `json:"description" xml:"description" yaml:"description"` Default types.Value `json:"default" xml:"default" yaml:"default"` Required bool `json:"required" xml:"required" yaml:"required"` Position Position `json:"-" xml:"-" yaml:"-"` }
Input represents a Terraform input.
func (*Input) GetValue ¶
GetValue returns JSON representation of the 'Default' value, which is an 'interface'. If 'Default' is a primitive type, the primitive value of 'Default' will be returned and not the JSON formatted of it.
func (*Input) HasDefault ¶
HasDefault indicates if a Terraform variable has a default value set.
type Module ¶
type Module struct { XMLName xml.Name `json:"-" xml:"module" yaml:"-"` Header string `json:"header" xml:"header" yaml:"header"` Inputs []*Input `json:"inputs" xml:"inputs>input" yaml:"inputs"` Outputs []*Output `json:"outputs" xml:"outputs>output" yaml:"outputs"` Providers []*Provider `json:"providers" xml:"providers>provider" yaml:"providers"` Requirements []*Requirement `json:"requirements" xml:"requirements>requirement" yaml:"requirements"` RequiredInputs []*Input `json:"-" xml:"-" yaml:"-"` OptionalInputs []*Input `json:"-" xml:"-" yaml:"-"` }
Module represents a Terraform module. It consists of
- Header ('header' json key): Module header found in shape of multi line comments at the beginning of 'main.tf' - Inputs ('inputs' json key): List of input 'variables' 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 ('header' json key): List of 'requirements' extracted from the Terraform module .tf files
func (*Module) HasOutputs ¶
HasOutputs indicates if the module has outputs.
func (*Module) HasProviders ¶
HasProviders indicates if the module has providers.
func (*Module) HasRequirements ¶
HasRequirements indicates if the module has requirements.
type Output ¶
type Output struct { Name string `json:"name" xml:"name" yaml:"name"` Description types.String `json:"description" xml:"description" yaml:"description"` Value types.Value `json:"value,omitempty" xml:"value,omitempty" yaml:"value,omitempty"` Sensitive bool `json:"sensitive,omitempty" xml:"sensitive,omitempty" yaml:"sensitive,omitempty"` Position Position `json:"-" xml:"-" yaml:"-"` ShowValue bool `json:"-" xml:"-" yaml:"-"` }
Output represents a Terraform output.
func (*Output) GetValue ¶
GetValue returns JSON representation of the 'Value', which is an 'interface'. If 'Value' is a primitive type, the primitive value of 'Value' will be returned and not the JSON formatted of it.
func (*Output) HasDefault ¶
HasDefault indicates if a Terraform output has a default value set.
func (*Output) MarshalJSON ¶
MarshalJSON custom yaml marshal function to take '--output-values' flag into consideration. It means if the flag is not set Value and Sensitive fields are set to 'omitempty', otherwise if output values are being shown 'omitempty' gets explicitly removed to show even empty and false values.
func (*Output) MarshalXML ¶
MarshalXML custom xml marshal function to take '--output-values' flag into consideration. It means if the flag is not set Value and Sensitive fields are set to 'omitempty', otherwise if output values are being shown 'omitempty' gets explicitly removed to show even empty and false values.
func (*Output) MarshalYAML ¶
MarshalYAML custom yaml marshal function to take '--output-values' flag into consideration. It means if the flag is not set Value and Sensitive fields are set to 'omitempty', otherwise if output values are being shown 'omitempty' gets explicitly removed to show even empty and false values.
type Position ¶
type Position struct { Filename string `json:"-" xml:"-" yaml:"-"` Line int `json:"-" xml:"-" yaml:"-"` }
Position represents position of Terraform input or output in a file.
type Provider ¶
type Provider struct { Name string `json:"name" xml:"name" yaml:"name"` Alias types.String `json:"alias" xml:"alias" yaml:"alias"` Version types.String `json:"version" xml:"version" yaml:"version"` Position Position `json:"-" xml:"-" yaml:"-"` }
Provider represents a Terraform output.
type Requirement ¶
type Requirement struct { Name string `json:"name" xml:"name" yaml:"name"` Version types.String `json:"version" xml:"version" yaml:"version"` }
Requirement represents a requirement for Terraform module.