How to run a service on AWS ECS with container overrides?

On AWS ECS you can run a task, or a service.

If you run a task with run_task(**kwargs), you have the option to override some task options, for example the container environment variables, this way you can configure the thing inside the container for example. That’s great.

  • Kubernetes 1.2alpha8 AWS Container Registry Integration
  • Error connecting to RDS Postgreql DB from inside Docker container
  • How install the Amazon ECS Container Agent in Debian? (ecs-init)
  • Configure sendmail inside a docker container
  • How do I configure “ulimits” for a Docker container running in AWS ECS?
  • Multiple dockers and multiple domains on elastic beanstalk
  • Now, I can’t find a way how to do the same with create_service(**kwargs). You can only specify a task, so the created container runs with configuration as specified in the task definition. No way to configure it.

    Is there a way how to modify task in a service, or this is not possible with the AWS ECS service?

  • Placeholder field for the ONBUILD section for child docker images to use
  • How do I get a Docker Gitlab CI runner to access Git on its parent host?
  • Docker LAMP Stack
  • How to run local aci images with kubernetes?
  • Is docker commit an atomic operation?
  • rg.apache.spark.SparkException: Invalid master URL: spark://tasks.501393358-spark-master:7077
  • One Solution collect form web for “How to run a service on AWS ECS with container overrides?”

    This is not possible. If you think how services work, they create X number of replicas of the task. All instances of the task have the same parameters, because the purpose is scaling out the task – they should do the same job. Often the traffic is load-balanced (part of service configuration), so it is undesirable that a user will get different response next time than the previous request due to ending up on a task which is configured differently. So bottom line is – that’s by design.

    Because parameters are shared, if you need to change a parameter, you create a new definition of the task, and then launch that as a service (or update an existing service).

    If you want the tasks to be aware of other tasks (and thus behave differently), for example to write data to different shards of a sharded store, you have to implement that in the task’s logic.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.