运行
aws ecs update-service --cluster cluster-name --service service-name --force-new-deployment --region ap-southeast-2打开:
{
"service": {
"serviceArn": "arn:aws:ecs:ap-southeast-2:000000000000:service/service-name",
"serviceName": "service-name",
"clusterArn": "arn:aws:ecs:ap-southeast-2:000000000000:cluster/clustername",
"loadBalancers": [
{
"targetGroupArn": "arn:aws:elasticloadbalancing:ap-southeast-2:000000000000:targetgroup/targetgroupname",
"containerName": "containername",
"containerPort": 5000
}
],
"serviceRegistries": [],
"status": "ACTIVE",
"desiredCount": 1,
"runningCount": 1,
"pendingCount": 1,
"launchType": "FARGATE",
"platformVersion": "LATEST",
"taskDefinition": "arn:aws:ecs:ap-southeast-2:000000000000:task-definition/service-name:43",
:
Run Code Online (Sandbox Code Playgroud)
并阻止我的外壳直到我按下q。这曾经工作得很好。我想我更新了我的 AWSCLI,导致了这个问题。为什么会发生这种情况?如何避免在 CI 脚本中更新我的服务?
我发现 AWS Cost Explorer 控制台和 AWS CLI Cost Explorer 给出了两个不同的数字。有什么原因导致这种情况发生吗?
例如:从我的控制台,您可以看到我的 Cloudtrail 总额为 72.66 美元
然而,当我将这些相同的精确指标用于 CLI 时,我的总计为 72.04 美元
我知道这看起来没什么大区别,我只是以 Cloudtrail 为例,但我的一些价格较高的服务有更大的差异。出现这种情况是否有原因/是否可以采取措施使控制台和 CLI 具有匹配的每月成本?
我在任何地方都找不到那个。如果我使用类似 的命令aws s3 mv s3://bucket/ <local_pc>,那么它后面的 HTTP 请求是什么类型?是获取还是复制?
我是 Amazon SageMaker 的新手,我正在密切关注本教程https://aws.amazon.com/blogs/machine-learning/creating-a-machine-learning-powered-rest-api-with-amazon-api-gateway -mapping-templates-and-amazon-sagemaker/使用 Amazon API Gateway 映射模板和 Amazon SageMaker 创建机器学习驱动的 REST API
当我在终端上运行以下命令时(教程的步骤 2)
aws sagemaker-runtime invoke-endpoint \
--endpoint-name <endpoint-name> \
--body '{"instances": [{"in0":[863],"in1":[882]}]}' \
--content-type application/json \
--accept application/json \
results
Run Code Online (Sandbox Code Playgroud)
我收到以下错误: Invalid base64: "{"instances": [{"in0":[863],"in1":[882]}]}"
我的端点位于InServiceSageMaker 控制台上,并且示例 Jupyter 笔记本成功运行。(我也<endpoint-name>用实际名称替换 - 在名称周围有/没有引号时收到相同的错误)
这里使用的zsh是 aws cli 版本:
aws --version
aws-cli/2.0.15 Python/3.7.4 Darwin/19.4.0 botocore/2.0.0dev19
Run Code Online (Sandbox Code Playgroud)
想知道可能是什么问题。任何帮助表示赞赏
我的 s3 存储桶中有很多文件,那么是否有任何 aws cli 命令可以用来查找 s3 中具有前缀名称的最新文件?如何将该文件从 s3 复制到我的本地文件夹?我可以使用 Boto3 或 python 库来执行此操作吗?
我正在尝试按照此示例提取 Amazon SageMaker Pytorch 公共映像之一。在示例中,他们使用 shell 脚本和 Dockerfile 来拉取扩展构建容器并将其推送到 ECR。这是 shell 脚本:
# The name of our algorithm
algorithm_name=pytorch-extending-our-containers-cifar10-example
cd container
account=$(aws sts get-caller-identity --query Account --output text)
# Get the region defined in the current configuration (default to us-west-2 if none defined)
region=$(aws configure get region)
region=${region:-us-west-2}
fullname="${account}.dkr.ecr.${region}.amazonaws.com/${algorithm_name}:latest"
# If the repository doesn't exist in ECR, create it.
aws ecr describe-repositories --repository-names "${algorithm_name}" > /dev/null 2>&1
if [ $? -ne 0 ]
then
aws ecr create-repository --repository-name …Run Code Online (Sandbox Code Playgroud) 在运行时使用官方 AWS 指南permission denied error安装 aws-cli 版本后获取aws --version
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用带查询的 AWS CLI 运行命令。该命令可能很简单,例如aws s3api list-buckets --query 'sum(Versions[*].Size)'
但是,有时某些值可能会返回 null。在上面的示例中,当没有任何内容时,size 可以为 null,命令将返回以下错误:
In function sum(), invalid type for value: None, expected one of: ['array-number'], received: "null"
我怎样才能给它一个默认值?如果实际值为空,我想将其设置为,0以便结果中有一些值而不是错误。
我正在创建一个 shell 脚本,它将在本地创建几个 dynamodb 表等。这是我正在使用的创建表 AWS CLI 命令:
aws dynamodb create-table --cli-input-json file://table-user.json --endpoint-url http://localhost:8000
Run Code Online (Sandbox Code Playgroud)
table-user.json 包含用于创建的所有表相关信息。
此命令的问题是我需要单击“q”键才能继续执行下一行,因为它提供表详细信息作为输出。前任:
{
"TableDescription": {
"AttributeDefinitions": [
{
"AttributeName": "id",
"AttributeType": "S"
},
{
"AttributeName": "externalId",
"AttributeType": "S"
},
.
.
.
Run Code Online (Sandbox Code Playgroud)
如何静默运行创建表命令?
我想显示一些帮助文本,并用 grep 搜索它。
aws ec2 help | grep instance
AWS CLI 用于more对帮助进行分页。
要禁用它我已经尝试过:
aws --no-cli-pager ec2 help | grep instance
export AWS_PAGER=''; aws ec2 help | grep instance
并更改cli_pager配置文件:
[default]
cli_pager=
Run Code Online (Sandbox Code Playgroud)
它仍然使用寻呼机。
我在 Cygwin 上使用 AWS CLIv2 Windows 版本。
如何禁用它?
aws-cli ×10
amazon-ecr ×1
amazon-ecs ×1
amazon-s3 ×1
aws-billing ×1
bash ×1
boto ×1
boto3 ×1
docker ×1
jmespath ×1