Let's say I need to run a command on the terminal:
elasticdump \
--s3AccessKeyId "${$access_key_id}" \
--s3SecretAccessKey "${access_key_secret}" \
--input=localhost:123/my_index/ \
--output "s3://${bucket_name}/${file_name}.json"
In which, access_key_id
and access_key_secret
are the AWS credentials that need to be put in a double quote.
To get the credentials, I run a program, let's name it get-cred
:
get-cred --type=b info
get-cred --type=a info
When run individually in the command line, each line would print out the secret key and ID, without the double quotes.
How do I put them inside double quotes and use them in the elasticdump
command?
Update with more details:
The outputs of get-cred
are printed in a single line.
For example:
get-cred --type=a info
would print out
AKIAIOSFODNN7EXAMPLE
and
get-cred --type=b info
would print out:
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Example keys taken from here: https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html