Questions tagged [aws-cli]

aws-cli is the Amazon Web Services Command Line Interface

aws-cli is an open source project that provides a command line interface to the Amazon Web Services APIs.

The project is hosted on GitHub: https://github.com/aws/aws-cli

366 questions
380
votes
27 answers

How can I get the size of an Amazon S3 bucket?

I'd like to graph the size (in bytes, and # of items) of an Amazon S3 bucket and am looking for an efficient way to get the data. The s3cmd tools provide a way to get the total file size using s3cmd du s3://bucket_name, but I'm worried about its…
61
votes
8 answers

What is causing Access Denied when using the aws cli to download from Amazon S3?

I'm really flailing around in AWS trying to figure out what I'm missing here. I'd like to make it so that an IAM user can download files from an S3 bucket - without just making the files totally public - but I'm getting access denied. If anyone can…
Josh Gagnon
  • 735
  • 1
  • 5
  • 6
58
votes
3 answers

Search ec2 instance by its name from aws command line tool

I have an instance named dev-server-03. Now how can I search all dev-server-* instances from command line? I am using aws cli tool.
Shiplu Mokaddim
  • 793
  • 2
  • 8
  • 14
54
votes
4 answers

Download SSL certificate from aws certificate manager

I am using aws certificate manager for managing SSL. Recently I purchased a wildcard ssl *.example-private.com Now I need that SSL certificate to deploy on enterprise git instance on aws. How can i download ssl from aws?
Shailesh Sutar
  • 1,427
  • 4
  • 22
  • 40
27
votes
5 answers

How to list all VPC dependencies in AWS CLI?

I want to delete VPC through CLI. But get an error: A client error (DependencyViolation) occurred when calling the DeleteVpc operation: The vpc 'vpc-xxx' has dependencies and cannot be deleted. How can I list all dependencies that prevent me from…
lexsys
  • 2,863
  • 5
  • 30
  • 34
23
votes
6 answers

How would you go about listing instances using aws cli in certain VPC with the Tag Name, private IP address of instance and instance id?

The closest I have get is using the following commands. This command manage to lists all name of instances. aws ec2 describe-instances --filters Name=vpc-id,Values=vpc-e2f17e8b --query 'Reservations[].Instances[].Tags[?Key==`Name`].Value[]' This…
Imagineer
  • 775
  • 2
  • 9
  • 20
16
votes
1 answer

2 ELBs (ALBs) to 1 target group, possible?

I have the following scheme: Internet <-> elb1external <-> varnish <-> elb2internal <-> targetgroupofwebnodes But some /static/* & /media/* are routed to targetgroupofwebnodes from elb1external directly, around varnish & second ELB, so I need both…
GTXBxaKgCANmT9D9
  • 395
  • 1
  • 6
  • 15
15
votes
4 answers

Recursively changing the content-type for files of a given extension on Amazon S3

I have a large S3 bucket with a nested "folder" structure containing (among other things) static .json and .md files. Theses files are being served by S3 as text/plain rather than the correct application/json and text/markdown. I have updated the…
Gabriel Bauman
  • 303
  • 1
  • 2
  • 10
15
votes
4 answers

Is it possible to get aws ec2 instance id based on its IP address

I have list of IP addressed, I want to find if instances associated with the IP address are still running or terminated. I am launching and terminating lot of instances on daily basis, just want to remove their certificates from puppetmaster. If…
Ramesh Kumar
  • 1,690
  • 5
  • 18
  • 29
14
votes
2 answers

How to find out an ec2 instance's private and public IP via aws cli?

Answers I found so far (e.g. Find out public ip address of the EC2 server) suggest using wget or curl to reach the server. They are not useful for me because my ec2 instances are not reachable from the internet directly. I have tried aws ec2…
Anthony Kong
  • 2,976
  • 10
  • 53
  • 91
14
votes
1 answer

How to “switch role” in aws-cli?

I'm contracting for a company that has multiple aws accounts. They gave me access to the Login account and I "Switch Role" in the web console to the Project account I work on. In the web gui it works. How do I do the same with aws-cli?? I only have…
potom
  • 340
  • 1
  • 2
  • 8
14
votes
2 answers

How to add a Tag when launching an ec2 instance using aws clis

I am trying to create an instance in ec2 using CLI. Is there anyway to specify tags to the instance when using CLI to create instances? aws ec2 run-instances --image-id $ami_id --key-name $deployment_key_name \ --region $region --security-groups…
13
votes
2 answers

Deleting S3 files with a given prefix only

We have a bucket with more than 500,000 objects in it. I'm assigned a job where I've to delete files which have a specific prefix. There are around 300,000 files with the given prefix in the bucket. For eg If there are 3…
Axel
  • 323
  • 1
  • 6
  • 17
12
votes
1 answer

Elastic Beanstalk stuck for more than 12 hrs

I have an EB application that is stuck with this error: Failed Environment update activity. Reason: Internal Failure. I can not abort anything and I cannot change any configuration.. I dont know what to do, because every thing I do, it says: Could…
12
votes
1 answer

Updating AWS CLI on Ubuntu 14.04

I installed awscli on my EC2 instance using apt-get install. The version is still aws-cli/1.2.9 and no longer updates if I use apt-get upgrade awscli. The latest release from what I Googled is 1.10.30. How can you update aws cli on Ubuntu…
julio
  • 894
  • 1
  • 9
  • 13
1
2 3
24 25