Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [aws-cli]

aws-cli is the Amazon Web Services Command Line Interface

0
votes
0answers
11 views

Is Collections (resource) available only for three services in AWS and how to find all the documentation for it? [on hold]

I am having a bit of difficulty in getting to understand boto3 documentation. I want to know if boto3 resource collections are available for only three AWS services (EC2, S3, SQS).
2
votes
1answer
51 views

How to change the EBS volume size

I can initiate a spot EC2 instance using the AWS command line tool. aws ec2 request-spot-instances \ --spot-price 0.01 \ --instance-count 1 \ --launch-specification \ "{ \ \"ImageId\":\"...
1
vote
1answer
45 views

Spawn new Aws::AutoScalingGroup instances before old are destroyed. (503 error occuring)

TL;DR: See edit at bottom. I am attempting set up continuous deployments for our new environment we are migrating to at my company. I am using an aws cloudformation stack to contain all of my ...
2
votes
1answer
113 views

What is the difference between --query and --filter in aws cli? Which is suggested to be used?

I am starting to pick up aws cli and I just wanted to know the difference between --query and --filter in aws cli? When we should use --query and --filter options?
1
vote
1answer
30 views

How can I use two AWS access keys on the same computer?

I'm trying to use two different AWS accounts on my computer. One is for my work and the other one is for my personal project. I made a new Elastic Beanstalk application with eb-cli commands to create ...
2
votes
0answers
43 views

How do i check if an instance is in the terminating state? [duplicate]

