Skip to content

Commit 8b9c3eb

Browse files
author
Phil Varner
authored
re-order create_indicies command, so it's after setting up auth (#651)
* re-order create_indicies command, so it's after setting up auth * polish * fix dupe line
1 parent 2658c16 commit 8b9c3eb

File tree

1 file changed

+35
-44
lines changed

1 file changed

+35
-44
lines changed

README.md

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
- [Deployment](#deployment)
3030
- [OpenSearch Configuration](#opensearch-configuration)
3131
- [Disable automatic index creation](#disable-automatic-index-creation-1)
32-
- [Create collection index](#create-collection-index)
3332
- [OpenSearch fine-grained access control](#opensearch-fine-grained-access-control)
3433
- [Option 1 - API method](#option-1---api-method)
3534
- [Option 2 - Dashboard method](#option-2---dashboard-method)
3635
- [Populating and accessing credentials](#populating-and-accessing-credentials)
37-
- [Proxying Stac-server through CloudFront](#proxying-stac-server-through-cloudfront)
36+
- [Create collection index](#create-collection-index)
37+
- [Proxying stac-server through CloudFront](#proxying-stac-server-through-cloudfront)
3838
- [Locking down transaction endpoints](#locking-down-transaction-endpoints)
3939
- [AWS WAF Rule Conflicts](#aws-waf-rule-conflicts)
4040
- [API Gateway Logging](#api-gateway-logging)
@@ -524,15 +524,8 @@ There are some settings that should be reviewed and updated as needeed in the se
524524
| ITEMS_INDICIES_NUM_OF_SHARDS | Configure the number of shards for the indices that contain Items. | none |
525525
| ITEMS_INDICIES_NUM_OF_REPLICAS | Configure the number of replicas for the indices that contain Items. | none |
526526

527-
The preferred mechanism for populating the OpenSearch credentials to stac-server is to
528-
create a secret in AWS Secret Manager that contains the username and password.
529-
The recommended name for this Secret corresponds
530-
to the stac-server deployment as `{stage}/{service}/opensearch`, e.g.,
531-
`dev/my-stac-server/opensearch`.
532-
533-
The Secret type should be "Other type of secret" and
534-
have two keys, `username` and `password`, with the appropriate
535-
values, e.g., `stac_server` and whatever you set as the password when creating that user.
527+
Additionally, the credential for OpenSearch must be configured, as decribed in the
528+
section [Populating and accessing credentials](#populating-and-accessing-credentials).
536529

537530
After reviewing the settings, build and deploy:
538531

@@ -573,44 +566,21 @@ It is recommended to disable the automatic index creation. This prevents the sit
573566
a group of Items are bulk indexed before the Collection in which they are contained has
574567
been created, and an OpenSearch index is created without the appropriate mappings.
575568

576-
This can either be done by calling the `/_cluster/settings` endpoint directly with the
577-
body:
569+
This can either be done by calling the `/_cluster/settings` endpoint directly:
578570

579-
```json
580-
{
581-
"persistent": {
582-
"action.auto_create_index": "false"
583-
}
584-
}
571+
```shell
572+
curl -X "PUT" "${HOST}/_cluster/settings" \
573+
-H 'Content-Type: application/json; charset=utf-8' \
574+
-u "admin:${OPENSEARCH_MASTER_USER_PASSWORD}" \
575+
-d '{"persistent": {"action.auto_create_index": "false"}}'
585576
```
586577

587578
or setting that configuration via the OpenSearch Dashboard.
588579

589-
#### Create collection index
590-
591-
The `collection` index must be created, which stores the metadata about each Collection.
592-
Invoke the `stac-server-<stage>-ingest` Lambda function with a payload of:
593-
594-
```json
595-
{
596-
"create_indices": true
597-
}
598-
```
599-
600-
This can be done with the [AWS CLI Version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
601-
602-
```shell
603-
aws lambda invoke \
604-
--function-name stac-server-dev-ingest \
605-
--cli-binary-format raw-in-base64-out \
606-
--payload '{ "create_indices": true }' \
607-
/dev/stdout
608-
```
609-
610580
#### OpenSearch fine-grained access control
611581

612-
As of version 2.0.0, stac-server only supports fine-grained access control to
613-
OpenSearch, and no longer supports "AWS Connection" mode.
582+
stac-server supports either fine-grained access control or AWS IAM authentication to
583+
OpenSearch. This section describes how to configure fine-grained access control.
614584

615585
**Warning**: Unfortunately, fine-grained access control cannot be enabled on an
616586
existing OpenSearch
@@ -760,9 +730,30 @@ OPENSEARCH_PASSWORD: xxxxxxxxxxx
760730
Setting these as environment variables can also be useful when running stac-server
761731
locally.
762732

763-
Stac-server is now ready to ingest data!
733+
stac-server is now ready to ingest data!
734+
735+
#### Create collection index
736+
737+
The `collection` index must be created, which stores the metadata about each Collection.
738+
Invoke the `stac-server-<stage>-ingest` Lambda function with a payload of:
739+
740+
```json
741+
{
742+
"create_indices": true
743+
}
744+
```
745+
746+
This can be done with the [AWS CLI Version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
747+
748+
```shell
749+
aws lambda invoke \
750+
--function-name stac-server-dev-ingest \
751+
--cli-binary-format raw-in-base64-out \
752+
--payload '{ "create_indices": true }' \
753+
/dev/stdout
754+
```
764755

765-
### Proxying Stac-server through CloudFront
756+
### Proxying stac-server through CloudFront
766757

767758
The API Gateway URL associated with the deployed stac-server instance may not be the URL that you ultimately wish to expose to your API users. AWS CloudFront can be used to proxy to a more human readable URL. In order to accomplish this:
768759

0 commit comments

Comments
 (0)