How to get dns name from the spefific tags filter in version3? #2600
Unanswered
madhusudhan1234
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I don't know much about V1, but I think the service clients are similar to the Resource models that V2/V3 use. I wouldn't recommend using those anymore. I think what you should be doing is using describe_instances with your filters. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @mullermp, Thanks for the reply. As per your suggestion I implemented in this way. ec2 = Aws::EC2::Client.new(region: 'us-west-2', credentials: Aws::Credentials.new(config['aws_access_key_id'], config['aws_secret_access_key']))
instances = ec2.describe_instances(filters: [
{ name: 'tag:name1', values:['value1']},
{ name: 'tag:name2', values:['value1', 'value2']},
{ name: 'tag:name3', values:['value3']}
]) And got the following result in {:reservations=>[]} Did I miss anything in the implementation? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Community,
While doing some Ruby and RoR upgrade work I had to upgrade the aws-sdk gem. Previous implementation to get the certain dns name for the deployment in version 1 is:
Now I tried different approaches to get the same result of dns name in version 3. I am still not able to do, Can you please help on on this?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions