diff --git a/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb b/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb index 9c0e2f832..27218e8ee 100644 --- a/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +++ b/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb @@ -74,11 +74,9 @@ module Fog end if tags = options.delete('Tags') - i=0 - tags.each do |key, value| - i += 1 - options["Tags.member.#{i}.Key"] = key.to_s # turns symbol into string - options["Tags.member.#{i}.Value"] = value + tags.each_with_index do |(key, value), i| + options["Tags.member.#{i+1}.Key"] = key.to_s # turns symbol into string + options["Tags.member.#{i+1}.Value"] = value end end if termination_policies = options.delete('TerminationPolicies')