0
0

AWS CLIを使ってEC2やRDSのインスタンスサイズ一覧などを取得する

Last updated at Posted at 2022-04-25

EC2の情報

$ aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,InstanceType,PublicIpAddress,Tags[?Key==`Name`]| [0].Value]' --output table

---------------------------------------------------------------------------------
|                               DescribeInstances                               |
+----------------------+-----------+-----------------+--------------------------+
|  i-xxxxxxx          |  t2.micro |  None           |  xxxx.l2tp.org redmine  |
|  i-xxxxxx |  c5.large |  192.0.2.203 |  isu12q-3                |
|  i-xxxxxx |  c5.large |  192.0.2.50   |  isu12q-2                |
|  i-xxxxxx |  c5.large |  192.0.2.59  |  isu12q-bench            |
|  i-xxxxxx |  c5.large |  192.0.2.169   |  isu12q-1                |
+----------------------+-----------+-----------------+--------------------------+

RDSのインスタンスサイズ一覧を取得する

$  aws rds   describe-db-instances | jq -r '.DBInstances[] | (.DBInstanceClass|tostring) + ":\t" + .DBInstanceIdentifier'


db.m5.4xlarge:	develop-rds-mysql
db.t3.small:	develop-aurora-instance-1
db.t3.small:	develop-aurora-instance-1-ap-northeast-1a
db.m5.64xlarge:	production-rds-postgresql
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0