class Convection::Model::Template::Resource::AutoScalingGroup

AWS::AutoScaling::AutoScalingGroup

Public Instance Methods

render(*args) click to toggle source
# File lib/convection/model/template/resource/aws_auto_scaling_auto_scaling_group.rb, line 29
def render(*args)
  super.tap do |resource|
    render_tags(resource)
  end
end
tag(key, value, propagate_at_launch: nil) click to toggle source
# File lib/convection/model/template/resource/aws_auto_scaling_auto_scaling_group.rb, line 35
def tag(key, value, propagate_at_launch: nil)
  tags[key] = { value: value }
  tags[key][:propagate_at_launch] = propagate_at_launch unless propagate_at_launch.nil?

  tags[key]
end
tags() click to toggle source
# File lib/convection/model/template/resource/aws_auto_scaling_auto_scaling_group.rb, line 42
def tags
  @tags ||= {}
end
target_group_arn(arn) click to toggle source
# File lib/convection/model/template/resource/aws_auto_scaling_auto_scaling_group.rb, line 46
def target_group_arn(arn)
  target_group_arns << arn
end
update_policy(&block) click to toggle source
# File lib/convection/model/template/resource/aws_auto_scaling_auto_scaling_group.rb, line 50
def update_policy(&block)
  policy = ResourceAttribute::UpdatePolicy.new(self)
  policy.instance_exec(&block) if block
end

Private Instance Methods

render_tags(resource) click to toggle source
# File lib/convection/model/template/resource/aws_auto_scaling_auto_scaling_group.rb, line 57
def render_tags(resource)
  rendered_tags = tags.map do |key, tag|
    rendered = { 'Key' => key, 'Value' => tag[:value] }
    rendered['PropagateAtLaunch'] = tag[:propagate_at_launch] if tag.key?(:propagate_at_launch)

    rendered
  end

  resource['Properties']['Tags'] = rendered_tags unless rendered_tags.empty?
end