79120125

Date: 2024-10-24 01:09:05
Score: 0.5
Natty:
Report link

Convert the multi-line JSON to single-line using | jq -c .

ACCESS_POLICY_JSON=$(cat <<EOF | jq -c .
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowElasticsearchAccess",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:${AWS_REGION}:${AWS_ACCOUNT}:domain/es-dev-tenant/*"
    }
  ]
}
EOF
)
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Nigel Sheridan-Smith