我正在尝试使用AWS的最新功能之一,它允许您停止RDS实例。
我跟着this doc说明我需要运行命令:
aws rds stop-db-instance --db-instance-identifier mydbinstance
但是,当我这样做时,我得到了这个:
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
add-role-to-db-cluster | add-source-identifier-to-subscription
add-tags-to-resource | apply-pending-maintenance-action
并继续列出其他RDS命令但不包括stop-db-instance
。
我更新了我的CLI和我当前的版本:aws-cli/1.11.11 Python/2.7.9 Windows/8 botocore/1.4.68
我错过了什么?
更新
我尝试再次升级aws cli但我回来的是所有内容都是最新的:
C:\Users\n.ihab>aws --version
aws-cli/1.11.11 Python/2.7.9 Windows/8 botocore/1.4.68
C:\Users\n.ihab>pip install awscli --upgrade
Requirement already up-to-date: awscli in c:\python34\lib\site-packages
Requirement already up-to-date: rsa<=3.5.0,>=3.1.2 in c:\python34\lib\site-packages (from awscli)
Requirement already up-to-date: colorama<=0.3.7,>=0.2.5 in c:\users\n.ihab\appdata\roaming\python\python34\site-packages (from awscli)
Requirement already up-to-date: docutils>=0.10 in c:\users\n.ihab\appdata\roaming\python\python34\site-packages (from awscli)
Requirement already up-to-date: botocore==1.5.72 in c:\python34\lib\site-packages (from awscli)
Requirement already up-to-date: PyYAML<=3.12,>=3.10 in c:\users\n.ihab\appdata\roaming\python\python34\site-packages (from awscli)
Requirement already up-to-date: s3transfer<0.2.0,>=0.1.9 in c:\python34\lib\site-packages (from awscli)
Requirement already up-to-date: pyasn1>=0.1.3 in c:\python34\lib\site-packages (from rsa<=3.5.0,>=3.1.2->awscli)
Requirement already up-to-date: python-dateutil<3.0.0,>=2.1 in c:\users\n.ihab\appdata\roaming\python\python34\site-packages (from botocore==1.5.72->awscli)
Requirement already up-to-date: jmespath<1.0.0,>=0.7.1 in c:\users\n.ihab\appdata\roaming\python\python34\site-packages (from botocore==1.5.72->awscli)
Requirement already up-to-date: six>=1.5 in c:\users\n.ihab\appdata\roaming\python\python34\site-packages (from python-dateutil<3.0.0,>=2.1->botocore==1.5.72->awscli)
C:\Users\n.ihab>aws --version
aws-cli/1.11.11 Python/2.7.9 Windows/8 botocore/1.4.68
在此步骤之前是否需要升级其他内容?
答案 0 :(得分:6)
这是一项新功能,自CLI版1.11.95
起可用。最新版本为1.11.109
。更新到最新的AWS CLI版本,您可以使用stop-db-instance
升级前
$ aws --version
aws-cli/1.11.83 Python/2.7.10 Linux/4.1.17-22.30.amzn1.x86_64 botocore/1.5.46
$ aws rds stop-db-instance
aws: error: argument operation: Invalid choice, valid choices are:
升级CLI并重启(Linux)
$ sudo pip install awscli --upgrade
升级后
$ aws --version
aws-cli/1.11.109 Python/2.6.9 Linux/4.1.17-22.30.amzn1.x86_64 botocore/1.5.72
$ aws rds stop-db-instance
aws: error: argument --db-instance-identifier is required