You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* remove elasticsearch support
* remove aws connection support
* update docs on fine-grained access control
* add USGS Astrogeology api
* remove aws-os-connection dependency
As of 2.0.0, only OpenSearch is supported and only using fine-grained access control.
135
+
It is recommended to follow the migration path to upgrade to fine-grained access control
136
+
first and then upgrade to stac-server 2.x.
137
+
127
138
### 0.4.x -> 0.5.x
128
139
129
140
#### Elasticsearch to OpenSearch Migration
@@ -419,29 +430,44 @@ There are some settings that should be reviewed and updated as needeed in the se
419
430
| PRE_HOOK | The name of a Lambda function to be called as the pre-hook. | none |
420
431
| POST_HOOK | The name of a Lambda function to be called as the post-hook. | none |
421
432
| ES_COMPAT_MODE | Enable Elasticsearch 7.10 compatibility mdoe within the server. | false |
422
-
| OPENSEARCH_USERNAME | The username to authenticate to OpenSearch with if fine-grained access control is enabled. | |
423
-
| OPENSEARCH_PASSWORD | The password to authenticate to OpenSearch with if fine-grained access control is enabled. | |
424
-
| OPENSEARCH_CREDENTIALS_SECRET_ID | The AWS Secrets Manager secret to retrieve the username and password from, to authenticate to OpenSearch with if fine-grained access control is enabled. | |
433
+
| OPENSEARCH_CREDENTIALS_SECRET_ID | The AWS Secrets Manager secret use for the username and password to authenticate to OpenSearch. | |
434
+
| OPENSEARCH_USERNAME | The username to authenticate to OpenSearch when AWS Secrets Manager is not used. | |
435
+
| OPENSEARCH_PASSWORD | The password to authenticate to OpenSearch when AWS Secrets Manager is not used. | |
425
436
| COLLECTION_TO_INDEX_MAPPINGS | A JSON object representing collection id to index name mappings if they do not have the same names. | |
426
437
427
438
| ITEMS_INDICIES_NUM_OF_SHARDS | Configure the number of shards for the indices that contain Items. | none |
428
439
| ITEMS_INDICIES_NUM_OF_REPLICAS | Configure the number of replicas for the indices that contain Items. | none |
429
440
441
+
The preferred mechanism for populating the OpenSearch credentials to stac-server is to
442
+
create a secret in AWS Secret Manager that contains the username and password.
443
+
The recommended name for this Secret corresponds
444
+
to the stac-server deployment as `{stage}/{service}/opensearch`, e.g.,
445
+
`dev/my-stac-server/opensearch`.
446
+
447
+
The Secret type should be "Other type of secret" and
448
+
have two keys, `username` and `password`, with the appropriate
449
+
values, e.g., `stac_server` and whatever you set as the password when creating that user.
450
+
430
451
After reviewing the settings, build and deploy:
431
452
432
453
```shell
433
454
npm install
434
455
npm run build
435
-
npm run deploy
456
+
OPENSEARCH_MASTER_USER_PASSWORD='some-password' npm run deploy
436
457
```
437
458
438
459
This will use the file `serverless.yml` and create a CloudFormation stack in the
439
460
`us-west-2`region called `stac-server-dev`.
461
+
462
+
After the initial deployment, the `MasterUserOptions` option in the serverless.yml file
463
+
can be commented out so that OPENSEARCH_MASTER_USER_PASSWORD does not need to be passed
464
+
at every deployment.
465
+
440
466
To change the region or the stage name (from `dev`) provide arguments to the deploy command
441
467
(note the additional `--` in the command, required by `npm` to provide arguments):
442
468
443
469
```shell
444
-
npm run deploy -- --stage mystage --region eu-central-1
470
+
OPENSEARCH_MASTER_USER_PASSWORD='some-password' npm run deploy -- --stage mystage --region eu-central-1
445
471
```
446
472
447
473
Multiple deployments can be managed with multiple serverless config files and specified
@@ -461,40 +487,19 @@ It is recommended to disable the automatic index creation. This prevents the sit
461
487
a group of Items are bulk indexed before the Collection in which they are contained has
462
488
been created, and an OpenSearch index is created without the appropriate mappings.
463
489
464
-
This requires installing the requests, requests_aws4auth, and boto3 python libraries, for example, with:
465
-
466
-
```shell
467
-
pip install requests requests_aws4auth boto3
468
-
```
469
-
470
-
Then putting this code into a python file an running it:
471
-
472
-
```python
473
-
from requests_aws4auth import AWS4Auth
474
-
import boto3
475
-
import requests
490
+
This can either be done by calling the `/_cluster/settings` endpoint directly with the
The AccessPolicies Statement will restrict the OpenSearch instance to only being accessible
562
538
within AWS. This requires the user creation steps below be either executed from or proxied
563
539
through an EC2 instance, or that the Access Policy be changed temporarily through the
564
540
console in the domain's Security configuration to be "Only use fine-grained access control".
565
541
566
-
Deploying now requires the `OPENSEARCH_MASTER_USER_PASSWORD` local shell environment
567
-
variable be set so it can be set for the OpenSearch "master" user, e.g.:
568
-
569
-
```shell
570
-
OPENSEARCH_MASTER_USER_PASSWORD='some-password' npm run deploy
571
-
```
572
-
573
-
Redeploy the stack, and this will be updated without re-creating the cluster.
574
-
575
542
The next step is to create the OpenSearch user and role to use for stac-server. This can
576
543
either be done through the OpenSearch API or Dashboard.
577
544
@@ -927,7 +894,6 @@ Messages published to the post-ingest SNS topic include the following atributes
927
894
| ingestStatus | String | `successful` or `failed` |
928
895
| collection | String | |
929
896
930
-
931
897
### Ingesting large items
932
898
933
899
There is a 256 KB limit on the size of SQS messages. Larger items can by publishing a message to the `stac-server-<stage>-ingest` SNS topic in with the format:
@@ -957,14 +923,14 @@ across the clusters, treating a remote cluster as if it were another group of no
957
923
cluster, or configure indicies to be replicated (continuously copied) from from one
958
924
cluster to another.
959
925
960
-
Configuring either cross-cluster behavior requires [enabling fine-grained access control](#enable-opensearch-fine-grained-access-control).
926
+
Configuring either cross-cluster behavior requires fine-grained access control.
961
927
962
928
### Cross-cluster Search
963
929
964
930
The AWS documentation for cross-cluster search can be found
0 commit comments