aws-cli

AWS IoT - AMQJS0008I Socket closed - AUTHORIZATION_FAILURE

こ雲淡風輕ζ 提交于 2020-05-01 09:46:27
问题 I am trying to configure AWS IoT to use with AWS Amplify. I always see error as " AMQJS0008I Socket closed. ” and CloudWatch says “ AUTHORIZATION_FAILURE ”. This is what I configured I AM policy for authenticated Cognito Identity Pool { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "cognito-identity:*", "mobileanalytics:PutEvents", "cognito-sync:*", "iot:Connect", "iot:Publish", "iot:Subscribe", "iot:Receive", "iot:GetThingShadow", "iot

looping through a list of archive id with cli aws describe-job returns null on output

雨燕双飞 提交于 2020-04-17 22:09:26
问题 I have a loop that gets all the ids and checks for the status of the jobs on cli. jq -r '.JobList |= unique_by(.ArchiveId) | .JobList[] | "\(.JobId)"' jobs.json\ | while IFS= read -r job_id; do job_status=$(aws glacier describe-job --account-id 2222222--vault-name my-vault --job-id $job_id --output json) echo $job_status"," >> job-status.json done My issue here is that I get the following response everytime it goes past the job_status command usage: aws [options] <command> <subcommand> [

Drawing an image from a cloudformation template

╄→尐↘猪︶ㄣ 提交于 2020-04-06 19:24:07
问题 Is the any drawing / export tool that I can use to turn a cloudformation template into a diagram. In need to export my cloudformation stack into an image , or a graphviz file. Regards, 回答1: You can use the AWS CloudFormation designer. Click on Open , then upload your template. Finally take a screenshot of the result to have it in an image format. Here's an exemple of what the result might look like: For more information, have a look at the doc. 回答2: You can use the latest version of the cfn

How to delete multiple files in S3 bucket with AWS CLI

妖精的绣舞 提交于 2020-03-17 05:55:22
问题 Suppose I have an S3 bucket named x.y.z In this bucket, I have hundreds of files. But I only want to delete 2 files named purple.gif and worksheet.xlsx Can I do this from the AWS command line tool with a single call to rm ? This did not work: $ aws s3 rm s3://x.y.z/worksheet.xlsx s3://x.y.z/purple.gif Unknown options: s3://x.y.z/purple.gif From the manual, it doesn't seem like you can delete a list of files explicitly by name. Does anyone know a way to do it? I prefer not using the -

How to delete multiple files in S3 bucket with AWS CLI

心已入冬 提交于 2020-03-17 05:55:05
问题 Suppose I have an S3 bucket named x.y.z In this bucket, I have hundreds of files. But I only want to delete 2 files named purple.gif and worksheet.xlsx Can I do this from the AWS command line tool with a single call to rm ? This did not work: $ aws s3 rm s3://x.y.z/worksheet.xlsx s3://x.y.z/purple.gif Unknown options: s3://x.y.z/purple.gif From the manual, it doesn't seem like you can delete a list of files explicitly by name. Does anyone know a way to do it? I prefer not using the -

How to get the most recent shared AWS RDS snapshot by id?

不打扰是莪最后的温柔 提交于 2020-03-02 09:47:01
问题 I have 2 databases on AWS RDS, one for stage and one for production across 2 accounts. I am trying to copy the data in production to stage every x days. My plan was to make a copy of the most recent automatic backup snapshot in production and share it to the stage account before creating the database in stage using the shared snapshot from production . Everything was going right until I ran into what I believe is a bug but it could easily be that I made a mistake. When I tried to get the most

How to get the most recent shared AWS RDS snapshot by id?

江枫思渺然 提交于 2020-03-02 09:44:28
问题 I have 2 databases on AWS RDS, one for stage and one for production across 2 accounts. I am trying to copy the data in production to stage every x days. My plan was to make a copy of the most recent automatic backup snapshot in production and share it to the stage account before creating the database in stage using the shared snapshot from production . Everything was going right until I ran into what I believe is a bug but it could easily be that I made a mistake. When I tried to get the most

How do I unlock or delete an AWS S3 bucket that inadvertently locked with a bucket policy?

天涯浪子 提交于 2020-02-24 11:15:14
问题 I am the AWS account owner, admin (both IAM and root password - not recommended I know, but have some legacy apps that depend on root pw). I recently added a bucket policy which has subsequently rendered the bucket locked an inaccessible to me: $ aws s3 rb s3://<my-bucket> --force A client error (AccessDenied) occurred when calling the ListObjects operation: Access Denied Completed 1 part(s) with ... file(s) remaining remove_bucket failed: s3://<my-bucket>/ A client error (AccessDenied)

Setting environmental variables with !Ref in AWS SAM?

落爺英雄遲暮 提交于 2020-02-04 11:00:44
问题 I'm using SAM CLI v0.8.1. I'm trying to set environmental variable MY_TABLE_VAR as name of the table in my resources (MyTableResource). However, while running my app locally, the MY_TABLE_VAR is undefined. Can you tell me what's wrong in my template and how can I set it properly? Following is my SAM template: Globals: Function: Timeout: 30 Runtime: nodejs8.10 Environment: Variables: MY_TABLE_VAR: !Ref MyTableResource Resources: MyTableResource: Type: AWS::Serverless::SimpleTable Properties:

requestParameters returning “Invalid mapping expression specified: true”

时光总嘲笑我的痴心妄想 提交于 2020-02-03 08:28:54
问题 I'm configuring a lambda function's API gateway integration with the Serverless Framework version 0.4.2. My problem is with defining an endpoint's request parameters. The AWS docs for API gateway entry says: requestParameters Represents request parameters that can be accepted by Amazon API Gateway. Request parameters are represented as a key/value map, with a source as the key and a Boolean flag as the value. The Boolean flag is used to specify whether the parameter is required. A source must