Skip to content

Commit

Permalink
remove unnecessary use of tr in access-opensearch.md
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
matschundbrei authored Dec 13, 2024
1 parent 93c2ca5 commit 6b19bf5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/docs/observability/opensearch/access-opensearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down

0 comments on commit 6b19bf5

Please # to comment.