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
Copy file name to clipboardExpand all lines: README.md
+21-20Lines changed: 21 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,7 @@ are three options if you have an existing deployment that uses Elasticsearch:
142
142
6. Deploy the 0.5.x stac-server code with the updated serverless.yml file
143
143
7. Through the AWS Console, upgrade the OpenSearch Service domain from Elasticsearch 7.10
144
144
to OpenSearch 1.3, retaining the compatibilty mode enabled configuration.
145
-
8. Upgrade the OpenSearch 1.3 domain to OpenSearch 2.3.
145
+
8. Upgrade the OpenSearch 1.3 domain to OpenSearch 2.5.
146
146
9. Re-deploy the stack without the ES_COMPAT_MODE environment variable set.
147
147
3. (Preferred) Disconnect the Elasticsearch domain from the stac-server CF Stack, deploy a new stac-server CF Stack,
148
148
upgrade the Elasticsearch domain to OpenSearch, and connect the domain to the new CF Stack.
@@ -155,7 +155,7 @@ renamed `OPENSEARCH_HOST`.
155
155
156
156
**Note! The migration must be done carefully to avoid losing the database!**
157
157
158
-
The major part of this migration is the use of OpenSearch 2.3 instead of Elasticsearch
158
+
The major part of this migration is the use of OpenSearch 2.5 instead of Elasticsearch
159
159
7.10. Confusingly, both of these are options in the AWS OpenSearch Service, but the Elasticsearch option
160
160
is no longer being updated by AWS in favor of OpenSearch.
161
161
@@ -166,42 +166,44 @@ can't "migrate" between these resource types. So, the approach is to upgrade the
166
166
to OpenSearch in compatibility mode, then clone the CloudFormation Stack, and import
167
167
the OpenSearch domain into it.
168
168
169
-
With the 0.4.x codebase, change the serverless.yml file to add to the AWS::Elasticsearch::Domain definition at the same
170
-
level as the `Type` attribute these two attributes:
169
+
1. With the 0.4.x codebase, change the serverless.yml file to add `DeletionPolicy: Retain` and `UpdateReplacePolicy: Retain` to the `AWS::Elasticsearch::Domain` definition at the same level as the `Type` and deploy. See instructions for deploying [here](https://github.com/stac-utils/stac-server/blob/main/README.md#deployment).
171
170
172
171
```yaml
173
-
DeletionPolicy: Retain
174
-
UpdateReplacePolicy: Retain
172
+
Type: AWS::Elasticsearch::Domain
173
+
DeletionPolicy: Retain
174
+
UpdateReplacePolicy: Retain
175
+
Properties:
176
+
. . .
175
177
```
176
178
177
-
and deploy.
178
-
179
-
The existing Elasticsearch domain must be manually migrated to OpenSearch. Prior to
179
+
2. The existing Elasticsearch domain must be manually migrated to OpenSearch. Prior to
180
180
re-deploying the stack, use the AWS Console to manually upgrade the
181
181
Elasticsearch domain (`Actions->Upgrade`) to OpenSearch 1.3. Select "Enable
182
182
compatibility mode" to support the existing stac-server 0.4.x code using the Elasticsearch
183
183
JavaScript client library (@elastic/elasticsearch version 7.9.0). After this upgrade to
184
-
OpenSearch 1.3, then upgrade the domain to OpenSearch 2.3.
184
+
OpenSearch 1.3, then upgrade the domain to OpenSearch 2.5.
185
185
186
-
Create a clone of the stac-server 0.5.x code. Copy and update the serverless.yml file used for the 0.4.0 deployment with these changes:
186
+
3. Create a clone of the stac-server 0.5.x code. Copy and update the serverless.yml file used for the 0.4.0 deployment with these changes:
187
187
188
188
- `ElasticSearchInstance`should be renamed to `OpenSearchInstance`
189
189
- The `Type` of this resource should be changed from `AWS::Elasticsearch::Domain` to
190
190
`AWS::OpenSearchService::Domain`
191
191
- `ElasticsearchClusterConfig`is now `ClusterConfig`
192
192
- `InstanceType`values have changed, e.g., t3.small.elasticsearch is now t3.small.search
193
-
- `ElasticsearchVersion`is replaced with `EngineVersion` and set to `OpenSearch_2.3`
193
+
- `ElasticsearchVersion`is replaced with `EngineVersion` and set to `OpenSearch_2.5`
194
194
- `EsEndpoint`should be renamed to `OpenSearchEndpoint` and the exported name suffixed
195
195
with `-os-endpoint` instead of `-es-endpoint`
196
196
- Environment variable `STAC_API_VERSION` should be removed to instead defer to the current default version
197
197
198
-
You can also compare it with the serverless.example.yml file. The `DomainName` value
198
+
-The `DomainName` value
199
199
**must** remain the same as it is for the current deployment so
200
200
the CloudFormation deployment will import the existing resource. Instead of a parameterized
201
201
value of `${self:service}-${self:provider.stage}` as in the example serverless.yml file,
202
202
it would have a hard-coded service name and `-es` suffix, e.g., `my-stac-server-${self:provider.stage}-es`.
203
203
204
-
Run `npm run package` to generate the CloudFormation templates in the `.serverless` directory.
204
+
- Note: these changes can be checked against the [serverless.example.yml](https://github.com/stac-utils/stac-server/blob/main/serverless.example.yml) file.
205
+
206
+
4. Run `npm run package` to generate the CloudFormation templates in the `.serverless` directory.
205
207
Extract from the file `.serverless/cloudformation-template-update-stack.json` a template
206
208
that only has the OpenSearchInstance resource in it. For example:
207
209
@@ -240,15 +242,14 @@ that only has the OpenSearchInstance resource in it. For example:
240
242
}
241
243
```
242
244
243
-
Within CloudFormation, choose `Create stack` and `With existing resources (import resources)`.
244
-
Upload the template that contains only the OpenSearch resource. Choose a new stack name for this similar to the old one, e.g., `my-stac-server-2` and update `service` name in the serverless.yml file with this name. When prompted for the name of the OpenSearch Domain, put in the name of the existing one, e.g., `my-stac-server-dev-es`.
245
+
5. Within CloudFormation, choose `Create stack` and `With existing resources (import resources)`.
246
+
Upload the template that contains only the OpenSearch resource. Choose a new stack name for this similar to the old one, e.g., `my-stac-server-2-{deploy-stage}` and update `service` name in the serverless.yml file with this name without the deploy stage e.g., `my-stac-server-2`. When prompted for the name of the OpenSearch Domain, put in the name of the existing one, e.g., `my-stac-server-dev-es`.
245
247
246
-
Deploy the new stack with `npm run deploy`. This should appear as an update to the CloudFormation stack that was just created manually, and should use the existing Open
247
-
Search domain.
248
+
6. Deploy the new stack with `npm run deploy -- --stage {deploy-stage}`. This should appear as an update to the CloudFormation stack that was just created manually, and should use the existing OpenSearch domain.
248
249
249
-
Switch the DNS entry for the domain name to the API Gateway endpoint for the new Stack.
250
+
7. Switch the DNS entry for the domain name to the API Gateway endpoint for the new Stack. See instructions [here](https://github.com/stac-utils/stac-server/blob/main/README.md#proxying-stac-server-through-cloudfront).
250
251
251
-
Double-check that the `DeletionPolicy: Retain` is set on the old Stack for the Elasticsearch/OpenSearch resource, and then delete the old Stack.
252
+
8. Double-check that the `DeletionPolicy: Retain` is set on the old Stack for the Elasticsearch/OpenSearch resource, and then delete the old Stack.
0 commit comments