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

380 questions
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
  • 904
  • 1
  • 9
  • 13
11
votes
3 answers

Download EBS volume or snapshot to file

Is there any way to dump/save EBS volume/snapshot to file or mount it to local Linux file-system? I found only this old thread and this script which intends to save it via S3 and doesn't seem very reliable. I also found this online-tool, but it…
Suncatcher
  • 594
  • 2
  • 7
  • 22
11
votes
1 answer

Filtering AMI by name using aws-cli

Is there a way to filter public AMIs that contain a particular string (say abcd)? The command: aws ec2 describe-images --filters Name=name,Values=abcd returns only those AMIs that exactly match Name=abcd
Jedi
  • 458
  • 1
  • 5
  • 20
11
votes
5 answers

The config profile (adminuser) could not be found

I have an IAM user adminuser which is in the Administrators group (having AdministratorAccess). I have used aws configure to set up the settings. ~/.aws/config [default] region = us-east-1 output =…
Hongbo Miao
  • 371
  • 1
  • 2
  • 10
11
votes
3 answers

How to find out when an EC2 instance was shutdown?

I have hundreds of instances in the EC2 web console. Some are shutdown. I can see that they were created many months or years ago. They seem abandoned and forgotten for a while but it's hard to tell if terminating them is safe. e.g. They could be…
user5994461
  • 2,919
  • 1
  • 18
  • 31
11
votes
1 answer

AWS CLI throws "Unable to locate credentials", the second time it's run

I'm trying to download some files from S3 to an EC2 instance using the AWS CLI (1.8.7) on startup using a User-Data Script. This instance has a IAM Role & Instance Profile with the appropriate permissions. Sometimes, the CLI will fail with the error…
11
votes
4 answers

How to update AWS CLI tools on AWS Linux?

I am running "Amazon Linux AMI release 2010.11.2". I noticed that the AWS CLI tools are outdated. I have tried to use yum update and yum upgrade but it's telling me that the packages are already at their latest version. How would I update the CLI…
0x6A75616E
  • 661
  • 3
  • 10
  • 24
10
votes
4 answers

fetch autoscaling group name in AWS

Folks, I am writing a script that will export the tags for a running instance as environment variables. Problem with autoscaling groups, is that these tags are not available to the instance. How does one know which autoscaling group an instance…
CMag
  • 707
  • 2
  • 11
  • 32
9
votes
4 answers

Why can't I capture AWS EC2 CLI Output in Bash?

I am trying to capture the output of an aws ec2 delete-snapshot in a Bash script command but I cannot get anything to capture the output. I have tried result=$(command), result=`command` etc. but when I try to echo $result there is nothing…
JoshZ
  • 93
  • 1
  • 1
  • 3
9
votes
2 answers

Is there any way of viewing, in AWS, what ips in a subnet have been allocated?

Is there any way of seeing what ip addresses AWS thinks have been allocated in a subnet? I've run a ping scan, and I've checked our internal ip management software, and there should be more than 8 ips free, however the Network Load Balancer creation…
Some Linux Nerd
  • 3,327
  • 3
  • 19
  • 22
8
votes
2 answers

How to set name in command line when running `aws ec2 run-instances

How to give Name in command line when running aws ec2 run-instances ? I don't find it in the official docs
user5858
  • 263
  • 1
  • 5
  • 17
8
votes
4 answers

Which IAM permissions are needed for ec2-create-image?

I looked through the official docs and couldn't seem to find any reference as to which permissions the IAM user needs in order to be able to use this command. I want the IAM user to only be able to create images for this one particular instance, so…
wwarren
  • 264
  • 1
  • 2
  • 10
8
votes
2 answers

I'm trying to use "aws s3 sync" on my EC2 instance. Is the '--exclude' option broken?

I'm trying to backup my EC2 instance to S3 using Amazon's official tools that come preinstalled on the EC2 instance. I'm having difficulty getting the sync command to exclude directories from the sync. The documentation makes it sound like it's easy…
user158845
  • 91
  • 1
  • 1
  • 4
8
votes
1 answer

Refreshing AWS temporary credentials

We use an authentication process for AWS whereby you authenticate, do an MFA step, and are then granted credentials that are valid for an hour. Usually these are then put in ~/.aws/credentials. However, when doing long running awscli operations such…
7
votes
1 answer

How to check via aws cli if a specific rds instance exists?

I want my bash script to detect, if an AWS RDS instance with a specific name exists already. This is what I tried: #!/usr/bin/env bash DBINSTANCEIDENTIFIER=greatdb EXISTINGINSTANCE=$(aws rds describe-db-instances \ …
hey
  • 327
  • 1
  • 5
  • 14
1
2
3
25 26