标签: aws-cli

AWS IoT - AMQJS0008I 套接字已关闭 - AUTHORIZATION_FAILURE

我正在尝试配置 AWS IoT 以与 AWS Amplify 一起使用。我总是看到错误为“ AMQJS0008I 套接字已关闭。 \xe2\x80\x9d 并且 CloudWatch 说 \xe2\x80\x9c AUTHORIZATION_FAILURE \xe2\x80\x9d。这是我配置的

\n\n
    \n
  1. 经过身份验证的 Cognito 身份池的 I AM 策略
  2. \n
\n\n
    {\n        "Version": "2012-10-17",\n        "Statement": [\n            {\n                "Sid": "VisualEditor0",\n                "Effect": "Allow",\n                "Action": [\n                    "cognito-identity:*",\n                    "mobileanalytics:PutEvents",\n                    "cognito-sync:*",\n                    "iot:Connect",\n                    "iot:Publish",\n                    "iot:Subscribe",\n                    "iot:Receive",\n                    "iot:GetThingShadow",\n                    "iot:UpdateThingShadow",\n                    "iot:DeleteThingShadow",\n                    "iot:AttachPolicy",\n                    "iot:AttachPrincipalPolicy"\n                ],\n                "Resource": "*"\n            }\n        ]\n    }\n
Run Code Online (Sandbox Code Playgroud)\n\n
    \n
  1. Cognito 身份的 IoT 政策
  2. \n
\n\n
{\n  "Version": "2012-10-17",\n  "Statement": [\n    {\n      "Effect": "Allow",\n      "Action": "iot:Connect",\n      "Resource": "arn:aws:iot:ap-south-1:XXXXXXX:client/${iot:ClientId}"\n    },\n    {\n      "Effect": "Allow",\n …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services aws-cli aws-iot aws-amplify aws-policies

0
推荐指数
1
解决办法
4051
查看次数

参数值在 aws cli Cloudformation 中不起作用

我正在通过 AWS CLI 运行我的云形成模板。它工作正常并在 AWS 门户上创建堆栈,但我面临一个问题,即无法更改默认参数值。我使用 CLI 传递我自己的参数,但只有最后一个参数值从堆栈中发生变化(即 30),其余的没有变化,而是从模板主体中选择默认值。我已经通过更改参数的位置尝试了所有可能的方法,但它仍然相同。所以请让我知道我将如何解决这个恼人的问题。这是我的命令:-

aws --region eu-north-1 cloudformation  create-stack --stack-name cli4  --template-body file://app_cli.json --parameters "ParameterKey"="Maxvalue","ParameterValue"="7","ParameterKey"="increment","ParameterValue"="1","ParameterKey"="incrementtime","ParameterValue"="30"

"Parameters": {
        "EnvironmentName": {
            "Description": "An environment name that will be prefixed to resource names",
            "Type": "String",
            "Default": "Codavel"
        },
        "amiID": {
        "Description": "Put ami-id in this",
        "Type": "String",
        "Default": "ami-085045326daf7e309"
        },
        "Maxvalue": {
        "Description": "Put max value in this",
        "Type": "String",
        "Default": "100"
        },
        "increment": {
        "Description": "Put No. of incremental instance this",
        "Type": "String",
        "Default": "2"
        },
        "incrementtime": …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services aws-cloudformation aws-cli devops aws-cloudformation-custom-resource

0
推荐指数
1
解决办法
1784
查看次数

如何通过 AWS CLI 更新 Amazon S3 存储桶策略?

我需要向 Amazon S3 存储桶策略添加新行“arn:aws:sts::1262767:assumed-role/EC2-support-services”。

像这样的东西:

前:

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"AddCannedAcl",
      "Effect":"Allow",
    "Principal": {"AWS": ["arn:aws:iam::111122223333:root","arn:aws:iam::444455556666:root"]},
      "Action":["s3:PutObject","s3:PutObjectAcl"],
      "Resource":"arn:aws:s3:::awsexamplebucket1/*",
      "Condition":{
     "StringNotLike": {
        "aws:arn": [
          "arn:aws:sts::1262767:assumed-role/GR_COF_AWS_Prod_Support/*"
        ]
      }       
     }
   
    }
  ]
}

Run Code Online (Sandbox Code Playgroud)

后:

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"AddCannedAcl",
      "Effect":"Allow",
    "Principal": {"AWS": ["arn:aws:iam::111122223333:root","arn:aws:iam::444455556666:root"]},
      "Action":["s3:PutObject","s3:PutObjectAcl"],
      "Resource":"arn:aws:s3:::awsexamplebucket1/*",
      "Condition":{
     "StringNotLike": {
        "aws:arn": [
          "arn:aws:sts::1262767:assumed-role/GR_COF_AWS_Prod_Support/*",
           "arn:aws:sts::1262767:assumed-role/EC2-support-services"
        ]
      }       
     }
   
    }
  ]
}

Run Code Online (Sandbox Code Playgroud)

我需要使用什么 AWS CLI 命令来添加此行?

amazon-s3 amazon-ec2 amazon-web-services aws-cli

0
推荐指数
1
解决办法
9032
查看次数

如何通过 CLI 终止 AWS 中的多个 EC2 实例?

我正在寻找EC2通过终止多个实例AWS CLI。是的,可以通过执行以下命令来终止 EC2 实例。

句法aws ec2 terminate-instances --instance-ids <intance id> --profile <profile name>

例子aws ec2 terminate-instances --instance-ids <i-...> --profile xxx

但我有一个需要终止的大量实例列表,因此我正在寻找一种解决方案,通过提供实例 ID 列表来终止一批 EC2 实例。我尝试使用多个实例 ID,如下所示,但它们不起作用。

  • aws ec2 terminate-instances --instance-ids ("instance-id1", "intance-id2") --profile xxx
  • aws ec2 terminate-instances --instance-ids ("instance-id1intance-id2") --profile xxx
  • aws ec2 terminate-instances --instance-ids (instance-id1,intance-id2) --profile xxx

请告诉我是否有可能终止一批实例。

command-line-interface amazon-ec2 amazon-web-services aws-cli

0
推荐指数
1
解决办法
4433
查看次数

AWS CLI 描述实例不返回任何实例

我有一个 t2.micro 实例在 AWS EC2 中运行。我尝试使用 AWS CLI 列出实例,但结果似乎为空。有什么提示吗?

[root@centos7 ~]# aws ec2 describe-instances
{
    "Reservations": []
}
Run Code Online (Sandbox Code Playgroud)

amazon-web-services aws-cli

0
推荐指数
1
解决办法
782
查看次数