Sha256: fc72ff256d479e668a5c514df3fbc89f7cd7c3ebf5f70f75d9021b3581a60b4b

Contents?: true

Size: 674 Bytes

Versions: 6

Compression:

Stored size: 674 Bytes

Contents

module Ufo::Cfn::Stack::Builder::Resources::Scaling
  class Target < Base
    def build
      return unless autoscaling_enabled?

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ufo-6.0.5 lib/ufo/cfn/stack/builder/resources/scaling/target.rb
ufo-6.0.4 lib/ufo/cfn/stack/builder/resources/scaling/target.rb
ufo-6.0.3 lib/ufo/cfn/stack/builder/resources/scaling/target.rb
ufo-6.0.2 lib/ufo/cfn/stack/builder/resources/scaling/target.rb
ufo-6.0.1 lib/ufo/cfn/stack/builder/resources/scaling/target.rb
ufo-6.0.0 lib/ufo/cfn/stack/builder/resources/scaling/target.rb