Class: Terradactyl::ConfigStack
- Inherits:
-
ConfigApplication
- Object
- ConfigApplication
- Terradactyl::ConfigStack
- Defined in:
- lib/terradactyl/config.rb
Constant Summary collapse
- TERRAFORM_SETTINGS_FILES =
%w[ settings.tf versions.tf backend.tf ].freeze
Constants inherited from ConfigApplication
Terradactyl::ConfigApplication::CONFIG_DEFAULTS
Instance Attribute Summary collapse
-
#base_folder ⇒ Object
readonly
Returns the value of attribute base_folder.
-
#stack_name ⇒ Object
(also: #name)
readonly
Returns the value of attribute stack_name.
-
#stack_path ⇒ Object
(also: #path)
readonly
Returns the value of attribute stack_path.
Attributes inherited from ConfigApplication
Instance Method Summary collapse
-
#initialize(stack_name, base_override = nil) ⇒ ConfigStack
constructor
A new instance of ConfigStack.
- #plan_file ⇒ Object
- #plan_path ⇒ Object
- #state_file ⇒ Object
- #state_path ⇒ Object
- #versions_file ⇒ Object
Methods inherited from ConfigApplication
Constructor Details
#initialize(stack_name, base_override = nil) ⇒ ConfigStack
Returns a new instance of ConfigStack.
162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/terradactyl/config.rb', line 162 def initialize(stack_name, base_override = nil) @stack_name = stack_name @project_config = ConfigProject.instance @base_folder = base_override || @project_config.base_folder @stack_path = "#{@base_folder}/#{@stack_name}" @config_file = "#{@stack_path}/#{ConfigProject::CONFIG_PROJECT_FILE}" @defaults = load_defaults(@project_config.to_h) @overlay = (@config_file) load_config end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Terradactyl::ConfigApplication
Instance Attribute Details
#base_folder ⇒ Object (readonly)
Returns the value of attribute base_folder.
160 161 162 |
# File 'lib/terradactyl/config.rb', line 160 def base_folder @base_folder end |
#stack_name ⇒ Object (readonly) Also known as: name
Returns the value of attribute stack_name.
160 161 162 |
# File 'lib/terradactyl/config.rb', line 160 def stack_name @stack_name end |
#stack_path ⇒ Object (readonly) Also known as: path
Returns the value of attribute stack_path.
160 161 162 |
# File 'lib/terradactyl/config.rb', line 160 def stack_path @stack_path end |
Instance Method Details
#plan_file ⇒ Object
185 186 187 |
# File 'lib/terradactyl/config.rb', line 185 def plan_file "#{stack_name}.tfout" end |
#plan_path ⇒ Object
189 190 191 |
# File 'lib/terradactyl/config.rb', line 189 def plan_path "#{stack_path}/#{plan_file}" end |
#state_file ⇒ Object
177 178 179 |
# File 'lib/terradactyl/config.rb', line 177 def state_file 'terraform.tfstate' end |
#state_path ⇒ Object
181 182 183 |
# File 'lib/terradactyl/config.rb', line 181 def state_path "#{stack_path}/terraform.tfstate" end |
#versions_file ⇒ Object
193 194 195 |
# File 'lib/terradactyl/config.rb', line 193 def versions_file "#{stack_path}/versions.tf" end |