我想使用脚本动态地将 EBS 卷挂载和卸载到正在运行的 AWS 实例,并且想知道这是否可以在 linux 和 windows 实例上实现,如果可以,这种操作的预期持续时间是多长。
我想获取附加到 ELB 的所有实例的列表(需要在进一步处理中使用它们)。
这是我到目前为止所做的:
aws elb describe-load-balancers --load-balancer-name 'my-elb' --output json --query "LoadBalancerDescriptions[*].Instances[*].InstanceId"
Run Code Online (Sandbox Code Playgroud)
但是,上面的命令给了我 JSON 格式的列表。
[
[
"i-05676776d8cd4ab5344b0d",
"i-05676776"
]
]
Run Code Online (Sandbox Code Playgroud)
我能怎么做?
谢谢!
I would like to know how to list the files in amazon s3 bucket by recursive way and filter .mov files.
Sample output:
sample:
filename1.mov1 120mb<br>
filename2.mov2 300mb
Total Object : 2
Total Size: 420mb
Run Code Online (Sandbox Code Playgroud)
my current command below:
aws s3 ls --summarize --human-readable --recursive s3://mybucket/Videos
Run Code Online (Sandbox Code Playgroud)
Thanks
是否有任何官方方法或“正确方法”将返回的平台之一转换为eb platform list列出的 eb 解决方案堆栈的最新版本aws elasticbeanstalk list-available-solution-stacks --query 'SolutionStacks'
我想列出具有特定标签 (Name=MyVPC) 的 VPC id。
我知道我可以使用--filter并运行:
aws ec2 describe-vpcs --filters Name=tag:Name,Values=MyVPC --query 'Vpcs[].VpcId'
Run Code Online (Sandbox Code Playgroud)
这完全正常。
有没有一种方法可以在不使用--filter且仅使用 JMESPath 的情况下实现这一目标?
我运行它以获取我的 CF 堆栈列表:
aws cloudformation list-stacks --region us-east-1
Run Code Online (Sandbox Code Playgroud)
对于相同的堆栈,我似乎得到了多个结果。我似乎返回每个堆栈的每个版本?我如何只为每个堆栈获得一个结果?
此 AWS 页面建议进行以下调用:
$ aws iam update-role -–role-name ADFS-Production -–max-session-duration 14400
Run Code Online (Sandbox Code Playgroud)
当我运行这个(替换正确的角色名称)时,我得到
aws: error: the following arguments are required: --role-name
Run Code Online (Sandbox Code Playgroud)
这很令人困惑,因为论点就在那里!
$ aws --version
Run Code Online (Sandbox Code Playgroud)
在我的机器上给出
aws-cli/1.14.69 Python/3.6.4 Darwin/16.3.0 botocore/1.9.22
Run Code Online (Sandbox Code Playgroud)
我尝试使用调试器单步执行 arg 解析,看起来问题可能在于 option_string_actions 列表没有正确填充:
/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/argparse.py(2093)_parse_optional()
-> if arg_string in self._option_string_actions:
(Pdb) l
2088 # if it doesn't start with a prefix, it was meant to be positional
2089 if not arg_string[0] in self.prefix_chars:
2090 return None
2091
2092 # if the option string is present in the parser, return …Run Code Online (Sandbox Code Playgroud) 如何删除失败的 VPC 对等连接创建?
在创建 VPC 对等连接时,我提供了无效的 VPC id,并且对等连接创建失败。后来我更正了 VPC id 并可以创建对等连接。现在我正在尝试删除失败的对等连接,但该选项在 AWS 仪表板中显示为灰色。
CLI 不允许我删除它。如何删除失败的 VPC 对等连接?
$ aws ec2 delete-vpc-peering-connection --vpc-peering-connection-id pcx-xxxxxxxx
An error occurred (InvalidStateTransition) when calling the DeleteVpcPeeringConnection operation: Invalid state transition for pcx-xxxxxxxx, attempted to transition from failed to deleting
Run Code Online (Sandbox Code Playgroud) 使用 AWS CLI,如何输出 S3 对象的最新 VersionId 字符串?
刚刚安装了 awscli,但我的配置有问题。
当我这样做时aws configure:
AWS Access Key ID [None]: "ACCESS KEY HERE"
AWS Secret Access Key [None]: "SECRET KEY HERE"
Default region name [None]: us-east-1
Default output format [None]:
[Errno 13] Permission denied: '/home/ugurkaya/.aws/credentials'
Run Code Online (Sandbox Code Playgroud)
我也尝试过,chmod +x /home/ugurkaya/.aws/credentials但没有帮助。任何想法为什么我有这个问题?
编辑:ls -l ~/.aws/credentials输出:
-rwx--x--x 1 root root 116 jul 13 18:12 /home/ugurkaya/.aws/credentials