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
38
votes
7 answers

AWS CLI get download S3 URL for private bucket from AWS CLI

I could upload a file to a private S3 bucket successfully using following command: aws s3 cp "myfile.txt" "s3://myfolder/myfile.txt" --region=us-east-1 --output=json I would like to issue a AWS CLI command to return me a temporary URL download for…
Nam Nguyen
  • 5,668
  • 14
  • 56
  • 70
37
votes
6 answers

Invoking aws lambda without output file

I'm trying to invoke a lambda on AWS using CLI: aws lambda invoke --function-name GetErrorLambda --payload '{"body":"{\"Id\":[\"321\",\"123\"]}"}' \output. I would like to know if there's a way to print the output on the cli instead of create a…
BernardoMorais
  • 571
  • 2
  • 6
  • 14
37
votes
4 answers

AWS CLI Client.UnauthorizedOperation even when keys are set

I am trying to setup AWS CLI tools and was following instructions at http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html#setting_up_ec2_command_linux However, after following all the steps and setting up my…
wislo
  • 1,110
  • 2
  • 13
  • 24
36
votes
5 answers

Recursive list s3 bucket contents with AWS CLI

How can I recursively list all all the contents of a bucket using the AWS CLI similar to using find . on Unix. aws s3 ls s3://MyBucket --recursive complains with unknown…
Klugscheißer
  • 1,575
  • 1
  • 11
  • 24
35
votes
15 answers

UnrecognizedClientException error when authenticating on aws-cli

When I pull a clean Alphine Linux Docker image, install aws-cli on it and try to authenticate myself with aws ecr get-authorization-token --region eu-central-1 I keep getting the following error: An error occurred (UnrecognizedClientException) when…
35
votes
4 answers

How do I set Content-Type when uploading to S3 with AWS CLI?

I'm trying to set up S3 static website hosting, but it appears to return 403 on any of my objects that don't have the Content-Type metadata field set in the AWS console. I cannot figure out how to do this with the AWS CLI tool. Using the --metadata…
Alek Storm
  • 707
  • 2
  • 8
  • 14
35
votes
4 answers

how to include and copy files that are in current directory to s3 (and not recursively)

I have some files that I want to copy to s3. Rather than doing one call per file, I want to include them all in one single call (to be as efficient as possible). However, I only seem to get it to work if I add the --recursive flag, which makes it…
Susan D. Taylor
  • 669
  • 2
  • 7
  • 17
34
votes
4 answers

-bash: aws: command not found

I'm on macOS Mojave Version 10.14.5. I was following the instructions here Installing the AWS CLI when I got to the part to type aws --version in terminal, and got the response -bash: aws: command not found Here's a screenshot of terminal I…
daniel
  • 1,446
  • 3
  • 29
  • 65
34
votes
5 answers

How to Generate a Presigned S3 URL via AWS CLI

Is there a way to create presigned URL for objects in S3 bucket using AWS CLI? I know that could be done using SDK, but is it possible with CLI? I found this on one of the AWS docs, but can't complete the command: s3cmd signurl s3://BUCKET/OBJECT…
Shabbir Bata
  • 861
  • 2
  • 11
  • 23
34
votes
25 answers

AWS CLI listing S3 buckets gives SignatureDoesNotMatch error using IAM user credentials

I am using AWS CLI on Ubuntu 16.04 LTS, I am trying to list all buckets. In aws configure I have input the IAM user access key and IAM user secret key. This IAM user has permissions to list buckets and can list buckets in the console. But using AWS…
Piyush dhore
  • 641
  • 1
  • 9
  • 16
33
votes
4 answers

copy data from s3 to local with prefix

I am trying to copy data from s3 to local with prefix using aws-cli. But I am getting error with different regex. aws s3 cp s3://my-bucket-name/RAW_TIMESTAMP_0506* . --profile prod error: no matches found: s3://my-bucket-name/RAW_TIMESTAMP_0506*
Bhavesh
  • 882
  • 2
  • 9
  • 18
33
votes
2 answers

How to run AWS ECS Task overriding environment variables

To override environment variables via CLI we may use --overrides (structure) according to AWS ECS Commandline Reference. How to pass name value pairs (structure or JSON) in command line? [ { "name" : "NAME", "value" : "123" }, { "name" :…
sithumc
  • 3,254
  • 8
  • 27
  • 46
33
votes
6 answers

AWS CLI command completion with fish shell

Has anybody been able to set up auto-complete for the AWS CLI with fish shell? The AWS documentation only offers the guide for bash, tcsh, and zsh. Bash exports the variables COMP_LINE and COMP_POINT that is used by the aws_completer script provided…
Osi
  • 331
  • 3
  • 5
32
votes
4 answers

AWS_PROFILE not working with aws cli

I have the aws cli installed on my macbook. I updated the version last week and since then it seems like it ignores the AWS_PROFILE environment variable? Has anyone encountered this? I have to add --profile to every statement now to make it go…
KOT
  • 1,986
  • 3
  • 21
  • 35
32
votes
8 answers

Fastest way to sync two Amazon S3 buckets

I have a S3 bucket with around 4 million files taking some 500GB in total. I need to sync the files to a new bucket (actually changing the name of the bucket would suffice, but as that is not possible I need to create a new bucket, move the files…
mrt
  • 1,669
  • 3
  • 22
  • 32