尝试使用AWS CLI for SQS发送消息时,我无法获得--message-attributes参数的简写语法.
指定json文件工作正常,并且引用不显示简写选项的示例.
以下是此命令的参考,它指定了我正在尝试使用的简写但我无法使其工作:http://docs.aws.amazon.com/cli/latest/reference/sqs/send-message html的
这是我试过的命令:
aws sqs send-message
--queue-url https://sqs.us-east-1.amazonaws.com/0000000000/aa_queue_name
--message-body "message body goes here"
--message-attributes firstAttribute={DataType=String,StringValue="hello world"},secondAttribute={DataType=String,StringValue="goodbye world"}
Run Code Online (Sandbox Code Playgroud)
我不断收到错误消息:
参数验证失败:参数MessageAttributes.contentType的类型无效,值:StringValue =快照,类型:,有效类型:
有人曾经使用速记管理发送消息属性?
我正在尝试运行此 aws s3 ls 命令:
aws s3 ls s3://path/to/my/bucket/12434 --recursive --human-readable --summarize
Run Code Online (Sandbox Code Playgroud)
用这个蟒蛇:
command = 'aws s3 ls s3://path/to/my/bucket/12434 --recursive --human-readable --summarize'
s3_folder_data = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
print s3_folder_data
Run Code Online (Sandbox Code Playgroud)
但它因以下错误而失败:
subprocess.CalledProcessError: Command 'aws s3 ls s3://path/to/my/bucket/12434 --recursive --human-readable --summarize' returned non-zero exit status 1
Run Code Online (Sandbox Code Playgroud)
当我运行该命令时,该命令本身会起作用。python 脚本由同一台计算机上的同一用户调用。是什么赋予了?
我想删除 AWS Certificate Manager 中正在使用的 AWS 证书。为此,我使用建议的 AWS CLI 和以下命令:
aws iam delete-server-certificate --server-certificate-name <name>
问题是,我尝试删除的相关证书没有“名称”,并且没有其他标志可用于删除它,例如使用其 ID。
jake@serenity ~ $ aws iam list-server-certificates
{
"ServerCertificateMetadataList": []
}
Run Code Online (Sandbox Code Playgroud)
我可以删除这个证书吗?
如何通过API调用设置ECS服务的最小和最大任务数?我知道您可以通过以下 api 设置所需的任务数量,但我没有看到任何地方可以设置最小和最大任务?我错过了什么吗?我正在使用 PHP API,但这里的任何见解都会有所帮助。
https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-ecs-2014-11-13.html#updateservice
amazon-web-services amazon-ecs autoscaling aws-cli aws-php-sdk
我有一个在控制台中显示“公共访问”的存储桶,但是当我尝试读取 aws s3api get-public-access-block 时,出现错误:
$ aws s3api get-public-access-block --bucket my-test-bucket-name
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:
abort-multipart-upload | complete-multipart-upload
copy-object | create-bucket...
Run Code Online (Sandbox Code Playgroud)
我正在运行 aws-cli 1.15.83:
$ aws --version
aws-cli/1.15.83 Python/2.7.14 Linux/4.14.77-70.59.amzn1.x86_64 botocore/1.10.82
Run Code Online (Sandbox Code Playgroud) 我有一个要求,希望确保所有单独的 Lambda 函数都使用最新版本的运行时。
使用 CLI cmd:aws lambda get function我能够获取该特定 lambda 函数的运行时版本,但我想确保它使用最新的语言版本。
浏览 Lambda 的 Aws 文档https://docs.aws.amazon.com/cli/latest/reference/lambda我无法找到任何可以判断哪些可用运行时的 API,也许从该列表中我可以确定哪个是最新的(也许通过检查该特定语言的最高版本号)。
所以只是想知道是否有我找不到的 AWS API 或者其他可以实现这一目标的方法?
注意:我不是在谈论 Lambda 函数版本控制,而是在谈论语言运行时版本。
例如,目前 AWS lambda 的最新运行时是 Node.js 8.10。因此,如果任何 Lambda 函数使用 Node.js 6.10 作为运行时,那么我想突出显示该 Lambda 函数。
我一直在使用该命令aws dynamodb create-table --cli-input-json创建本地 dynamodb 表以在本地机器上进行测试。
我可以创建简单的表格,但无法创建更复杂的现实世界表格。我查看了AWS文档,它缺少嵌套AttributeDefinitions的解释,或者我找不到它。以下是一个简单的示例(用于通过 AWS CLI 创建):
{
"TableName": "fruitsTable",
"KeySchema": [
{
"AttributeName": "fruitId",
"KeyType": "HASH"
}
],
"AttributeDefinitions": [
{
"AttributeName": "fruitId",
"AttributeType": "S"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
}
}
Run Code Online (Sandbox Code Playgroud)
效果很好。aws dynamodb create-table --cli-input-json file:///Users/you/subfile/server/config/tables/fruits.json --endpoint-url http://localhost:8000
不过,我想看一个创建更复杂的对象的示例。什么模式适用于此?
{
"ComplexFruit" : [
{
"complexFruitId": "redbanana-fromGroceryStore"
"name" : "redBanana",
"notes": "this one is red",
"count" : {
"ripe" : 5,
"total": 10
},
"stores" : [
{"storeName" : "Exito"} …Run Code Online (Sandbox Code Playgroud) 我有一个在 AWS ECS 中运行的 Fargate 应用程序,我正在尝试通过 AWS CLI (aws-cli/1.16.96 Python/2.7.15 Darwin/18.0.0 botocore/1.12.86 ) 更新该应用程序。
我已经成功构建并推送了图像,并创建了新的任务定义版本。
当我尝试使用以下命令更新服务时:
aws ecs update-service
--cluster cluster-winquest-qa
--service container-qa-ge-service
--desired-count 0
Run Code Online (Sandbox Code Playgroud)
aws ecs update-service
--cluster cluster-qa
--service container-service
--task-definition first-run-task-definition:5
--platform-version "LATEST"
--desired-count 1
Run Code Online (Sandbox Code Playgroud)
抛出以下错误消息:
An error occurred (InvalidParameterException) when calling the UpdateService operation: Task definition does not support launch_type FARGATE
Run Code Online (Sandbox Code Playgroud)
然后我尝试将 --launch-type "FARGATE" 添加到上述命令中,构建以下命令:
aws ecs update-service
--cluster cluster-qa
--service container-service
--task-definition first-run-task-definition:5
--platform-version "LATEST"
--launch-type "FARGATE"
--desired-count 1
Run Code Online (Sandbox Code Playgroud)
它抛出:
Unknown options: --launch-type, FARGATE
我知道错误消息表明 …
给出这个aws-cli命令示例
aws rds describe-db-cluster-snapshots
Run Code Online (Sandbox Code Playgroud)
我返回带有字段的对象列表。
我只想显示字段:"SnapshotCreateTime"和"DBClusterIdentifier"
我该怎么做呢?
是否可以通过 awscli 或适用于 powershell 的 aws sdk 按标签获取 aws cloudfront dist id。我只能通过资源的 ARN 编号获取 ID
aws cloudfront list-tags-for-resource --resource XXX
{
"Tags": {
"Items": [
{
"Value": "TEST_APP",
"Key": "CLIENT_APP"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
更新
解决通过
cloudfrontdistids=$(aws cloudfront list-distributions | jq -r ".DistributionList.Items[].ARN")
for dist in $cloudfrontdistids
do
if [ $(aws cloudfront list-tags-for-resource --resource $dist | jq -r ".Tags.Items[].Value") == $VALUE ]
then
CLOUDFRONT_DISTRIBUTION_ID=${dist:(-14)}
fi
done
Run Code Online (Sandbox Code Playgroud) aws-cli ×10
amazon-ecs ×2
amazon-s3 ×2
amazon-sqs ×1
autoscaling ×1
aws-lambda ×1
aws-php-sdk ×1
aws-sdk ×1
node.js ×1
python ×1
ssl ×1