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: src/content/docs/aws/services/ecs.md
+41-32Lines changed: 41 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
---
2
2
title: "Elastic Container Service (ECS)"
3
-
linkTitle: "Elastic Container Service (ECS)"
4
3
tags: ["Base"]
5
4
description: Get started with Elastic Container Service (ECS) on LocalStack
6
5
persistence: supported
@@ -13,7 +12,7 @@ It allows you to run, stop, and manage Docker containers on a cluster.
13
12
ECS eliminates the need for you to install, operate, and scale your own cluster management infrastructure.
14
13
15
14
LocalStack allows you to use the ECS APIs in your local environment to create & manage ECS clusters, tasks, and services.
16
-
The supported APIs are available on our [API coverage page]({{< ref "coverage_ecs" >}}), which provides information on the extent of ECS's integration with LocalStack.
15
+
The supported APIs are available on our [API coverage page](), which provides information on the extent of ECS's integration with LocalStack.
17
16
18
17
## Getting Started
19
18
@@ -24,16 +23,20 @@ We will demonstrate how to create an ECS service using the AWS CLI
24
23
25
24
### Create a cluster
26
25
27
-
{{< callout >}}
26
+
:::note
28
27
By default, the **ECS Fargate** launch type is assumed, i.e., the local Docker engine is used for deployment of applications, and there is no need to create and manage EC2 virtual machines to run the containers.
29
-
{{< /callout >}}
28
+
:::
30
29
31
30
ECS tasks and services run on a cluster.
32
31
Execute the following command to create an ECS cluster named `mycluster`:
Task definitions are immutable, and are identified by their `family` field, and calling `register-task-definition` again with the same `family` value creates a new _version_ of a task definition.
143
148
@@ -149,9 +154,13 @@ Finally we launch an ECS service using the task definition above.
149
154
This will create a number of containers in replica mode meaning they are distributed over the nodes of the cluster, or in the case of Fargate, over availability zones within the region of the cluster.
150
155
To create a service, execute the following command:
See our [CloudWatch Logs user guide]({{< ref "user-guide/aws/logs" >}}) for more details.
253
+
See our [CloudWatch Logs user guide](/aws/services/cloudwatchlogs) for more details.
243
254
244
255
## LocalStack ECS behavior
245
256
@@ -250,7 +261,7 @@ If your ECS containers depend on LocalStack services, your ECS task network shou
250
261
If you are running LocalStack through a `docker run` command, do not forget to enable the communication from the container to the Docker Engine API.
251
262
You can provide the access by adding the following option `-v /var/run/docker.sock:/var/run/docker.sock`.
252
263
253
-
For more information regarding the configuration of LocalStack, please check the [LocalStack configuration]({{< ref "configuration" >}}) section.
264
+
For more information regarding the configuration of LocalStack, please check the [LocalStack configuration](/aws/capabilities/config/configuration) section.
254
265
255
266
## Remote debugging
256
267
@@ -261,7 +272,7 @@ Or if you are working with a single container, you can set `ECS_DOCKER_FLAGS="-p
261
272
## Mounting local directories for ECS tasks
262
273
263
274
In some cases, it can be useful to mount code from the host filesystem into the ECS container.
264
-
For example, to enable a quick debugging loop where you can test changes without having to build and redeploy the task's Docker image each time - similar to the [Lambda Hot Reloading]({{< ref "hot-reloading" >}}) feature in LocalStack.
275
+
For example, to enable a quick debugging loop where you can test changes without having to build and redeploy the task's Docker image each time - similar to the [Lambda Hot Reloading](/aws/services/lambda#hot-reloading) feature in LocalStack.
265
276
266
277
In order to leverage code mounting, we can use the ECS bind mounts feature, which is covered in the [AWS Bind mounts documentation](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bind-mounts.html).
267
278
@@ -336,14 +347,14 @@ services:
336
347
- ~/.docker/config.json:/config.json:ro
337
348
```
338
349
339
-
Alternatively, you can download the image from the private registry before using it or employ an [Initialization Hook]({{< ref "/references/init-hooks" >}}) to install the Docker client and use these credentials to download the image.
350
+
Alternatively, you can download the image from the private registry before using it or employ an [Initialization Hook](/aws/capabilities/config/initalization-hooks) to install the Docker client and use these credentials to download the image.
340
351
341
352
## Firelens for ECS Tasks
342
353
343
-
{{< callout >}}
354
+
:::note
344
355
Firelens emulation is currently available as part of the **LocalStack Enterprise** plan.
345
356
If you'd like to try it out, please [contact us](https://www.localstack.cloud/demo) to request access.
346
-
{{< /callout >}}
357
+
:::
347
358
348
359
LocalStack's ECS emulation supports custom log routing via FireLens.
349
360
FireLens allows the ECS service to manage the configuration of the logging driver of application containers, and to create the proper configuration for the `fluentbit`/`fluentd` logging layer.
@@ -356,9 +367,7 @@ Additionally, you cannot use ECS on Kubernetes with FireLens.
356
367
The LocalStack Web Application provides a Resource Browser for managing ECS clusters & task definitions.
357
368
You can access the Resource Browser by opening the LocalStack Web Application in your browser, navigating to the **Resource Browser** section, and then clicking on **ECS** under the **Compute** section.
0 commit comments