Skip to content

Commit 3c08816

Browse files
ndeloofusha-mandya
andauthored
Configure existing security-groups by external.name (docker#11379)
* Configure existing security-groups by `external.name` Signed-off-by: Nicolas De Loof <[email protected]> * Minor style updates Co-authored-by: Usha Mandya <[email protected]>
1 parent a6b5412 commit 3c08816

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

engine/context/ecs-integration.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ services:
252252

253253
The Docker ECS integration relies on [Amazon CloudFormation](https://docs.aws.amazon.com/cloudformation/){: target="_blank" class="_"} to manage the application deployment. To get more control on the created resources, you can use `docker compose convert` to generate a CloudFormation stack file from your Compose file. This allows you to inspect resources it defines, or customize the template for your needs, and then apply the template to AWS using the AWS CLI, or the AWS web console.
254254

255-
By default, the Docker ECS integration creates an ECS cluster for your Compose application, a Security Group per network in your Compose file on your AWS account’s default VPC, and a LoadBalancer to route traffic to your services. If your AWS account does not have [permissions](https://github.com/docker/ecs-plugin/blob/master/docs/requirements.md#permissions){: target="_blank" class="_"} to create such resources, or you want to manage these yourself, you can use the following custom Compose extensions:
255+
## Using existing AWS network resources
256+
257+
By default, the Docker ECS integration creates an ECS cluster for your Compose application, a Security Group per network in your Compose file on your AWS account’s default VPC, and a LoadBalancer to route traffic to your services. If your AWS account does not have [permissions](https://github.com/docker/ecs-plugin/blob/master/docs/requirements.md#permissions){: target="_blank" class="_"} to create such resources, or if you want to manage these yourself, you can use the following custom Compose extensions:
256258

257259
- Use `x-aws-cluster` as a top-level element in your Compose file to set the ARN
258260
of an ECS cluster when deploying a Compose application. Otherwise, a
@@ -264,10 +266,17 @@ of a VPC when deploying a Compose application.
264266
- Use `x-aws-loadbalancer` as a top-level element in your Compose file to set
265267
the ARN of an existing LoadBalancer.
266268

267-
- Use `x-aws-securitygroup` inside a network definition in your Compose file to
268-
set the ARN of an existing SecurityGroup used to implement network connectivity
269-
between services.
269+
- Use `external: true` inside a network definition in your Compose file for
270+
Docker ECS integration to _not_ create a Security Group, and set `name` with the
271+
ID of an existing SecurityGroup you want to use for network connectivity between
272+
services:
270273

274+
```yaml
275+
networks:
276+
back_tier:
277+
external: true
278+
name: "sg-1234acbd"
279+
```
271280

272281
## Local simulation
273282

0 commit comments

Comments
 (0)