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
123
votes
28 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…
118
votes
11 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,808
  • 3
  • 14
  • 23
113
votes
7 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?
ultraInstinct
  • 4,063
  • 10
  • 36
  • 53
110
votes
13 answers

How to display only files from aws s3 ls command?

I am using AWS CLI to list the files in an AWS S3 bucket using the following command (aws s3 ls): 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
  • 8,044
  • 17
  • 64
  • 112
108
votes
15 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
  • 6,407
  • 14
  • 48
  • 83
105
votes
17 answers

Unable to select Custom SSL Certificate (stored in AWS IAM)

I am going to create a new distribution at CloudFront. Already I have uploaded my SSL certificate at AWS IAM using AWS CLI. That certificate appears in the Custom SSL Certificate dropdown on new distribution page but it is DISABLED. Can someone tell…
theGeekster
  • 6,081
  • 12
  • 35
  • 47
104
votes
10 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
  • 4,765
  • 4
  • 21
  • 24
100
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
  • 6,586
  • 12
  • 45
  • 66
97
votes
9 answers

AWS sts assume role in one command

To assume an AWS role in the CLI, I do the following command: aws sts assume-role --role-arn arn:aws:iam::123456789123:role/myAwesomeRole --role-session-name test --region eu-central-1 This gives to me an output that follows the schema: { …
Arcones
  • 3,954
  • 4
  • 26
  • 46
97
votes
5 answers

How do I set the name of the default profile in AWS CLI?

When I give the command aws config list, I get the following output for the default profile: Name Value Type Location ---- ----- ---- -------- profile …
TheRookierLearner
  • 3,643
  • 8
  • 35
  • 53
95
votes
9 answers

How to temporarily switch profiles for AWS CLI?

Updated answer (7/10/2021): For AWS CLI v1, do this: export AWS_DEFAULT_PROFILE=user2 For AWS CLI v2, the following will work: export AWS_PROFILE=user2 The full question is below for context: (1.) After successfully configuring a second profile…
James Shapiro
  • 4,805
  • 3
  • 31
  • 46
94
votes
13 answers

How to install aws-cli on alpine?

I'm installing aws-cli on a docker swarm manager node running alpine (Linux 0317632a4ad9 4.9.59-moby #1 SMP Thu Mar 1 20:54:00 UTC 2018 x86_64 Linux). The aws-cli package for Alpine is currently listed in the community repo on the edge branch…
HieroB
  • 3,917
  • 4
  • 17
  • 22
91
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
  • 3,575
  • 8
  • 25
  • 33
87
votes
5 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
  • 5,163
  • 6
  • 35
  • 56
87
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,159
  • 1
  • 9
  • 14