Skip to content

Trouble with AWS CLI for DRS

0

I'm trying to get output of a list of Server Names and SourceID for Elastic Disaster Recovery. When I run the following CLI

aws drs describe-source-servers --region us-west-2 --query "items[*].{Name:Tags[?Key=='Name']|[0].Value,sourceID:sourceServerID}" --output text

My output ends up looking like

None s-5c0f204f1e0e1a397

Any suggestions on how to get this to work?

asked 3 years ago137 views
1 Answer
0

It looks like there might be a misunderstanding in your AWS CLI command when querying for tags and source server IDs from AWS Disaster Recovery Service (DRS). Let's correct and refine your command to get the desired output.

The correct AWS CLI command to retrieve Server Names and Source IDs with tags should be structured like this:

aws drs describe-source-servers --region us-west-2 --query "items[*].{Name:Tags[?Key=='Name']|[0].Value, SourceID:SourceServerID}" --output table
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.