This returns InstanceStatuses: aws ec2 describe-instance-status --include-all-instances --instance-ids i-123123123 Which looks like: { "InstanceStatuses": [ { "...
4
votes
3answers
693 views

AWS Instance Password lost after Login

As the title suggested I have lost my Linux Instance password. I have already accessed it via putty and it's ppk key. But I don't remember the password of system. Is there any another way to access ...
0
votes
2answers
53 views

Historical stats on capacity shortages in the EC2 spot instance market

Recently I'm getting lots of spot instances terminated with the following message: instance-terminated-no-capacity: Your Spot instance was terminated because there is no Spot capacity available ...
2
votes
1answer
53 views

How to check which IAM performed an object modification of an s3 bucket

Is there a way to see which IAM did a modification on a aws s3 bucket object (with versioning enabled)? I know that there is the aws s3api list-object-versions, but it only shows the owner's ...
1
vote
1answer
23 views

SSM Managed instance using AWS CLI and assume-role

I have a requirement for a non AWS host to perform a scheduled scripted task with an S3 bucket. I have this working as expected with access/secret access keys related to the S3 role. This non AWS ...
1
vote
1answer
32 views

Federated SSO to AWS using CLI

We have successfully setup an external idP using google and connected it to AWS. Our users now have Federated SSO with AWS and can easily log into the web console with SAML 2.0 federation Role we ...
1
vote
0answers
20 views

AWS SSM deleting its own files as part of its execution. Any way to safely do it?

Is there a safe way to delete all of an AWS SSM runRemoteScript directory as part of execution? Details below. We've got a very robust AWS SSM setup working involving a python app that polls AWS, ...
0
votes
1answer
27 views

aws s3 cp files from the root of a subdirectory without getting subfolders as well? Powershell

s3://bucketname/yyyymmdd/foo/bar I have some files in the root directory and I want to copy them. I do not want to copy any subdirectories to the root (foo). I'm trying this in powershell: aws s3 cp "...
2
votes
1answer
159 views

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. ...
0
votes
1answer
47 views

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 ...
0
votes
1answer
42 views

How to find the type of a aws instance and whether its EBS Provisioned IOPS SSD or not?

I have a AWS instance on which I perform a ssh login and operate.Os is Ubuntu 16.04.3. I didn’t select it’s AMI and neither do I have the access to its AWS console. I wanted to know that what ...
2
votes
0answers
158 views

AWS EB with python 3.6 errors and uses python 2.7

How do I get the aWS EB instance to use the python 3 version that is already installed on the instance? I can't get a new environment running with Python 3.6 running Django 2.1+. Local (not in ...
-1
votes
1answer
295 views

SSL/TLS support in AWS ELB/NLB with multiple instance ports assigned to Load balancer

AWS NLB does not allow SSL but ELB does. However NLB supports adding multiple instance ports to LB where as ELB does not. Is there way to support multiple ports for LB with SSL transport? For ...
0
votes
1answer
104 views

How to get the Auto-assigned IP address from an Amazon Instance via aws-cli

As many of you know AWS have Auto-Assigned "Public" IP's and Elastic IP's for the instances, I can get the Elastic IP's via cli with the describe-addresses command: https://docs.aws.amazon.com/cli/...
1
vote
1answer
294 views

`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....
1
vote
1answer
32 views

How to obtain ec2 AMI pricing info. using CLI/URL

I am struggling to understand how to obtain pricing info. programmatically (that is, via URL or aws CLI). I suspect I am missing the 'big picture'. I can estimate pricing manually on the web by, for ...
-1
votes
1answer
33 views

AWS cli: set permission to public only to files inside specific “folders”

So we have 300GB+ of files, in folders like the example above: 1000 file.jpg big/file.jpg medium/file.jpg 2000 file.jpg big/file.jpg medium/file.jpg How to I set permission to allow anyone to ...
2
votes
2answers
1k views

AWS could not get token: AccessDenied: User: ARN is not authorized to perform: sts:AssumeRole on resource: Role:ARN

I am following the step guide to set up and kubernetes environment on AWS. https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#role-create It already had some gochchas.. and they ...
2
votes
1answer
78 views

Is it possible to populate an S3 bucket through a CloudFormation template?

I need to store some files for my CF template (GraphQL schema, Lambda source, etc) into an S3 bucket that will also (hopefully) be defined in the same template, as that seems to be the only way ...
0
votes
1answer
189 views

IAM user with DeleteObject permissions cannot delete from S3 bucket

Guys there's something I really don't understand. The GitLab runner at the bottom cannot delete objects in the bucket at the top. He should have permissions to do that, but instead I get the following:...
0
votes
1answer
27 views

How to find which AWS account a loadbalancer is pointed to?

A really lame question, but I can't seem to google it, sorry. I have the LoadBalancer URL and have quite a few AWS accounts that it might be under. How does one figure out reliably which account the ...
0
votes
0answers
29 views

Unable to update ElasticSearch access policy using AWS CLI

I have an access policy that looks something like this: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "...
0
votes
0answers
16 views

Container image push to ECR shows in AWS CLI, but not web console

We have a Jenkins pipeline set up to build a container image and publish it to ECR. The pipeline completes successfully and console output shows that the push completed. I am able to see the image via ...
0
votes
1answer
18 views

Add a security group to the list of existing ones to an EC2 using the the AWS CLI (one-liner)

This question is a follow up (not a duplicate) of How to add a security group to a running EC2 Instance?. I believe it deserves to have its own answer rather than a comment. How could I write a one-...
1
vote
1answer
17 views

list-vaults permission on AWS

If I log in into EC2 instance and try to issue the command aws glacier list-vaults --account-id ###### I get an error that the user doesn't have permission, I was able to give the IAM users the ...
0
votes
1answer
65 views

Get all AWS resources via cli with some tag

I've set tag Terraform = true to all resources created by Terraform and now I am wondering is it possible to get all AWS resources (VPC, subnets, ec2 etc) via awscli with this tag? How do you manage ...
0
votes
0answers
109 views

How to find and change DB Security Group to VPC Security Group

I have a ElasticBeanstalk environment that I can't update any more: Environment update is starting. Environment health has transitioned from Ok to Info. Application update in progress (...
3
votes
1answer
832 views

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 ...
0
votes
1answer
76 views

VPN Server configuration in Ec2 AWS

I am looking to setup a VPN Server in AWS EC2 instance. I do understand ec2 instances have limited bandwidth according to its instance type. Let assume, I have a t2 medium instance on which VPN ...
0
votes
1answer
19 views

Get the current VPC from CLI within the EC2 instance

How is it possible to display the current VPC from the CLI within a running Linux (Debian) EC2 instance?
0
votes
0answers
28 views

Removing and restoring an AWS ELB when needed?

I have a fairly common (and functioning) Opsworks stack with an ELB, auto-scaling app servers, and a database. Trouble is, 99% of the time I just need one app server and don't need the ELB, yet I'm ...
0
votes
1answer
279 views

AWS IAM role RDS authentication failure

Trying to create a process for IAM role based authentication to my RDS instance per AWS wiki, but no matter what I seem to do I get a basic auth failure akin to a bad password, with no logging ...
1
vote
0answers
49 views

Django deployed on Elastic Beanstalk intermittently hangs on login

I have a demo django application that is on an Elastic Beanstalk instance that I am showing, and I've had weird intermittent behavior. Sometimes I get stuck at the login menu (the whole site requires ...
2
votes
0answers
122 views

Updating to latest Docker images in Elastic Beanstalk Multicontainer

I'm running a site on Elastic Beanstalk using a multi container set up. I'm wondering what is the preferred strategy to pull in the latest images. On the CI server, after successful commits to master,...
0
votes
1answer
575 views

Use environment variable credentials for source_profile with AWS CLI

I have 2 AWS accounts and have set up cross account authentication using IAM roles. I have created a AWS CLI named profile for the second account, which uses a role_arn and specifies my default ...
1
vote
0answers
55 views

AWS Elastic IPV6

I posted a question some time ago about an AWS Elastic ipv6 (AWS CLI Elastic IP, IPv6) Basically i need to be able to change the ipv6 from one instance to another like an elastic ip. (Instances in ...
1
vote
2answers
1k views

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 ...
0
votes
1answer
180 views

get a list of instances on ec2 without termination protection?

I want to get a list of instances on ec2 without termination protection. Before I code something to do this, is there something hidden in the aws cli for this ?
-3
votes
1answer
46 views

Teamspeak 3 Database Error

I am working on a project for a 'redudant' teamspeak server wtih aws. Ive got most of what I need done, however I'm running into a snag. Teamspeak A is the primary server, and is running fine. I need ...
0
votes
0answers
254 views

Can't connect to a ec2 windows instance after I have enabled Enhanced Networking with ENA

My problem started when I couldn't change an EC2 instance type from a c4.large to a c5.large because I get an error message saying that I have first to enable Enhanced Networking, then I googled how ...
1
vote
1answer
561 views

AWS CLI - How do I list instances and dump two specific tags along with other items

The cli below works perfectly now I would also like to capture two other tags in addition to 'Name' called 'Application' and 'Environment'. How can I change this to add Application and Environment ...
0
votes
1answer
269 views

How to attach IAM role to an instance via Powershell?

Is there any way to attach IAM role to an existing instance via AWS Tools for Windows PowerShell? I've seen in https://aws.amazon.com/blogs/security/new-attach-an-aws-iam-role-to-an-existing-amazon-...
0
votes
1answer
328 views

Download files from S3 without listing

I have a s3 bucket with more than a million files and about a thousand files added each day by various applications into various folders. I would like to download and keep all the files locally as ...
2
votes
1answer
172 views

What are the environment tier options in aws elasticbeanstalk cli?

This has been driving me nuts. Can anyone point me to the docs section that has this information? The cli-input json to aws elasticbeanstalk create-environment command { "ApplicationName": "...
0
votes
1answer
195 views

AWS ECS: Service + autoscaling vs User Data launching Task

Trying to wrap my head around ECS using EC2 launch (not Fargate, at least for now). Assume a single long-running task that I want to launch with every container instance. The intended mechanism for ...