I have the following Dockerfile
FROM public.ecr.aws/docker/library/python:3.7-slim-buster as base
WORKDIR /code
RUN apt-get update -y && \
pip install --upgrade pip && \
mkdir ~/.aws \
&& touch ~/.aws/credentials
RUN apt-get install -y nodejs npm awscli jq
Which is base from slim-buster.
I am trying to do a one command aws sts
command from this recommended AWS sts assume role in one command solution
However the the eval solution is coming up "blank" or the parenthesis is not escaped properly within a make command:
sts-qa:
eval $(aws sts assume-role --role-arn arn:aws:iam::1234556778:role/aws-role --role-session-name pebble | jq -r '.Credentials | "export AWS_ACCESS_KEY_ID=\(.AccessKeyId)\n export AWS_SECRET_ACCESS_KEY=\(.SecretAccessKey)\nexport AWS_SESSION_TOKEN=\(.SessionToken)\n"')
the error I get is:
root@b79fd0ebf8cf:/code# make sts-qa
eval \n export AWS_SECRET_ACCESS_KEY=\(.SecretAccessKey)\n export AWS_SESSION_TOKEN=\(.SessionToken)\n"')
/bin/sh: 1: Syntax error: ")" unexpected
I have tried:
- escaping all () from the command. i get the following error:
/bin/sh: 2: Syntax error: Unterminated quoted string
- assigning the content of the
$(...) into a variable. what I get back as an output is
eval
(the entire bash command is blank
I have ran out of ideas