Your syntax seems to be fine, but instance-state-name
is simply not a valid filter for RDS.
From the documentation:
--filters (list)
A filter that specifies one or more DB instances to describe.
Supported filters:
db-cluster-id - Accepts DB cluster identifiers and DB cluster Ama-
zon Resource Names (ARNs). The results list will only include
information about the DB instances associated with the DB Clusters
identified by these ARNs.
db-instance-id - Accepts DB instance identifiers and DB instance
Amazon Resource Names (ARNs). The results list will only include
information about the DB instances identified by these ARNs.
As something like instance-state-name
doesn't exist for RDS I assume what you're searching for instead is DBInstanceStatus
. While it's not possible to use --filter
to filter for that, you can use --query
:
aws rds describe-db-instances --query 'DBInstances[?DBInstanceStatus==`available`]'
The difference between --filter
and --query
is that --filter
directly influences what's sent back by the API, while --query
does some local filtering of the results received from the API. As long as you don't have a very large amount of RDS instances, --query
should work fine for you.
xyz
]" --query "DBInstances[*].[DBInstanceArn,Engine,DBInstanceIdentifier,EngineVersion,Address]" – Gillett