From 6b19bf58f1823f0f99f40193c8a0e979fc7f86fb Mon Sep 17 00:00:00 2001 From: Jan 'Maub' Kapellen Date: Fri, 13 Dec 2024 12:57:25 +0100 Subject: [PATCH] remove unnecessary use of `tr` in access-opensearch.md I've noticed that tr is used to mitigate enclosing quotes (") from the result of `aws ssm get-parameter`. This might be destructive, because tr will remove *all* quotes, not only the enclosing ones and will not honor JSON escaped quotes. Check: `jq -cn '$ARGS.named' --arg test 'string_with"quotes"' | jq .test | tr -d '"'` vs `jq -cn '$ARGS.named' --arg test 'string_with"quotes"' | jq -r .test` --- website/docs/observability/opensearch/access-opensearch.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/observability/opensearch/access-opensearch.md b/website/docs/observability/opensearch/access-opensearch.md index 643e2ddfd..5a87fa8d3 100644 --- a/website/docs/observability/opensearch/access-opensearch.md +++ b/website/docs/observability/opensearch/access-opensearch.md @@ -10,13 +10,13 @@ Credentials for the OpenSearch domain have been saved in the AWS Systems Manager ```bash $ export OPENSEARCH_HOST=$(aws ssm get-parameter \ --name /eksworkshop/$EKS_CLUSTER_NAME/opensearch/host \ - --region $AWS_REGION | jq .Parameter.Value | tr -d '"') + --region $AWS_REGION | jq -r .Parameter.Value) $ export OPENSEARCH_USER=$(aws ssm get-parameter \ --name /eksworkshop/$EKS_CLUSTER_NAME/opensearch/user \ - --region $AWS_REGION --with-decryption | jq .Parameter.Value | tr -d '"') + --region $AWS_REGION --with-decryption | jq -r .Parameter.Value) $ export OPENSEARCH_PASSWORD=$(aws ssm get-parameter \ --name /eksworkshop/$EKS_CLUSTER_NAME/opensearch/password \ - --region $AWS_REGION --with-decryption | jq .Parameter.Value | tr -d '"') + --region $AWS_REGION --with-decryption | jq -r .Parameter.Value) $ export OPENSEARCH_DASHBOARD_FILE=~/environment/eks-workshop/modules/observability/opensearch/opensearch-dashboards.ndjson ```