How are we doing? Please help us improve AWS. Take our short survey

Questions tagged [aws-cli]

The AWS Command Line Interface (CLI) is a unified tool to manage AWS services.

aws-cli
Filter by
Sorted by
Tagged with
8 votes
4 answers
17k views

InvalidClientTokenId error aws when trying to get caller identity

hi I am unable to run this command aws sts get-caller-identity. when I do sudo nano ~/.aws/credentials I can only locate this [default] aws_access_key_id = my_id aws_secret_access_key = my_secret_id ...
0 votes
0 answers
5 views

How to wait for AWS RDS to be in stopped state using CLI?

I can see that it is possible to wait for an AWS RDS to be available or deleted using the CLI: https://docs.aws.amazon.com/cli/latest/reference/rds/wait/db-instance-available.html https://docs.aws....
0 votes
2 answers
178 views

Not able to login into Docker through AWS CLI

I am trying to push one docker image to my AWS ECR, but i am getting this error during login Command I used: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --...
3 votes
2 answers
826 views

How to add description for inbound rule with AWS CLI?

I can create new inbound rule by using following command: aws ec2 authorize-security-group-ingress --group-id sg-00b417024c6afddae --protocol tcp --port 5000 --cidr 0.0.0.0/0 How can I add the ...
20 votes
8 answers
26k views

Is it possible to install aws-cli package without root permission?

As title suggested, I haven't been able to find a good way to install aws-cli (https://github.com/aws/aws-cli/) without having the root access (or equivalent of sudo privileges). The way Homebrew ...
0 votes
0 answers
16 views

Docker pull failing after successful AWS SSO and docker authentication [closed]

I am trying to pull a remote image from AWS using docker pull and I am getting the following error after successfully retrieving an AWS SSO auth token and logging into docker: Error response from ...
15 votes
5 answers
15k views

How can I create an AWS Lambda function using the AWS CLI?

I am trying to create an AWS Lambda function using the command aws lambda create-function \ --function-name foo\ --runtime nodejs\ --role lambda_basic_execution \ --handler asdf --zip-file "...
1 vote
0 answers
51 views
+50

LocalStack: URL created by `awslocal lambda create-function-url-config` gives 404 Not Found error

EDIT: I have added my lambda function code at the end. Using LocalStack hosted in Docker on Windows 11, I have successfully bootstrapped my environment and deployed my ASP.NET Core (net8.0) Lambda ...
34 votes
7 answers
48k views

AWS CLI - All commands return Unknown output type: [None]

All of my aws-cli commands returned Unknown output type: [None] I checked my configuration $ aws configure appeared normal but i was unable to edit my 'Default output format' I ran my aws-...
0 votes
1 answer
14 views

AWS account aliases and finding them with credentials

I'm trying to find my account's alias. I've seen a lot of responses elsewhere saying it's not possible without a credential but they just stop there. Well, I do have credentials. In my call to list-...
2 votes
1 answer
224 views

Aws ecr LayersNotFoundException but layers actually present in registry

I am trying to retag and copy an image from a repository to another within the same repository, without the use of Docker but only with the aws cli I first get the manifest for the image i want to ...
0 votes
1 answer
28 views

goofys: Can't access subdir from top dir even as a root user

