Class: CfFactory::CfEbEnvironment

Inherits:
Object
  • Object
show all
Includes:
CfEbSolutionStack, CfBase
Defined in:
lib/cf_factory/eb/cf_eb_environment.rb

Constant Summary

Constants included from CfEbSolutionStack

CfEbSolutionStack::SUPPORTED_STACK_NAMES

Instance Method Summary collapse

Methods included from CfEbSolutionStack

#is_valid_stack?

Methods included from CfBase

#generate, #generate_ref, #get_deletion_policy, #get_name, #get_update_policy, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags

Constructor Details

#initialize(name, application_name, cname_prefix, description, option_settings, options_to_remove, solution_stack_name, template_name, version_label) ⇒ CfEbEnvironment

Returns a new instance of CfEbEnvironment.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/cf_factory/eb/cf_eb_environment.rb', line 10

def initialize(name, application_name, cname_prefix, description, option_settings, options_to_remove, 
               solution_stack_name, template_name, version_label)
  @name = name
  @application_name = application_name
  @cname_prefix = cname_prefix
  @description = description
  @option_settings = option_settings
  @options_to_remove = options_to_remove
  @solution_stack_name = solution_stack_name
  @template_name = template_name
  @version_label = version_label

  validate

end

Instance Method Details

#get_cf_attributesObject



30
31
32
# File 'lib/cf_factory/eb/cf_eb_environment.rb', line 30

def get_cf_attributes
  super
end

#get_cf_propertiesObject



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/cf_factory/eb/cf_eb_environment.rb', line 34

def get_cf_properties
  result = {}
  result["ApplicationName"] = @application_name
  result["Description"] = @description
  result["TemplateName"] = @template_name
  result["VersionLabel"] = @version_label
  result["SolutionStackName"] = SUPPORTED_STACK_NAMES[@solution_stack_name] unless @solution_stack_name.nil?
  result["CNAMEPrefix"] = @cname_prefix unless @cname_prefix.nil?
  result["OptionSettings"] = @option_settings unless @option_settings.nil?
  result["OptionsToRemove"] = @options_to_remove unless @options_to_remove.nil?
  result
end

#get_cf_typeObject



26
27
28
# File 'lib/cf_factory/eb/cf_eb_environment.rb', line 26

def get_cf_type
  "AWS::ElasticBeanstalk::Environment"
end

#validateObject



47
48
49
50
51
# File 'lib/cf_factory/eb/cf_eb_environment.rb', line 47

def validate
  if not @solution_stack_name.nil?
    raise Exception.new("stack name not supported: #{@solution_stack_name}") unless is_valid_stack?(@solution_stack_name)
  end
end