networks

In docker-compose one can define diffent subnets which would use different properties, as documented here

This allows you to logically bind services on different networks etc, very useful in many scenarios.

In ECS ComposeX, we have added support to allow you to define these networks and logically associate them with AWS VPC Subnets.

Refer to x-vpc for a full review of ECS ComposeX syntax definition for subnets mappings.

You can now define extra subnet groups based on different tags and map them to your services for override when using Lookup or Use

Extra subnets definition
x-vpc:
  Lookup:
    VpcId: {}
      AppSubnets: {}
      StorageSubnets: {}
      PublicSubnets: {}
      Custom01:
        Tags: {}
define compose networks and associate to a Subnet category
networks:
  custom01:
    x-vpc: Custom01
Map a compose defined network to a service
services:
  serviceA:
    networks:
      - custom01

  serviceB:
    networks:
      custom01: {}

Note

As per docker-compose config, the rendered networks in a service is a map / object. But it also can be a list.