Class: Jack::EbConfig::Create

Inherits:
Base
  • Object
show all
Defined in:
lib/jack/eb_config/create.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#ensure_eb_init, #sync, #write_eb_config_yml

Methods included from Util

#app_name_convention, #aws_bin, #check_aws_setup, #confirm, #eb, #eb_base_flags, #eb_bin, #ensure_folder_exist, #get_answer, #get_region, #prerequisites, #settings, #sh

Constructor Details

#initialize(options = {}) ⇒ Create

Returns a new instance of Create.



5
6
7
8
# File 'lib/jack/eb_config/create.rb', line 5

def initialize(options={})
  super
  @app_name = options[:app] || app_name_convention(@env_name)
end

Instance Attribute Details

#eb_config_pathObject (readonly)

Returns the value of attribute eb_config_path.



4
5
6
# File 'lib/jack/eb_config/create.rb', line 4

def eb_config_path
  @eb_config_path
end

Instance Method Details

#app_nameObject



17
18
19
# File 'lib/jack/eb_config/create.rb', line 17

def app_name
  @app_name
end

#latest_docker_platformObject



21
22
23
24
25
26
# File 'lib/jack/eb_config/create.rb', line 21

def latest_docker_platform
  solution_stacks.grep(/Docker/).
                  reject {|x| x =~ /Preconfigured/}.
                  reject {|x| x =~ /Multi-container/}.
                  sort.last
end

#platformObject



10
11
12
13
14
15
# File 'lib/jack/eb_config/create.rb', line 10

def platform
  # TODO: change so that the gem default settins has nil for platform
  # but need to provide a deprecation warning first.
  # Right now it will never hit the lastest_docker_platform logic
  settings.create['platform'] || latest_docker_platform
end

#solution_stacksObject



28
29
30
# File 'lib/jack/eb_config/create.rb', line 28

def solution_stacks
  eb.list_available_solution_stacks.solution_stacks
end