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
Elasticsearch premium versions (>=7.17) aren't available on {{< vendor/name >}} yet. Deprecated versions are free to use or use [OpenSearch](/add-services/opensearch.md).
22
+
{{% /note %}}
21
23
22
24
## Deprecated versions
23
25
@@ -26,9 +28,6 @@ but they're at their end of life and are no longer receiving security updates fr
If you’re using a [premium version](/add-services/elasticsearch.md#supported-versions), use the ``elasticsearch-enterprise`` type instead.
131
-
132
126
Note that changing the name of the service replaces it with a brand new service and all existing data is lost. Back up your data before changing the service.
To define the service, use the ``mongodb-enterprise`` type:
124
-
125
-
```yaml {configFile="app"}
126
-
services:
127
-
# The name of the service container. Must be unique within a project.
128
-
<SERVICE_NAME>:
129
-
type: mongodb-enterprise:<VERSION>
130
-
```
131
-
132
-
Note that changing the name of the service replaces it with a brand new service and all existing data is lost. Back up your data before changing the service.
133
-
134
-
#### 2. Define the relationship
135
-
136
-
To define the relationship, use the following configuration:
137
-
{{< codetabs >}}
138
-
139
-
+++
140
-
title=Using default endpoints
141
-
+++
142
-
143
-
```yaml {configFile="app"}
144
-
applications:
145
-
# The name of the app container. Must be unique within a project.
146
-
<APP_NAME>:
147
-
# Relationships enable access from this app to a given service.
148
-
# The example below shows simplified configuration leveraging a default service
149
-
# (identified from the relationship name) and a default endpoint.
150
-
# See the Application reference for all options for defining relationships and endpoints.
151
-
relationships:
152
-
<SERVICE_NAME>:
153
-
```
154
-
155
-
You can define `<SERVICE_NAME>` as you like, so long as it's unique between all defined services
156
-
and matches in both the application and services configuration.
157
-
158
-
The example above leverages [default endpoint](/create-apps/app-reference/single-runtime-image#relationships) configuration for relationships.
159
-
That is, it uses default endpoints behind-the-scenes, providing a [relationship](/create-apps/app-reference/single-runtime-image#relationships)
160
-
(the network address a service is accessible from) that is identical to the _name_ of that service.
161
-
162
-
Depending on your needs, instead of default endpoint configuration,
163
-
you can use [explicit endpoint configuration](/create-apps/app-reference/single-runtime-image#relationships).
164
-
165
-
With the above definition, the application container (``<APP_NAME>``) now has [access to the service](#use-in-app) via the relationship ``<SERVICE_NAME>`` and its corresponding [service environment variables](/development/variables/_index.md#service-environment-variables).
166
-
167
-
<--->
168
-
169
-
+++
170
-
title=Using explicit endpoints
171
-
+++
172
-
173
-
```yaml {configFile="apps"}
174
-
applications:
175
-
# The name of the app container. Must be unique within a project.
176
-
<APP_NAME>:
177
-
# Relationships enable access from this app to a given service.
178
-
# The example below shows configuration with an explicitly set service name and endpoint.
179
-
# See the Application reference for all options for defining relationships and endpoints.
180
-
relationships:
181
-
<RELATIONSHIP_NAME>:
182
-
service: <SERVICE_NAME>
183
-
endpoint: mongodb
184
-
```
185
-
186
-
You can define ``<SERVICE_NAME>`` and ``<RELATIONSHIP_NAME>`` as you like, so long as it's unique between all defined services and relationships
187
-
and matches in both the application and services configuration.
188
-
189
-
The example above leverages [explicit endpoint](/create-apps/app-reference/single-runtime-image#relationships) configuration for relationships.
190
-
191
-
Depending on your needs, instead of explicit endpoint configuration,
192
-
you can use [default endpoint configuration](/create-apps/app-reference/single-runtime-image#relationships).
193
-
194
-
With the above definition, the application container now has [access to the service](#use-in-app) via the relationship `<RELATIONSHIP_NAME>` and its corresponding [service environment variables](/development/variables/_index.md#service-environment-variables).
195
-
196
-
{{< /codetabs >}}
197
-
198
-
For PHP, enable the [extension](/languages/php/extensions.md) for the service:
199
-
200
-
{{< codetabs >}}
201
-
202
-
+++
203
-
title=Using default endpoints
204
-
+++
205
-
206
-
```yaml {configFile="apps"}
207
-
applications:
208
-
# The name of the app container. Must be unique within a project.
209
-
<APP_NAME>:
210
-
# PHP extensions.
211
-
runtime:
212
-
extensions:
213
-
- mongodb
214
-
# Relationships enable access from this app to a given service.
215
-
# The example below shows simplified configuration leveraging a default service
216
-
# (identified from the relationship name) and a default endpoint.
217
-
# See the Application reference for all options for defining relationships and endpoints.
218
-
relationships:
219
-
<SERVICE_NAME>:
220
-
```
221
-
222
-
<--->
223
-
224
-
+++
225
-
title=Using explicit endpoints
226
-
+++
227
-
228
-
```yaml {configFile="apps"}
229
-
applications:
230
-
# The name of the app container. Must be unique within a project.
231
-
<APP_NAME>:
232
-
# PHP extensions.
233
-
runtime:
234
-
extensions:
235
-
- mongodb
236
-
# Relationships enable access from this app to a given service.
237
-
# The example below shows configuration with an explicitly set service name and endpoint.
238
-
# See the Application reference for all options for defining relationships and endpoints.
239
-
relationships:
240
-
<RELATIONSHIP_NAME>:
241
-
service: <SERVICE_NAME>
242
-
endpoint: mongodb
243
-
```
244
-
245
-
{{< /codetabs >}}
246
-
247
-
#### Example configuration
248
-
249
-
{{< codetabs >}}
250
-
251
-
+++
252
-
title=Using default endpoints
253
-
+++
254
-
255
-
```yaml {configFile="apps"}
256
-
applications:
257
-
# The name of the app container. Must be unique within a project.
258
-
myapp:
259
-
# PHP extensions.
260
-
runtime:
261
-
extensions:
262
-
- mongodb
263
-
# Relationships enable access from this app to a given service.
264
-
# The example below shows simplified configuration leveraging a default service
265
-
# (identified from the relationship name) and a default endpoint.
266
-
# See the Application reference for all options for defining relationships and endpoints.
267
-
relationships:
268
-
mongodb-enterprise:
269
-
services:
270
-
# The name of the service container. Must be unique within a project.
0 commit comments