Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(state []byte) ([]byte, error)
- func FindChangesInLogs(in io.Reader) (bool, error)
- func NewKubernetesBackend(namespace, suffux string) ([]byte, error)
- func NewTerraformProvider(provider string, configuration []byte) ([]byte, error)
- type ErrorDetection
- type OutputValue
- type Resource
- type State
Constants ¶
View Source
const TerraformStateOutputsKey = "outputs"
TerraformStateOutputsKey is the key for the terraform state outputs
Variables ¶
View Source
var ( // Detectors is the error detection pattern Detectors = map[string][]ErrorDetection{ "aws": { { Regex: "operation error STS: GetCallerIdentity", Message: "AWS Credentials in provider has been missconfigured, contact platform administrator", }, }, "google": {}, "azurerm": {}, "*": { { Regex: "error validating provider credentials", Message: "Provider credentials are missconfigured, please contact the platform administrator", }, }, } )
Functions ¶
func FindChangesInLogs ¶
FindChangesInLogs is used to scan the logs for the terraform line which informs on changes
func NewKubernetesBackend ¶
NewKubernetesBackend creates a new kubernetes backend
Types ¶
type ErrorDetection ¶
type ErrorDetection struct { // Regex is the string we are looking for Regex string // Message is cause of the error Message string }
ErrorDetection defines an error and potential causes for it.
type OutputValue ¶
type OutputValue struct {
// Value is the value of the output
Value interface{} `json:"value,omitempty"`
}
OutputValue is a value of the terraform output
func (*OutputValue) String ¶
func (o *OutputValue) String() string
String returns an string representation of the value
type Resource ¶
type Resource struct { // Mode is the mode of the resource Mode string `json:"mode,omitempty"` // Type is the type of the resource Type string `json:"type,omitempty"` // Instances a collection of the resource instances in the state Instances []map[string]interface{} `json:"instances,omitempty"` }
Resource represents a resource in the state
type State ¶
type State struct { // Outputs are the terraform outputs Outputs map[string]OutputValue `json:"outputs"` // Resources is a collection of resources in the state Resources []Resource `json:"resources,omitempty"` // TerraformVersion is the version of terraform used TerraformVersion string `json:"terraform_version,omitempty"` }
State is the state of the terraform
func DecodeState ¶
DecodeState decodes the terraform state outputs
func (*State) CountResources ¶
CountResources returns the number of managed resources from the state
func (*State) HasOutputs ¶
HasOutputs returns true if the state has outputs
Click to show internal directories.
Click to hide internal directories.