I mounted the bucket from S3 with the following command sudo goofys -o allow_other mybucket /mnt/buckets/mybucket/ inside mybucket, there are a bunch of subdirectories. When I do rsync or cp (with ...
0 votes
0 answers
35 views

AWS CLI : security group ID

I want to access the security group id. This is the command I used to create it, can anyone provide a one line command to view this table again? aws --profile awscli-user-1 \ ec2 create-security-...
-1 votes
2 answers
39 views

Can't get the official AWS-CLI Docker image working

I have a Dockerfile that is literally just (I've also tried with only the first line as well): FROM amazon/aws-cli:latest CMD [ "sleep", "10000" ] I build with: docker build -t ...
5 votes
4 answers
11k views

How to correctly specify path in aws ssm get-parameters-by-path?

With aws cli I can successfully create parameter in AWS Paramater Store and retrieve it using get-parameters. Example: anarinsky:~> aws ssm put-parameter --name /IAD/ERP/Oracle/addUsers --value "...
71 votes
14 answers
96k views

Parsing secrets from AWS secrets manager using AWS cli

I am retrieving secrets I have stored in AWS secrets manager with the AWS cli like this: aws secretsmanager get-secret-value --secret-id secrets Which returns arn:aws:secretsmanager<ID>:...
0 votes
2 answers
9k views

How to update an Amazon S3 Bucket Policy via the AWS CLI?

I have a requirement to add a new line "arn:aws:sts::1262767:assumed-role/EC2-support-services" to an Amazon S3 bucket policy. Something like this: Before: { "Version":"2012-...
-1 votes
1 answer
55 views

macOS: AWS CLI: 'Could not find executable named "groff"'

I'm on macOS and am attempting to view help for aws ec2 and I get: aws ec2 help Output: Could not find executable named "groff"
0 votes
1 answer
29 views

Get info from AWS CLI inspector2

I created a script to report on inspector output from the command line. aws inspector2 list-findings --query 'findings[*].{Severity:severity,Title:title,Instance:resources[*].id,Name:resources[*].tags....
16 votes
3 answers
22k views

Can we add multiple tags to a AWS resource with one aws cli command?

I am trying to add tags to Ec2 resource using aws cli command with jenkins:- The command is: aws ec2 create-tags --resources $instance_id --region $region --tags Key=$Tagkey,Value=$Tagvalue My ...
1 vote
1 answer
117 views

Error while converting and updating images to AWS s3 using sails.js

I'm trying to convert and upload 1000+ images to aws s3 using sails.js I'm fetching images using aws-cli via url and after processing using graphicsmagick uploading back to bucket. After some times ...
0 votes
1 answer
25 views

Retrieve descriptions from ssm parameters using AWS CLI

AWS CLI describe-parameters retrieves all ssm parameter data but the description value. I am trying to fetch all the ssm parameters from an AWS account, to migrate them to another AWS account. To find ...
1 vote
4 answers
130 views

AWS: SCP to an EC2 instance via AWS CLI without public IP

I have a linux instance on AWS without a public IP address. I know how to connect to it via the AWS CLI aws ec2-instance-connect ssh --instance-id <INSTANCE_ID> \ --private-key-file <...
14 votes
4 answers
7k views

How to install awscli version 2 on raspberry pi

sudo apt install awscli installs currently version 1.16.113-1 The official website (https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html) supports aarch64 but not armhf. Is there ...
1 vote
1 answer
162 views

When calling get_dimension_key_details for the aws api it is stating "This Key ID is not valid"

According to the docs, I need to pass the DbiresourceID, for example db-ABCDEFGHIJKLMNOPQRSTU1VW2X, as the identifier value. However when I do this am getting the Key id not valid error. When I pass ...
0 votes
0 answers
16 views

bash Command not executing on Ec2 from Lambda

I'm trying to run certain bash on a Ec2 instance that I create in a Lambda function. code const instanceParams = { ImageId: "ami-0c101f26f147fa7fd", InstanceType: "t2.micro&...
-1 votes
1 answer
14 views

(SignatureDoesNotMatch) when calling the GetObject operation

I'm trying to run an S3 copy operation via the aws cli. The object to be copied is large - its a single file at ~9GB. aws cli s3 cp s3://${my_bucket}/${my_file} I receive the following error: download ...
0 votes
2 answers
815 views

CloudWatch Logs role ARN must be set in account settings to enable logging

I have an API Gateway that I'm trying to deploy to dev, and I keep getting this error about CloudWatch logging. I can't find how to properly set up the permissions to deploy. Hopefully somebody has ...
-1 votes
1 answer
25 views

AWS CP but skip access denied

In a bucket where you have access to some files only, is it possible to use a single cp command but skip all the files you do not have access to? Ex if I run aws s3 cp s3://mybucket/ . I will get an ...
0 votes
1 answer
43 views

Copy files from One S3 Bucket to another S3 Bucket

I have to migrate about 20 TB data from One S3 bucket to another S3 bucket where both are in separate accounts with separate vendors and I am not the owner in either of them. I have been provided ...
0 votes
0 answers
6 views

Is aws emr-containers create-virtual-cluster command asynchronous or synchronous?

I need to know whether the aws emr-containers create-virtual-cluster cli is synchronous or asynchronous. That is when the user receives the response after issuing this aws cli command is the virtual ...
103 votes
16 answers
144k views

How to install aws-cli on alpine?

I'm installing aws-cli on a docker swarm manager node running alpine (Linux 0317632a4ad9 4.9.59-moby #1 SMP Thu Mar 1 20:54:00 UTC 2018 x86_64 Linux). The aws-cli package for Alpine is currently ...
155 votes
37 answers
357k views

The AWS Access Key Id does not exist in our records

I created a new Access Key and configured that in the AWS CLI with aws configure. It created the .ini file in ~/.aws/config. When I run aws s3 ls it gives: A client error (InvalidAccessKeyId) ...
54 votes
28 answers
62k views

How to resolve: 'Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment'

I am trying to run CDK commands to check the diff of my local and remote stack. I am using the following command. cdk diff --profile saml I am getting the following error message Unable to ...
27 votes
7 answers
41k views

install redis on aws micro instance

I need to install redis in amazon cloud. I need it as a part of my npm module kue (deployment). Can anyone link me step by step tutorial or explain how to do it, considering the fact that I'm not good ...
224 votes
37 answers
795k views

How can I resolve the error "The security token included in the request is invalid" when running aws iam upload-server-certificate?

I cd into the directory where all the pem/key files are and run the following: aws iam upload-server-certificate --server-certificate-name certificate_name --certificate-body file://...
64 votes
12 answers
209k views

Bash with AWS CLI - unable to locate credentials

I have a shell script which is supposed to download some files from S3 and mount an ebs drive. However, I always end up with "Unable to locate credentials". I have specified my credentials with the ...
0 votes
1 answer
54 views

AWS sts error: The security token included in the request is expired

Why when I run the command... aws --profile default sts get-caller-identity it works and I get the expected result back. But when I attempt to run... aws sts get-caller-identity It fails with the ...
0 votes
0 answers
29 views

How can I get the aws profile id from the aws configure sso command

As part of a bash script to automate connecting to our postgres instance I need to configure the aws cli tool and set the AWS_PROFILE variable. The command outputs this in the final line of its output....
0 votes
0 answers
72 views

AWS Java SDK error: Unable to load credentials from any of the providers

I'm writing a test to see if I can access credentials stored in AWS secrets manager, in Java on my local machine. I've tested that I have an active session on my machine by running the aws sts get-...
0 votes
2 answers
166 views

Delete ALL Rest Apis in all regions, possible?

Is there a way to delete all Rest APIs created in different regions, via AWS CLI? I've created many of them, and it takes a long time to delete them manually via the GUI.
2 votes
3 answers
7k views

AWS CLI has my credentials but I don't have a credential file

I can run the AWS CLI aws configure command and it lists my credentials. I even have a named profile I use. However, my system does not have Users\{profile}\.aws\credentials file. Where could my ...
3 votes
3 answers
730 views

Avoid AWS CLI to wait on --More-- prompt

I am automating app deployments by making use of AWS CLI commands. However, the problem is that when the AWS command is fired and is completed, the next command in the script is not executed. This is ...
111 votes
6 answers
156k views

How do I set the name of the default profile in AWS CLI?

When I give the command aws config list, I get the following output for the default profile: Name Value Type Location ---- ----- ...
8 votes
4 answers
6k views

Error: The provided credentials do not have permission to create the service-linked role for EC2 Spot Instances

I'm running into an error when creating a spot fleet request through cloudformation. The request is created but I'm getting the error mentioned in the title when the fleet attempts to request an ...
0 votes
1 answer
36 views

Add Cognito to Load Balancer Listener via AWS CLI

I would like make use of AWS CLI to create a listener for my application load balancer. aws elbv2 create-listener \ --load-balancer-arn $ALB_ARN \ --protocol HTTPS \ --port 443 \ --default-...
0 votes
1 answer
16 views

Cognito user pool creation with MFA (TOTP) required via CLI

I am trying to set up a user pool for AWS Cognito via the AWS CLI. I would like to only allow authentication via MFA (via TOTP, not via SMS). However, if I set --mfa-configuration ON, I receive the ...
9 votes
2 answers
30k views

"The AWS Access Key Id you provided does not exist in our records." when trying to use AWS CLI

I'm trying to access my S3 Bucket through the cli. I have everything setup up such as having a credentials file where I'm doing this cli work, making sure my environment variables for $...
1 vote
3 answers
4k views

Jenkins can't use aws-cli key. Unable to locate credentials for AWS CLI

In Jenkins Job I'm trying to login to WAS CLI with a script: eval $(echo $(aws ecr get-login --no-include-email --region=eu-north-1)) When I do it manually all works fine. $(echo $(aws ecr get-login -...
174 votes
19 answers
159k views

How to upgrade AWS CLI to the latest version?

I recently noticed that I am running an old version of AWS CLI that is lacking some functionality I need: $aws --version aws-cli/1.2.9 Python/3.4.3 Linux/3.13.0-85-generic How can I upgrade to the ...

1
2 3 4 5
90