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

3275 questions
76
votes
21 answers

How do I delete a versioned bucket in AWS S3 using the CLI?

I have tried both s3cmd: $ s3cmd -r -f -v del s3://my-versioned-bucket/ And the AWS CLI: $ aws s3 rm s3://my-versioned-bucket/ --recursive But both of these commands simply add DELETE markers to S3. The command for removing a bucket also doesn't…
75
votes
24 answers

AWS CLI S3 A client error (403) occurred when calling the HeadObject operation: Forbidden

I'm trying to setup a Amazon Linux AMI(ami-f0091d91) and have a script that runs a copy command to copy from a S3 bucket. aws --debug s3 cp s3://aws-codedeploy-us-west-2/latest/codedeploy-agent.noarch.rpm . This script works perfectly on my local…
MojoJojo
  • 2,936
  • 2
  • 20
  • 46
73
votes
3 answers

Get ARN of S3 Bucket with aws cli

Is it possible to get the ARN of an S3 bucket via the AWS command line? I have looked through the documentation for aws s3api ... and aws s3 ... and have not found a way to do this.
ljcundiff
  • 1,019
  • 1
  • 9
  • 14
72
votes
11 answers

how to view aws log real time (like tail -f)

I can view the log using the following command. aws logs get-log-events --log-group-name groupName --log-stream-name streamName --limit 100 what is the command to get feature like tail -f so that i can see the log real time
LynAs
  • 5,503
  • 11
  • 41
  • 77
69
votes
10 answers

How to display only files from aws s3 ls command?

I am using the aws cli to list the files in an s3 bucket using the following command (documentation): aws s3 ls s3://mybucket --recursive --human-readable --summarize This command gives me the following output: 2013-09-02 21:37:53 10 Bytes…
Borealis
  • 6,553
  • 12
  • 58
  • 104
66
votes
9 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
  • 4,929
  • 9
  • 38
  • 91
61
votes
27 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
  • 4,280
  • 4
  • 29
  • 23
60
votes
3 answers

How Do I Clear The Credentials In AWS Configure?

I have deleted the AWS credentials in sudo nano ~/.aws/config. But, the credentials are still in aws configure. Is there a way to reset aws configure with clear state?
ebertbm
  • 2,817
  • 8
  • 27
  • 43
60
votes
3 answers

Getting Outputs from aws cloudformation describe-stacks

I am using the below to get the stack information I want via AWS Cli: aws cloudformation --region ap-southeast-2 describe-stacks --stack-name mystack It's returning result OK: { "Stacks": [ { "StackId": "arn:aws:mystackid",…
Steven Yong
  • 3,775
  • 5
  • 25
  • 47
58
votes
1 answer

How do you comment out lines in AWS CLI config and credentials files?

For AWS CLI configuration and credentials files how do you comment out lines in these files - I checked the documentation here http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files but found…
kellyfj
  • 5,211
  • 7
  • 38
  • 63
58
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)…
blueskin
  • 8,713
  • 10
  • 67
  • 100
57
votes
9 answers

AWS ECR GetAuthorizationToken

I've tried to follow AWS instructions on setting ECR authorization to my user by giving the AmazonEC2ContainerRegistryFullAccess policy to my user. However when I try to run on my PC the aws ecr get-login I get an error that I don't have…
Y. Eliash
  • 1,090
  • 1
  • 11
  • 20
56
votes
18 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,383
  • 3
  • 16
  • 38
55
votes
8 answers

How list Amazon S3 bucket contents by modified date?

Most of the time it happens that we load files in a common S3 bucket due to which it becomes hard to figure out data in it. How can I view objects uploaded on a particular date?
azhar22k
  • 2,969
  • 1
  • 17
  • 21
51
votes
11 answers

passing access and secret key aws cli

I am trying to embed access and secret key along with aws cli. e.g. aws ec2 describe-instances --aws-access-key --aws-secret-key Also tried with -o and -w options for access and secret key respectively. It says : Unknown…
user3089927
  • 2,405
  • 7
  • 23
  • 31