astro

package
v0.0.0-...-a16ed4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigFromFile

func NewConfigFromFile(configFilePath string) (*conf.Project, error)

NewConfigFromFile parses the configuration in the specified config file

Types

type ApplyExecutionParameters

type ApplyExecutionParameters struct {
	ExecutionParameters
}

type ExecutionParameters

type ExecutionParameters struct {
	ModuleNames         []string
	UserVars            *UserVariables
	TerraformParameters []string
}

func NoExecutionParameters

func NoExecutionParameters() ExecutionParameters

type MissingRequiredVarsError

type MissingRequiredVarsError struct {
	// contains filtered or unexported fields
}

MissingRequiredVarsError is an error type that is returned from plan or apply when there are variables that need to be provided at run time that are missing.

func (MissingRequiredVarsError) Error

func (e MissingRequiredVarsError) Error() string

Error is the error message, so this satisfies the error interface.

func (MissingRequiredVarsError) MissingVars

func (e MissingRequiredVarsError) MissingVars() []string

MissingVars returns a list of the missing user variables.

type Option

type Option func(*Project) error

Option is an option for the c that allows for changing of options or dependency injection for testing.

func WithConfig

func WithConfig(config conf.Project) Option

WithConfig allows you to pass project config.

type PlanExecutionParameters

type PlanExecutionParameters struct {
	ExecutionParameters
	Detach bool
}

func NoPlanExecutionParameters

func NoPlanExecutionParameters() PlanExecutionParameters

type Project

type Project struct {
	// contains filtered or unexported fields
}

Project is a collection of Terraform modules, based on configuration.

Modules may be invoked with various parameters, which are either provided by the user at runtime, or predefined in configuration.

The combination of a module, along with a map of variable values, is called an "execution".

Executions can have dependencies between each other (again, defined in the configuration). Based on dependencies, all modules can be planned or applied concurrently.

func NewProject

func NewProject(opts ...Option) (*Project, error)

NewProject returns a new instance of Project.

func NewProjectFromConfigFile

func NewProjectFromConfigFile(configFilePath string) (*Project, error)

NewProjectFromConfigFile creates a new Project based on the specified config file.

func NewProjectFromYAML

func NewProjectFromYAML(yamlBytes []byte) (*Project, error)

NewProjectFromYAML creates a new Project based on the specified YAML config.

func (*Project) Apply

func (c *Project) Apply(parameters ApplyExecutionParameters) (<-chan string, <-chan *Result, error)

Apply does a Terraform apply for every possible execution, in parallel, taking into consideration dependencies. It returns an error if it is unable to start, e.g. due to a missing required variable.

func (*Project) Plan

func (c *Project) Plan(parameters PlanExecutionParameters) (<-chan string, <-chan *Result, error)

Plan does a Terraform plan for every possible execution, in parallel, ignoring dependencies.

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result is what is returned from astro execution.

func (*Result) Err

func (r *Result) Err() error

Err returns the error of the execution, if there was one.

func (*Result) ID

func (r *Result) ID() string

ID is a unique name that identifies the execution that run.

func (*Result) TerraformResult

func (r *Result) TerraformResult() terraform.Result

TerraformResult is the result of the Terraform command, or nil if there wasn't one.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is a directory containing log output, Terraform state files and plans.

type SessionRepo

type SessionRepo struct {
	// contains filtered or unexported fields
}

SessionRepo is a parent directory that contains inidividual project sessions.

func NewSessionRepo

func NewSessionRepo(project *Project, repoPath string, idGenFunc func() string) (*SessionRepo, error)

NewSessionRepo creates or opens a project session repo.

func (*SessionRepo) Current

func (r *SessionRepo) Current() (*Session, error)

Current returns the last session created, or creates one if it's the first time it's called.

func (*SessionRepo) NewSession

func (r *SessionRepo) NewSession() (*Session, error)

NewSession creates a new session in the repository.

type UserVariables

type UserVariables struct {
	// Values is the set of all values specified by the user via custom command line flags
	Values map[string]string
	// Filters is the subset of values that act as module filters, as described by the README
	Filters map[string]bool
}

UserVariables holds the values provided by the user via custom command line flags

func NoUserVariables

func NoUserVariables() *UserVariables

NoUserVariables returns an empty UserVariables value, used by tests

func (*UserVariables) FilterCount

func (uv *UserVariables) FilterCount() int

FilterCount returns the number of module filters

func (*UserVariables) HasFilter

func (uv *UserVariables) HasFilter(name string) bool

HasFilter is true when name is acting as a module filter

Directories

Path Synopsis
cli
astro/cmd
Package cmd contains the source for the `astro` command line tool that operators use to interact with the project.
Package cmd contains the source for the `astro` command line tool that operators use to interact with the project.
Package conf contains structs that are used to represent the configuration of a project.
Package conf contains structs that are used to represent the configuration of a project.
tvm
Package tvm stands for Terraform version manager.
Package tvm stands for Terraform version manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL