Skip to content

Commit 63bf55a

Browse files
committed
fix #304, adds support for aws iam
1 parent 1a7b783 commit 63bf55a

File tree

12 files changed

+596
-566
lines changed

12 files changed

+596
-566
lines changed

.yarn/install-state.gz

31.1 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.8.0
4+
5+
* adds support for connecting to elasticsearch with aws iam credentials, fixes [#304](https://github.com/cars10/elasticvue/pull/304)
6+
, thanks @ChrisMcKee
7+
* automatically import predefined clusters when using docker, fixes [#254](https://github.com/cars10/elasticvue/issues/254)
8+
39
## 1.7.0
410

511
* adds copy button to CORS settings

docker/Dockerfile_tauri

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ RUN apt-get update \
5959
libxdo-dev \
6060
libayatana-appindicator3-dev \
6161
librsvg2-dev \
62+
xdg-utils \
6263
&& apt-get install -y /tmp/ubuntu-packages/*.deb \
6364
&& rm -rf /tmp/ubuntu-packages \
6465
&& apt-get clean \

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@tauri-apps/plugin-opener": "^2.3.0",
3232
"@tauri-apps/plugin-process": "^2.2.2",
3333
"@tauri-apps/plugin-updater": "^2.8.1",
34+
"aws4fetch": "^1.0.20",
3435
"codemirror": "^6.0.2",
3536
"idb": "^8.0.3",
3637
"json-bigint": "^1.0.0",

scripts/localstack/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Localstack Setup for ES
2+
3+
* Start localstack container by running `docker compose up` in this folder
4+
* During creation the `init-iam-es.sh` script will run creating the initial domain and user
5+
* Once it's finished running get the credentials by calling docker exec localstack cat /tmp/es_user_credentials.json
6+
* In elasticvue
7+
* Add new cluster
8+
* Set the Access Key ID and Secret Key to the ones from the `es_user_credentials.json`
9+
* Set the region to us-east-1
10+
* Set the URI to `http://127.0.0.1:4566/es/us-east-1/my-domain`
11+
* Click Connect

scripts/localstack/compose.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
services:
2+
localstack:
3+
image: localstack/localstack:latest
4+
container_name: localstack
5+
ports:
6+
- "4566:4566" # LocalStack edge
7+
- "4510-4559:4510-4559" # external-service port range
8+
environment:
9+
- SERVICES=iam,sts,es
10+
- DEFAULT_REGION=us-east-1
11+
- DATA_DIR=/var/lib/localstack
12+
- ES_ENDPOINT_STRATEGY=path
13+
- OPENSEARCH_ENDPOINT_STRATEGY=path
14+
- DEBUG=1
15+
- EXTERNAL_SERVICE_PORTS_START=4510 # inclusive
16+
- EXTERNAL_SERVICE_PORTS_END=4559 # exclusive
17+
- EXTRA_CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:5174,http://localhost:9200
18+
- EXTRA_CORS_ALLOWED_HEADERS=x-api-key
19+
volumes:
20+
- localstack_data:/var/lib/localstack
21+
- ./init-iam-es.sh:/etc/localstack/init/ready.d/init-iam-es.sh
22+
- /var/run/docker.sock:/var/run/docker.sock
23+
24+
volumes:
25+
localstack_data:

scripts/localstack/init-iam-es.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
awslocal es create-elasticsearch-domain --domain-name my-domain
5+
6+
awslocal iam create-user --user-name es_user
7+
8+
awslocal iam put-user-policy \
9+
--user-name es_user \
10+
--policy-name es_full_access \
11+
--policy-document '{
12+
"Version": "2012-10-17",
13+
"Statement": [
14+
{
15+
"Effect": "Allow",
16+
"Action": "es:*",
17+
"Resource": "*"
18+
}
19+
]
20+
}'
21+
22+
awslocal iam create-access-key --user-name es_user \
23+
> /tmp/es_user_credentials.json
24+
25+
echo "Elasticsearch domain 'my-domain' created."
26+
echo "IAM user 'es_user' created with ES-full-access policy."
27+
echo "Credentials written to /tmp/es_user_credentials.json"

0 commit comments

Comments
 (0)