aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Can we have jq installed by default in aws v2 cli docker image?

Open melcloud opened this issue 5 years ago • 27 comments

Is your feature request related to a problem? Please describe. We commonly use jq to manipulate json as input or pick properties from aws command output in shell script. It will be really good if we can include jq in official docker image of v2 like what Azure cli does.

Describe the solution you'd like include jq program in aws v2 docker image

Describe alternatives you've considered We currently build our own custom image for v1 to have jq installed.

Additional context

melcloud avatar May 22 '20 00:05 melcloud

Hi @melcloud, thank you for submitting this feature request. I'm labeling it for additional team review to discuss how to manage Docker image dependency or utility requests, as there are other requests as well (e.g., #5106).

kdaily avatar Jun 15 '20 20:06 kdaily

Any update available on this?

pa-eps avatar Sep 17 '20 22:09 pa-eps

Any news? thx

scakkia avatar Oct 06 '20 11:10 scakkia

Any update on this?

mmorejon avatar Nov 16 '20 16:11 mmorejon

This would be fantastic

noah-procogia avatar Apr 23 '21 05:04 noah-procogia

Any update, it likely should not be that difficult.

RajasGujarathi avatar Jul 13 '21 12:07 RajasGujarathi

Hi @melcloud et al,

Indeed it would be straightforward to include jq, as it exists in the package repository used here (adding it asyum install -y less groff jq works). However, the usage of it is not straightforward, since the default entrypoint is set to aws - adding in a piped command here doesn't work nicely. So, you would have to be overriding the default entrypoint, either by making your own image, or supplying --entrypoint /bin/bash. Is that what you're currently doing or desire to be able to do?

This image is already large (346 MB).jq adds another MB, which is not much, but could add up as other requested dependencies are added (e.g., tar from #5106). A possibility for this is to keep the existing image as a 'slim' (relatively) image and provide a separate image with more features. What do you think?

kdaily avatar Jul 13 '21 21:07 kdaily

Yeap. Slim and a more feature rich would work.

melcloud avatar Jul 13 '21 22:07 melcloud

I needed to exchange current AWS credentials with Assume Role. jq is very helpful for scripts like that:

aws_credentials=$(aws sts assume-role --role-arn arn:aws:iam::1234567890:role/nameOfMyrole --role-session-name "RoleSession1")

export AWS_ACCESS_KEY_ID=$(echo $aws_credentials|jq '.Credentials.AccessKeyId'|tr -d '"')
export AWS_SECRET_ACCESS_KEY=$(echo $aws_credentials|jq '.Credentials.SecretAccessKey'|tr -d '"')
export AWS_SESSION_TOKEN=$(echo $aws_credentials|jq '.Credentials.SessionToken'|tr -d '"')

Adding yum update && yum install -y jq was enough to solve that, +1 to include it by default

jonnyzzz avatar Nov 13 '21 21:11 jonnyzzz

+1 This is essential for all aws commands out put are json based. & parsing is required.

niravpeak avatar Aug 25 '22 04:08 niravpeak

+1

vinilanzoni avatar Sep 09 '22 20:09 vinilanzoni

+1

nahum-landa avatar Nov 14 '22 09:11 nahum-landa

Since AWS CLI doesn't provide a nice clean way to easily patch image tag in an ECS task, jq is essential.

+1

andrei-dascalu avatar Nov 29 '22 10:11 andrei-dascalu

+1 JQ is absolutely needed for working with the AWS CLI beyond "trivial" examples.

mschroede1-chwy avatar Jan 19 '23 22:01 mschroede1-chwy

+1

antonio8101 avatar May 16 '23 15:05 antonio8101

+1

honarkhah avatar May 25 '23 08:05 honarkhah

+1

zupmeL avatar Aug 04 '23 14:08 zupmeL

Pls help us AWS

hbaackmann avatar Oct 18 '23 20:10 hbaackmann

Would be a dream to have jq included!

Johannes1509 avatar Nov 09 '23 15:11 Johannes1509

+1

serghey-rodin avatar Feb 15 '24 08:02 serghey-rodin

+1

mbauhardt avatar Feb 23 '24 11:02 mbauhardt

I'm very upset that it's still not included. We need to make awscli great again! by adding jq!

elkemper avatar Feb 23 '24 14:02 elkemper

As even some AWS blog articles mention and recommend using JQ for STS token exchange in the scripts, it does make sense to have jq in this image eks Pod Identity Article

advissor avatar Jun 03 '24 19:06 advissor

Viva Las Mexico

On Mon, Jun 3, 2024, 14:28 Vlad @.***> wrote:

As even some AWS blog articles mention and recommend using JQ for STS token exchange in the scripts, it does make sense to have jq in this image eks Pod Identity Article https://aws.amazon.com/blogs/containers/amazon-eks-pod-identity-a-new-way-for-applications-on-eks-to-obtain-iam-credentials/

— Reply to this email directly, view it on GitHub https://github.com/aws/aws-cli/issues/5227#issuecomment-2145958682, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4D26XJLDMNKJ5CHO3X46X3ZFS7VPAVCNFSM4NHK5UYKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJUGU4TKOBWHAZA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Me042589 avatar Jun 03 '24 20:06 Me042589

Thanks for your continued interest in this feature request. The team has discussed it again and is considering creating:

  1. A "slim" version of the AWS CLI v2 Docker image.
  2. A more feature-rich version that includes utilities like jq.

We haven't finalized this yet - we're still weighing the tradeoffs and looking at your feedback, as well as balancing the need to work on other issues.

Let us know if you have any other thoughts. We appreciate you engaging on this and will provide an update once we've made a decision.

tim-finnigan avatar Jun 04 '24 21:06 tim-finnigan