Class: Ufo::Cfn::Stack::Builder::Resources::Scaling::Target

Inherits:
Base show all
Defined in:
lib/ufo/cfn/stack/builder/resources/scaling/target.rb

Instance Attribute Summary

Attributes inherited from Base

#vars

Attributes inherited from Ufo::CLI::Base

#task_definition

Instance Method Summary collapse

Methods included from Ufo::Concerns::Autoscaling

#autoscaling, #autoscaling_enabled?

Methods inherited from Base

build, #initialize, #managed_security_group, #managed_security_groups?, #security_groups

Methods included from Ufo::Concerns

#deploy, #info, #ps

Methods included from Ufo::Concerns::Names

#names

Methods included from AwsServices

#acm, #applicationautoscaling, #aws_options, #cloudformation, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb, #find_stack, #ssm_client, #stack_resources, #status, #task_definition_arns

Methods inherited from Ufo::CLI::Base

#initialize

Methods included from Utils::Sure

#sure?

Methods included from Utils::Pretty

#pretty_home, #pretty_path, #pretty_time

Methods included from Utils::Logging

#logger

Constructor Details

This class inherits a constructor from Ufo::Cfn::Stack::Builder::Base

Instance Method Details

#buildObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ufo/cfn/stack/builder/resources/scaling/target.rb', line 3

def build
  return unless autoscaling_enabled?

  text ="    Type: AWS::ApplicationAutoScaling::ScalableTarget\n    DependsOn: EcsService\n    Properties:\n      RoleARN: !GetAtt ScalingRole.Arn\n      ResourceId: !Join\n        - \"/\"\n        - [service, \#{@cluster}, !GetAtt [EcsService, Name]]\n      ServiceNamespace: ecs\n      ScalableDimension: ecs:service:DesiredCount\n      MinCapacity: \#{min_capacity}\n      MaxCapacity: \#{max_capacity}\n  EOL\n  Ufo::Yaml.load(text).deep_symbolize_keys\nend\n"