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
4
votes
2 answers

awcli query option for multiple filter expressions

Given the output of aws ec2 describe instances I am trying to display objects that have no Platform value and DO have a VpcId value. So far I have come up with this: aws ec2 describe-instances --filters "Name=instance-state-name,Values=running"…
Roderick Day
  • 51
  • 1
  • 5
4
votes
1 answer

AWS: Why is the bucket size on CloudWatch higher than when using S3 tools?

I use the awscli tools to verify the size of my buckets. First the S3 call (all files without versioning, just an ordinary upload): $ aws s3 ls s3://XXX --recursive --human-readable --summarize (...) Total Objects: 2 Total Size: 82.5 GiB Then I…
3
votes
1 answer

How do I set user-data when using the AWS CLI --cli-input-json argument?

I'm trying to create a script that will automatically deploy and install an AWS EC2 instance using a bash script. I have a deployment script that looks something like this: #!/bin/bash # Update apt-get echo Updating apt-get repositories apt-get…
scuba_mike
  • 376
  • 4
  • 11
3
votes
1 answer

In AWS , How can I attached volumes list for particular VM using REST APIs

How can I get the attached Volumes list for a particular instance\VM using the REST API? IE: What is the REST API equivalent for this AWS CLI command: aws ec2 describe-volumes --region us-west --filters…
alok tanna
  • 31
  • 2
3
votes
1 answer

AWS S3: How to change an HTTP Header of a single object in a S3 bucket via CLI?

As the question implies I want to change/set some HTTP headers for a single object in a S3 bucket via CLI. This is what I have tried so far: aws s3 sync --delete --acl public-read --cache-control \ max-age=31536000 --expires "Mon, 01 Oct 2035…
manifestor
  • 6,079
  • 7
  • 27
  • 39
3
votes
1 answer

Export my whole AWS architecture into file?

In AWS, I have a VPC with many components inside, including subnets, security groups, gateways, load balancers, target groups, many instances, and others. Is there any ways to export my whole architecture and components into a file, sayXML or…
3
votes
2 answers

`Access Denied` for some files, when syncing buckets

I'm using awscli to sync 2 buckets (same account): aws s3 sync --only-show-errors s3://bucket-1 s3://bucket-2 but for some files I get permission errors: copy failed: s3://bucket-1/dirname/file.flac to s3://bucket-2/dirname/file.flac An error…
kindoflike
  • 131
  • 1
  • 5
3
votes
0 answers

How to pass environment variables to packer in AWS?

I am building a custom AMI in AWS using packer and bash + salt provisioning. However, I am in need of being able to pass some variables from my local environment to the build system and I don't really know how to do that when building using "ebp"…
3
votes
1 answer

How to use Let's Encrypt with both EC2 and Cloudfront?

I want to use Let's Encrypt certificates for both EC2 and Cloudfront. I am creating a wordpress installation EC2 t2.micro using Ubuntu 16.04(HVM) AMI and nginx. EC2 region will be us-east-2 (Ohio). I can create Let's Encrypt cert using the certbot…
3
votes
2 answers

AWS - Get AMI default username from CLI

I'd like to get the default username for an AMI on AWS. For example, I need to obtain the username shown in the box in this image, via API or CLI. Any thoughts?
MT.
  • 321
  • 2
  • 8
3
votes
1 answer

How to automatically update AMI in Amazon EC2 Auto Scaling Launch Configuration

How can I update the AMI in an Auto Scaling configuration after updating code in an EC2 instance? I don't need to use AWS CodeDeploy. I have simple script, but it is still requires me to manually type the Image ID: 1) Create AMI aws ec2…
Abdi Darmawan
  • 31
  • 1
  • 2
3
votes
1 answer

AWS CLI put-lifecycle-configuration between buckets

I have a bucket that I manually created an object lifecycle policy for; now I'd like to apply that policy to other buckets. I run the following command to get the existing policy: aws s3api get-bucket-lifecycle --bucket mybucket >…
gsoyka
  • 31
  • 3
3
votes
2 answers

How to execute aws ec2 describe-instances for different account

Assuming we have two AWS acounts: Account-A, Account-B and an ec2 instance running on AccountA. aws ec2 describe-instances works as expected for the instance's own account without an ~/.aws/credentials file with an instance role. My goal is to run…
Lightbeard
  • 239
  • 1
  • 5
  • 12
3
votes
1 answer

Permission denied errors after installing AWS CLI on Linux

After seeming to succeed in installing the AWS CLI per this page I am getting permission denied errors for basic tests while logged in as root on CentOS release 6.6 running python 2.6.6. root@hostname [~]# ./awscli-bundle/install -b…
jerrygarciuh
  • 79
  • 1
  • 2
  • 12
3
votes
1 answer

Parameter parsing when using AWS SSM send-command from Terraform

I am using AWS SSM send-command to run a PowerShell script on an AWS instance. The following commanad works fine in a command shell but when called in Terraform gets an error. aws ssm send-command --instance-ids ${self.id} --document-name…
Brian Walsh
  • 43
  • 1
  • 7