Class: EcsDeploy::AutoScaler::SimpleScalingConfig

Inherits:
Struct
  • Object
show all
Includes:
ConfigBase
Defined in:
lib/ecs_deploy/auto_scaler/simple_scaling_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConfigBase

#logger

Constructor Details

#initialize(attributes = {}, logger) ⇒ SimpleScalingConfig

Returns a new instance of SimpleScalingConfig.



9
10
11
12
13
14
15
16
# File 'lib/ecs_deploy/auto_scaler/simple_scaling_config.rb', line 9

def initialize(attributes = {}, logger)
  attributes = attributes.dup
  services = attributes.delete("services")
  super(attributes, logger)
  self.service_configs = services.map do |s|
    ServiceConfig.new(s.merge("cluster" => cluster, "region" => region), logger)
  end
end

Instance Attribute Details

#clusterObject

Returns the value of attribute cluster

Returns:

  • (Object)

    the current value of cluster



6
7
8
# File 'lib/ecs_deploy/auto_scaler/simple_scaling_config.rb', line 6

def cluster
  @cluster
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/ecs_deploy/auto_scaler/simple_scaling_config.rb', line 6

def name
  @name
end

#regionObject

Returns the value of attribute region

Returns:

  • (Object)

    the current value of region



6
7
8
# File 'lib/ecs_deploy/auto_scaler/simple_scaling_config.rb', line 6

def region
  @region
end

#service_configsObject

Returns the value of attribute service_configs

Returns:

  • (Object)

    the current value of service_configs



6
7
8
# File 'lib/ecs_deploy/auto_scaler/simple_scaling_config.rb', line 6

def service_configs
  @service_configs
end

Instance Method Details

#cluster_resource_managerObject



22
23
24
# File 'lib/ecs_deploy/auto_scaler/simple_scaling_config.rb', line 22

def cluster_resource_manager
  @cluster_resource_manager ||= NullClusterResourceManager.new
end

#update_desired_capacity(required_capacity) ⇒ Object



18
19
20
# File 'lib/ecs_deploy/auto_scaler/simple_scaling_config.rb', line 18

def update_desired_capacity(required_capacity)
  @logger.debug "#{log_prefix} Skipping infrastructure scaling (managed by capacity provider)"
end