Created
January 21, 2011 10:02
-
-
Save frodera/789496 to your computer and use it in GitHub Desktop.
create_tags error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I, [2011-01-21T10:55:16.783488 #11240] INFO -- : New RightAws::Ec2 using shared connections mode | |
I, [2011-01-21T10:55:16.784474 #11240] INFO -- : Opening new HTTPS connection to eu-west-1.ec2.amazonaws.com:443 | |
-> i-d09985a7 ec2-46-137-17-195.eu-west-1.compute.amazonaws.com | |
W, [2011-01-21T10:55:19.213078 #11240] WARN -- : ##### RightAws::Ec2 returned an error: 400 Bad Request | |
<?xml version="1.0" encoding="UTF-8"?> | |
<Response><Errors><Error><Code>InvalidParameterCombination</Code><Message>The parameter 'Value' may only be specified once.</Message></Error></Errors><RequestID>d6d4fddb-279b-48b3-beb3-4c3a574b60b7</RequestID></Response> ##### | |
W, [2011-01-21T10:55:19.213232 #11240] WARN -- : ##### RightAws::Ec2 request: https://eu-west-1.ec2.amazonaws.com:443/?AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXXX&Action=CreateTags&ResourceId.1=i-12345678&SignatureMethod=HmacSHA256&SignatureVersion=2&Tag.1.Key.1=myKey1&Tag.1.Key.2=myValue1&Tag.1.Value.1=myKey2&Tag.1.Value.2=myValue2&Timestamp=2011-01-21T09%3A55%3A17.000Z&Version=2010-08-31&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXX #### | |
/usr/local/Cellar/ruby/1.9.2-p136/lib/ruby/gems/1.9.1/gems/right_aws-2.1.0/lib/awsbase/right_awsbase.rb:545:in `request_info_impl': InvalidParameterCombination: The parameter 'Value' may only be specified once. (RightAws::AwsError) | |
from /usr/local/Cellar/ruby/1.9.2-p136/lib/ruby/gems/1.9.1/gems/right_aws-2.1.0/lib/ec2/right_ec2.rb:140:in `request_info' | |
from /usr/local/Cellar/ruby/1.9.2-p136/lib/ruby/gems/1.9.1/gems/right_aws-2.1.0/lib/ec2/right_ec2_tags.rb:79:in `create_tags' | |
from test_right_aws.rb:13:in `block in <main>' | |
from test_right_aws.rb:11:in `each' | |
from test_right_aws.rb:11:in `<main>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'right_aws' | |
key = "XXXXXXXXXXXXXXXXX" | |
secret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
endpoint = "https://eu-west-1.ec2.amazonaws.com/" | |
ec2 = RightAws::Ec2.new(key, secret, :endpoint_url => endpoint ) | |
ec2.describe_instances.each do |instance| | |
puts "-> #{instance[:aws_instance_id]} #{instance[:dns_name]}" | |
ec2.create_tags(instance[:aws_instance_id], [{"myKey1" => "myValue1", "myKey2" => "myValue2"}]) | |
ec2.describe_tags(:filters => { 'resource-id' => instance[:aws_instance_id]}).each do |tag| | |
puts "#{tag[:key]} -- #{tag[:value]}" | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment