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
60
votes
8 answers

Call aws-cli from AWS Lambda

is there ANY way to execute aws-cli inside AWS Lambda? It doesn't seem to be pre-installed. (I've checked with "which aws" via Node.js child-process, and it didn't exist.)
59
votes
11 answers

Bash with AWS CLI - unable to locate credentials

I have a shell script which is supposed to download some files from S3 and mount an ebs drive. However, I always end up with "Unable to locate credentials". I have specified my credentials with the aws configure command and the commands work outside…
Smajl
  • 7,555
  • 29
  • 108
  • 179
57
votes
4 answers

AWS CLI S3: copying file locally using the terminal : fatal error: An error occurred (404) when calling the HeadObject operation

I'm trying to copy files locally from s3 bucket. I can get the list of files on my bucket: aws s3 ls s3://myBucket/myDirectory/todaysFiles/ But when I try to copy the files locally: aws s3 cp s3://myBucket/myDirectory/todaysFiles/ . I get this…
user2924482
  • 8,380
  • 23
  • 89
  • 173
54
votes
5 answers

AWS EC2 'You are not authorized to perform this operation. Encoded authorization failure message:'

I am attempting to create an EC2 instance and get the following error message. How do I decode it ? Launch Failed You are not authorized to perform this operation. Encoded authorization failure message: KDmmJmkLKmQhatEqYt...MN3iUtfAa
jlo-gmail
  • 4,453
  • 3
  • 37
  • 64
54
votes
12 answers

Can't Delete Empty S3 Bucket

I have an S3 bucket that is 100% empty. Versioning was never enabled on the bucket. However, I still cannot remove the bucket. I have tried via the Console and the CLI tool. On the console it just says "Error" with no error message. From the…
Tim Martin
  • 2,419
  • 1
  • 21
  • 25
53
votes
1 answer

Difference between s3cmd, boto and AWS CLI

I am thinking about redeploying my static website to Amazon S3. I need to automate the deployment so I was looking for an API for such tasks. I'm a bit confused over the different options. Question: What is the difference between s3cmd, the Python…
user1781186
53
votes
5 answers

List public IP addresses of EC2 instances

I want to list the public IP addresses of my EC2 instances using Bash, separated by a delimiter (space or a new-line). I tried to pipe the output to jq with aws ec2 describe-instances | jq, but can't seem to isolate just the IP addresses. Can this…
Bas Peeters
  • 3,269
  • 4
  • 33
  • 49
52
votes
8 answers

Is there a way to export an AWS CLI Profile to Environment Variables?

When working with certain third-party tools like Terraform, it's not easily possible to specify an AWS CLI profile, and I like working with the environment variables better than the profiles. Is there a way for me to have the AWS CLI simply export…
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
52
votes
5 answers

User is not authorized to perform: dynamodb:PutItem on resource

I am trying to access DynamoDB from my Node app deployed on AWS ElasticBeanStalk. I am getting an error User is not authorized to perform: dynamodb:PutItem on resource It works perfectly fine locally, but when I deploy to the AWS it stops…
51
votes
5 answers

aws cli output automatically being sent to vi

I am learning the AWS CLI (v2) and have installed it on Ubuntu 18.04. I am running zsh with oh-my-zsh installed. I am trying to get aws command output to be reported back to the terminal as a JSON string (or even as text), but the output is always…
moulder
  • 1,857
  • 2
  • 12
  • 8
50
votes
9 answers

How to uninstall aws-cli

I am trying to set up an "Amazon Elastic Container Registry" but I get the following error when using this command: aws ecr get-login --no-include-email --region us-west-2: Unknown options: --no-include-email The manual redirects me when this occurs…
user007
  • 1,557
  • 3
  • 16
  • 24
50
votes
5 answers

Export a DynamoDB table as CSV through AWS CLI (without using pipeline)

I am new to AWS CLI and I am trying to export my DynamoDB table in CSV format so that I can import it directly into PostgreSQL. Is there a way to do that using AWS CLI? I came across this command: aws dynamodb scan --table-name - but…
Vibhor Nigam
  • 732
  • 1
  • 5
  • 12
49
votes
7 answers

AWS CLI: ECR list-images, get newest

Using AWS CLI, and jq if needed, I'm trying to get the tag of the newest image in a particular repo. Let's call the repo foo, and say the latest image is tagged bar. What query do I use to return bar? I got as far as aws ecr list-images…
Alex
  • 2,555
  • 6
  • 30
  • 48
48
votes
6 answers

Index handler is undefined or not exported

I have a lambda function which was working fine but I wanted to import a package so I created a directory with index.js and installed my npm package. Then created a zip of this folder and uploaded it using aws lambda update-function-code…
Anshul Walia
  • 547
  • 1
  • 5
  • 9
48
votes
3 answers

AWS CloudFormation create-stack vs deploy

Can someone clearly explain to me difference and precedence between AWS CLI Cloudformation create-stack and deploy commands? For me it seems like they do same thing and deploy resources. Why when you run the deploy command from the cli, the create…
nixmind
  • 2,060
  • 6
  • 32
  • 54