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:
parent
9daba4e365
commit
5a3ca244c0
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Reference in a new issue