Questions tagged [aws-cli]

The AWS Command Line Interface (CLI) is a unified tool to manage AWS services.

The AWS Command Line Interface (CLI) is a unified tool to manage AWS services. Multiple AWS services can be controlled via the command line and various actions can be automated through this tool.

Questions involving an alternate implementation for Windows PowerShell, AWS Tools for PowerShell, should be tagged with instead.

Resources

4345 questions
86
votes
6 answers

How to turn off the pager for AWS CLI return value?

I am attempting to utilize the AWS CLI along with a for loop in bash to iteratively purge multiple SQS message queues. The bash script works almost as intended, the problem I am having is with the return value each time the AWS CLI sends a request.…
Colin Armstrong
  • 1,609
  • 1
  • 12
  • 18
83
votes
31 answers

`Authorization Token has expired` issue AWS-CLI on MacOS Sierra

I'm trying to push a docker image to the AWS ECR repository using the aws-cli. I just run the get-login command execute the output (which returns login succeeded) then try to push a docker image then I get the message: denied: Your Authorization…
Ludo - Off the record
  • 5,153
  • 4
  • 31
  • 23
80
votes
11 answers

Using aws cli, what is best way to determine the current region

Interactively, I can use "aws configure" to change or see the default region. Is there a "pwd" like function, documented or not that allows me to determine or confirm the current region mid-script ? Even if AWS_DEFAULT_REGION is not defined ? I want…
mckenzm
  • 1,545
  • 1
  • 12
  • 19
76
votes
8 answers

awscli version 2 on alpine linux

I was trying to put awscli_v2 into an alpine-based docker container and see that it fails with the following error message: /aws/install: line 78: /aws/dist/aws: not found Considering that the file itself is there and can be listed with ls, I…
Konstl
  • 793
  • 1
  • 5
  • 8
76
votes
2 answers

AWS create role - Has prohibited field

I am trying out a simple example suggested by AWS documentation to create a role using a policy json file http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html And I get the error A client error (MalformedPolicyDocument)…
Chenna V
  • 10,185
  • 11
  • 77
  • 104
71
votes
23 answers

CircleCI message "error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"

I am facing an error while deploying deployment in CircleCI. Please find the configuration file below. When running the kubectl CLI, we got an error between kubectl and the EKS tool of the aws-cli. version: 2.1 orbs: aws-ecr:…
yass
  • 829
  • 1
  • 3
  • 6
71
votes
24 answers

SSL CERTIFICATE_VERIFY_FAILED in aws cli

I installed AWS CLI on the Windows server 2007 32bit. aws --version aws-cli/1.8.8 Python/2.7.9 Windows/2008Server I configure aws cli using keys Once I run below command to test AWS S3, I get this SSL error: aws s3 ls [SSL:…
DD Dev
  • 859
  • 1
  • 6
  • 11
70
votes
21 answers

awscli fails to work: No module named 'awscli'

I am trying to install awscli using pip3 on Linux Mint 17.2 Rafaela. I am getting the error: Traceback (most recent call last): File "/home/jonathan/.local/bin/aws", line 19, in import awscli.clidriver ImportError: No module named…
ThriceGood
  • 1,633
  • 3
  • 25
  • 43
70
votes
10 answers

I cannot install aws cli on mac os with pip - awscli: command not found

I tried to follow this tutorial. This is what I did in the console: pip3 install --user --upgrade awscli after that, when I write: pip3 --version I'm getting: pip 9.0.1 from /Users/user/Library/Python/3.4/lib/python/site-packages (python…
user3766930
  • 5,629
  • 10
  • 51
  • 104
70
votes
5 answers

how to return items in a dynamodb on aws-cli

So, I have a DynamoDB table Users and I want to return all the contents of this table. Or maybe even some. I tried aws dynamodb query --table-name Users and it says I have to specify key-condition or key-condition-expression, so I added the…
beejm
  • 2,381
  • 1
  • 10
  • 19
69
votes
13 answers

Parsing secrets from AWS secrets manager using AWS cli

I am retrieving secrets I have stored in AWS secrets manager with the AWS cli like this: aws secretsmanager get-secret-value --secret-id secrets Which returns arn:aws:secretsmanager:secret:my_secrets my_secrets {"API_KEY":"ABCDEFGHI"} …
Moddaman
  • 2,538
  • 3
  • 23
  • 41
68
votes
3 answers

AWS S3 sync --delete, removed new files in local

aws s3 sync --delete removed some new files. For example: There is a file in the bucket - S3://my-bucket/images/1.jpg Then, I uploaded a file to the server: 2.jpg There are 2 files in the server: 1.jpg and 2.jpg Start running the sync cronjob: aws…
Keith Kong
  • 781
  • 1
  • 5
  • 3
65
votes
8 answers

Can I force CloudFormation to delete non-empty S3 Bucket?

Is there any way to force CloudFormation to delete a non-empty S3 Bucket?
Jamie Czuy
  • 1,343
  • 1
  • 11
  • 16
63
votes
10 answers

How to delete multiple files in S3 bucket with AWS CLI

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…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
60
votes
8 answers

Copy multiple files from s3 bucket

I am having trouble downloading multiple files from AWS S3 buckets to my local machine. I have all the filenames that I want to download and I do not want others. How can I do that ? Is there any kind of loop in aws-cli I can do some iteration…
DQI
  • 725
  • 1
  • 5
  • 7