1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add tags to autoscaling groups

This commit is contained in:
Trotter Cashion 2012-06-18 13:32:14 -07:00
parent 9daba4e365
commit 5a3ca244c0
2 changed files with 7 additions and 1 deletions

View file

@ -21,6 +21,7 @@ module Fog
attribute :placement_group, :aliases => 'PlacementGroup'
attribute :suspended_processes, :aliases => 'SuspendedProcesses'
attribute :vpc_zone_identifier, :aliases => 'VPCZoneIdentifier'
attribute :tags, :aliases => 'Tags'
def initialize(attributes={})
attributes['DefaultCooldown'] ||= 0
@ -33,6 +34,7 @@ module Fog
attributes['MaxSize'] ||= 0
attributes['MinSize'] ||= 0
attributes['SuspendedProcesses'] ||= []
attributes['Tags'] ||= []
super
end

View file

@ -54,7 +54,11 @@ module Fog
options.merge!(AWS.indexed_param('LoadBalancerNames.member.%d', [*load_balancer_names]))
end
if tags = options.delete('Tags')
options.merge!(AWS.indexed_param('Tags.member.%d', [*tags]))
tags.each_with_index do |tag, i|
tag.each do |key, value|
options["Tags.member.#{i + 1}.#{key.to_s.capitalize}"] = value
end
end
end
request({
'Action' => 'CreateAutoScalingGroup',