Documentation ¶
Overview ¶
Package conf contains structs that are used to represent the configuration of a project.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct { // Module is the name of the module we're depending on. Module string // Variables is an optional map of specific parameters to narrow down the // dependency to a specific execution. If this is nil, and the module has // many different possible executions, we'll depend on all of them. Variables map[string]string }
Dependency is static config representing the dependency of a module
type Flag ¶
type Flag struct { // Name of the flag that is visible to the user, e.g. on the CLI. Name string // Description is an optional description to show to the user. Description string }
Flag is a user
type Hook ¶
type Hook struct { // Command is the shell command to be executed Command string // If set, hook output will be parsed for "KEY=VAL" pairs, which will // be set as environment variables SetEnv bool `json:"set_env"` }
Hook holds configuration for user commands that can be executed at various stages of the CLI lifecycle. Each hook is a shell-like string that will be executed. An error in a hook will cause an error in that execution and it will be aborted immediately. Hooks may optionally output key/value pairs in the form "KEY=VAL" and these will be parsed by Astro and set as environment variables.
type Hooks ¶
type Hooks struct { // Startup hooks are executed at CLI startup, after configuration has been // validated but before an operation like plan or apply is run. Startup []Hook // PreModuleRun sets the default for the prehook for a module execution. // See the docs on ModuleHooks below. PreModuleRun []Hook `json:"pre_module_run"` }
Hooks holds information for shared hooks
type Module ¶
type Module struct { // Deps is a list of Terraform modules that need to be run before this one // can run. Deps []Dependency // Hooks contains the module-specific hooks that can run. Hooks ModuleHooks // Name is a unique name for this Terraform module. Name string // Path is the path to the module, relative to the code root. Path string // Remote is the Terraform remote for this module. Remote Remote // TerraformCodeRoot is the base path to the Terraform code. Users cannot // set this; instead they should set it on the project configuration. TerraformCodeRoot string `json:"-"` // Terraform stores Terraform configuration that should be used when // running this module. Terraform Terraform // Variables is a list of Terraform variables and possible values that this // module accepts. Variables []Variable }
Module is the static configuration of a Terraform module.
type ModuleHooks ¶
type ModuleHooks struct { // PreModuleRun hooks are run before a module executes. PreModuleRun []Hook `json:"pre_module_run"` }
ModuleHooks contains configuration for user hooks that should run for a given module execution.
func (*ModuleHooks) ApplyDefaultsFrom ¶
func (conf *ModuleHooks) ApplyDefaultsFrom(defaultHooks Hooks)
ApplyDefaultsFrom copies the default values from the Hook configuration to a ModuleHooks configuration.
type Project ¶
type Project struct { // Flags is a mapping of module variable names to user flags, e.g. for on // the CLI. Flags map[string]Flag // Hooks contains configuration of hooks that can be invoked at various // stages of the CLI lifecycle. Hooks Hooks // Modules is a list of Terraform modules. Modules []Module // SessionRepoDir is the path to the directory where astro // will create the .astro session repo that stores log files and // plans during a session. Defaults to the same directory as the config // file. SessionRepoDir string `json:"session_repo_dir"` // TerraformCodeRoot is the path to the root of the Terraform code for this // Project. Defaults to the same directory as the config file. TerraformCodeRoot string `json:"terraform_code_root"` // Default Terraform configuration for this project. This // configuration is used when executing Terraform. Modules can // override this configuration with their own. TerraformDefaults Terraform `json:"terraform"` }
Project represents the structure of the YAML configuration for astro.
type Remote ¶
type Remote struct { // Backend is the backend type. Backend string // BackendConfig is a map of backend configuration parameters. BackendConfig map[string]string `json:"backend_config"` }
Remote is the static configuration of a remote for a Terraform module.
type Terraform ¶
type Terraform struct { // Path is the path to the Terraform binary. Astro will use this // if set, otherwise it will automatically download the version in // Version below. Path string // Terraform version to use. If Path is empty, Astro will // download this version automatically. Version *version.Version }
Terraform configuration that affect the running of Terraform itself.
func (*Terraform) ApplyDefaultsFrom ¶
ApplyDefaultsFrom takes a Terraform struct representation the default configuration and fills in any fields that were not set.
func (*Terraform) SetDefaultPath ¶
SetDefaultPath sets the path the Terraform binary from the environment, if it hasn't already been provided in configuration.
func (*Terraform) SetVersionFromBinary ¶
SetVersionFromBinary sets the value of the Version field from the binary.