Questions tagged [aws-cli]
aws-cli is the Amazon Web Services Command Line Interface
0
votes
0answers
12 views
How to change Python version in AWS Elastic-beanstalk Node Js environment?
I have a Node js application in elastic-beanstalk and i am running python2.
How can I change my python version to 3?
I have installed python 3 through awsebcli and installed python3, How can I point ...
1
vote
1answer
25 views
How to setup python3, numpy, nltk in my elastic-beanstalk?
I have deployed my project in elastic-beanstack, I need to setup python3, numpy and nltk environment to it.
We have a python code with python3, numpy and nltk, We are interacting to python code with ...
3
votes
1answer
22 views
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 \
...
0
votes
0answers
12 views
Can't call IAM functions with temporary credentials
When calling any IAM functions using the aws cli with temporary credentials (for example, calling list-attached-role-policies), I get the following error:
An error occurred (InvalidClientTokenId) ...
0
votes
0answers
13 views
Automating the Okta AD Agent Installation
Our company will be implementing Okta as a single-sign on identity provider, and we're trying to automate the installation of the server side Okta agent so that we can avoid error-prone human ...
0
votes
0answers
20 views
Attach security groups to multiple EC2 instances
Is it possible to attach a new security group to all the EC2 instances in a specific region and keeping the old ones in place?
0
votes
1answer
28 views
Why does a custom CodeBuild image require aws configure, but not a managed one?
I have an AWS CodePipeline with the build step using CodeBuild. I was previously using a managed image for this build job and I was able to use the follow command without issue:
aws ecr get-login --...
5
votes
2answers
70 views
Can SSH to EC2 But Forgot Account
I have an EC2 micro instance that has been running for years. I can still SSH into it, but I've completely forgotten the email address I used to create it.
I had been moving from email to email every ...
0
votes
1answer
28 views
Error creating new cluster in AWS with ecs-cli
I'm running this command ecs-cli up --keypair aws-keypair-brickpile --capability-iam --size 1 --instance-type t3.medium --spot-price 0.02 with my default region eu-north-1 but it exits with this error....
0
votes
1answer
81 views
User is not authorized to perform: iam:PassRole on resource
I'm attempting to create an eks cluster through the aws cli with the following commands:
aws eks create-cluster --name ekCsluster --role-arn arn:aws:iam::111111111111:role/eksServiceRole --resources-...
0
votes
1answer
20 views
aws cli not configured when called from python script inside systemd service?
I am using an EC2 instance with ubuntu 18.04 and python 3.6. I am running a python script uses aws cli calls for various things. Before running the script, I configured the aws cli with my access ...
1
vote
2answers
374 views
AWS EKS update-kubeconfig does not respect --role-arn flag
Whenever I run the following command with the role that that was used to create the eks cluster...
aws eks update-kubeconfig --name eks-cluster --role-arn arn:aws:iam::999999999999:role/...
0
votes
3answers
40 views
How to automatically archive AWS S3 whole buckets to S3 Glacier?
I'm required to archive around 200 AWS S3 buckets to S3 Glacier and I would like to do it automatically but I can't find how it can be done with aws-cli.
The only method I found, is through AWS UI... ...
2
votes
1answer
73 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
69 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
154 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
37 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
44 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
709 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
72 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
56 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
45 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
62 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
24 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
46 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 "...
5
votes
1answer
562 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
61 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
54 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
255 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
508 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
164 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
494 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
58 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
34 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 ...
3
votes
2answers
2k 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
217 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
246 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
29 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
52 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
1answer
19 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
20 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
82 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
123 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
1k 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
78 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
22 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
30 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
359 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
68 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 ...
3
votes
0answers
168 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,...