我正在尝试将S3中的大型csv文件(100GB)下载到EC2实例上的已安装驱动器中.
我已经下载了AWS-CLI并使用了命令:aws s3 cp s3://bucket/file.csv . --region=us-east-1它似乎工作得很好并且下载了大约70GB的数据然后突然它似乎停止并且存在而没有任何消息或错误,删除它创建的文件的一部分.
Completed 642 of 916 part(s) with 1 file(s) remaining
Run Code Online (Sandbox Code Playgroud)
然后它就停止了.
为什么会这样,我怎么能绕过它呢?我尝试过使用s3cmd get它但是时间太长而且非常缓慢到几乎停止下载任何东西的程度.
有任何想法吗?网络问题?磁盘问题?API问题?
谢谢
如何在AWS查询中使用变量?
似乎没有关于查询语法的文档,仅是示例。
我正在尝试执行以下操作:
API_ID=$(aws apigateway get-rest-apis --query 'items[?name == `${API_NAME}`] | [0].{id: id}' --output text)
Run Code Online (Sandbox Code Playgroud)
问题在于$ {API_NAME}是按字面读取的。有任何想法吗?
AWS报告其所有服务都正常运行,但我通过AWS CLI在所有S3请求上收到错误104"通过对等方重置连接".昨天它工作正常.你有什么建议来解决这个问题吗?
$ aws --version
aws-cli/1.11.32 Python/2.6.6 Linux/2.6.32-642.11.1.el6.x86_64 botocore/1.4.89
$ aws s3 ls s3://
('Connection aborted.', error(104, 'Connection reset by peer'))
$ aws s3api list-buckets
('Connection aborted.', error(104, 'Connection reset by peer'))
Run Code Online (Sandbox Code Playgroud)
这是带有调试信息的list-buckets命令:
$ aws s3api list-buckets --debug
2016-12-21 09:25:11,926 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.11.32 Python/2.6.6 Linux/2.6.32-642.11.1.el6.x86_64 botocore/1.4.89
2016-12-21 09:25:11,927 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['s3api', 'list-buckets', '--debug']
2016-12-21 09:25:11,927 - MainThread - botocore.hooks - DEBUG - Event session-initialized: …Run Code Online (Sandbox Code Playgroud) 如何列出文件,但我只想列出所有标准类。
我想排除冰川类。
当前这是我的命令:
aws s3 ls s3://Videos/Action/ --human-readable --summarize
Run Code Online (Sandbox Code Playgroud) 好吧,我对aws cli非常困惑
我有一个S3桶:
s3://my-bucket
directory/
file1
file2
backup-logs-1234
backup-logs-5678
Run Code Online (Sandbox Code Playgroud)
我已经验证了文件在s3桶中,我可以看到它们 aws s3 ls s3://my-bucket
我正在尝试删除文件夹中的所有备份日志(其中8000个).我已经尝试了我能想到的包含/排除的每种组合
1)由于某种原因aws s3 rm "s3://my-bucket/" --include "*backup-logs*" --dryrun试图删除s3://my-bucket/directory/
2)aws s3 rm "s3://my-bucket/" --exclude "*" --include "*backup-logs*" --dryrun没有看到任何要删除的文件
3)我也尝试了"备份"的不同子串(例如b,ba,back)
4)我也尝试添加递归(即使我不希望它),它发现所有文件directory/都符合模式,但没有一个顶层的文件
我确定我做的事情很愚蠢.在此先感谢您的帮助
尽管似乎有几种方法可以将一些AWSCLI命令输出并过滤到此列表中,但是有人可以通过一种简便的方法来列出特定区域的所有EC2实例类型吗?
还是该列表以.json文件的形式发布在AWS维护的某个存储桶中?
我只是在寻找这种输出:
t1.micro
t2.nano
t2.micro
t2.small
...
Run Code Online (Sandbox Code Playgroud) 当我们使用过滤器运行命令时,出现错误:
$ aws rds describe-db-instances --filters Name=instance-state-name,Values=running
An error occurred (InvalidParameterValue) when calling the
DescribeDBInstances operation: Unrecognized filter name: instance-state-name.
Run Code Online (Sandbox Code Playgroud)
使用过滤器的正确语法是什么aws rds describe-db-instances?
我最近使用升级到了Python 3 brew。我的awscli已停止工作,因为它正在尝试使用旧版本的Python。我想尝试重新安装它,但目前无法将其卸载。
? ~ python --version
Python 3.6.4
? ~ aws confgure
zsh: /usr/local/bin/aws: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directory
? ~ pip uninstall awscli
Cannot uninstall requirement awscli, not installed
? ~ pip3 uninstall awscli
Cannot uninstall requirement awscli, not installed
? ~ brew uninstall awscli
Error: No such keg: /usr/local/Cellar/awscli
? ~ aws configure
zsh: /usr/local/bin/aws: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directory
? ~ which aws
/usr/local/bin/aws
Run Code Online (Sandbox Code Playgroud)
我还能尝试卸载awscli吗?
我正在使用AWS CLI将证书导入区域us-east-1,如下所示:
aws acm import-certificate --certificate cert.crt --private-key private.key --certificate-chain chain.crt --profile prof --region us-east-1
Run Code Online (Sandbox Code Playgroud)
这在过去曾用于其他证书,但我最近开始看到以下错误:
An error occurred (ValidationException) when calling the ImportCertificate operation: The private key is not supported.
Run Code Online (Sandbox Code Playgroud)
我已经检查过私钥确实通过openssl与证书匹配,所以我很遗憾这里可能存在什么问题.
openssl rsa -in private.key -check
Run Code Online (Sandbox Code Playgroud)
产量
RSA key ok
Run Code Online (Sandbox Code Playgroud)
可能是什么问题?
我有以下命令:
aws ec2 describe-regions --output=json
Run Code Online (Sandbox Code Playgroud)
输出如下:
{
"Regions": [
{
"Endpoint": "ec2.eu-north-1.amazonaws.com",
"RegionName": "eu-north-1"
},
{
"Endpoint": "ec2.ap-northeast-2.amazonaws.com",
"RegionName": "ap-northeast-2"
},
{
"Endpoint": "ec2.us-west-2.amazonaws.com",
"RegionName": "us-west-2"
}
]
}
Run Code Online (Sandbox Code Playgroud)
但是,这在机器上并不是真正可用的,我正在寻找单行输出,如下所示:
{"Regions":[{"Endpoint":"ec2.eu-north-1.amazonaws.com","RegionName":"eu-north-1"},{"Endpoint":"ec2.ap-northeast-2.amazonaws.com","RegionName":"ap-northeast-2"},{"Endpoint":"ec2.us-west-2.amazonaws.com","RegionName":"us-west-2"}]}
Run Code Online (Sandbox Code Playgroud)
aws-cli中有一些命令可以让我使用机器可读的JSON吗?就像是:
aws ec2 describe-regions --output='json-for-machines'
Run Code Online (Sandbox Code Playgroud)
?
aws-cli ×10
amazon-s3 ×4
amazon-ec2 ×2
amazon-rds ×1
bash ×1
homebrew ×1
json ×1
node.js ×1
pip ×1