Step 1: Configuring basic service parameters
Amazon ECS has provided a new console experience for creating a service. For more information, see Creating a service using the new console.
All services require some basic configuration parameters that define the service, such as the task definition to use, which cluster the service should run on, how many tasks should be placed for the service, and so on. This is called the service definition. For more information about the parameters defined in a service definition, see Service definition parameters.
This procedure covers creating a service with the basic service definition parameters that are required. After you have configured these parameters, you can create your service or move on to the procedures for optional service definition configuration, such as configuring your service to use a load balancer.
If your cluster is configured with a default capacity provider strategy, you will only be able to create a service using the default capacity provider strategy when using the console. Likewise, if no default capacity provider is defined, you will only be able to use a launch type when creating a service using the console. It is not currently possible to have a mixed strategy using both capacity providers and launch types in the console.
To configure the basic service definition parameters
-
Open the Amazon ECS console at https://console.aws.amazon.com/ecs/
. -
On the navigation bar, select the Region that your cluster is in.
-
In the navigation pane, choose Task Definitions and select the task definition from which to create your service.
-
On the Task Definition name page, select the revision of the task definition from which to create your service.
-
Review the task definition, and choose Actions, Create Service.
-
On the Configure service page, complete the following steps.
-
Choose either a capacity provider strategy or a launch type.
-
To use a Capacity provider strategy, choose Switch to capacity provider strategy and then choose whether your service should use the default capacity provider strategy defined for the cluster or a custom capacity provider strategy. A capacity provider must already be associated with the cluster in order to be used in a custom capacity provider strategy. For more information, see Amazon ECS capacity providers.
-
To use a Launch type, choose Switch to launch type and select FARGATE, EC2, or EXTERNAL. For more information about launch types, see Amazon ECS launch types.
-
-
For Platform version, if you chose a Fargate capacity provider or the Fargate launch type, then select the platform version to use.
Note When the LATEST platform version is selected, the
1.4.0platform version is used. -
Cluster: Select the cluster in which to create your service.
-
Service name: Type a unique name for your service.
-
Service type: Select a scheduling strategy for your service. For more information, see Service scheduler concepts.
-
Number of tasks: If you chose the
REPLICAservice type, type the number of tasks to launch and maintain on your cluster.Note If your launch type is
EC2, and your task definition uses static host port mappings on your container instances, then you need at least one container instance with the specified port available in your cluster for each task in your service. This restriction does not apply if your task definition uses dynamic host port mappings with thebridgenetwork mode. For more information, see portMappings. -
If you are using the Rolling update deployment type, fill out the following deployment configuration parameters. For more information on how these parameters are used, see Deployment configuration.
-
Minimum healthy percent: Specify a lower limit on the number of your service's tasks that must remain in the
RUNNINGstate during a deployment, as a percentage of the service's desired number of tasks (rounded up to the nearest integer). -
Maximum percent: Specify an upper limit on the number of your service's tasks that are allowed in the
RUNNINGorPENDINGstate during a deployment, as a percentage of the service's desired number of tasks (rounded down to the nearest integer).
-
-
-
For Deployment circuit breaker, choose the deployment circuit breaker logic. For more information, see Using the deployment circuit breaker.
-
On the Deployments page, complete the following steps.
-
For Deployment type, choose whether your service should use a rolling update deployment or a blue/green deployment using AWS CodeDeploy. For more information, see Amazon ECS Deployment types.
-
If you selected the blue/green deployment type, complete the following steps:
-
For Deployment configuration choose the deployment configuration to use for the service. This determines how traffic is shifted when your task set is updated. For more information, see Blue/Green deployment with CodeDeploy
-
For Service role for CodeDeploy choose the IAM service role for AWS CodeDeploy. For more information, see Amazon ECS CodeDeploy IAM Role
-
-
-
(Optional) If you selected the EC2 launch type and the
REPLICAservice type, for Task Placement, you can specify how tasks are placed using task placement strategies and constraints. Choose from the following options. For more information, see Amazon ECS task placement.-
AZ Balanced Spread - Distribute tasks across Availability Zones and across container instances in the Availability Zone.
-
AZ Balanced BinPack - Distribute tasks across Availability Zones and across container instances with the least available memory.
-
BinPack - Distribute tasks based on the least available amount of CPU or memory.
-
One Task Per Host - Place, at most, one task from the service on each container instance.
-
Custom - Define your own task placement strategy. See Amazon ECS task placement for examples.
-
-
In the Task tagging configuration section, complete the following steps:
-
Select Enable ECS managed tags if you want Amazon ECS to automatically tag the tasks in the service with the Amazon ECS managed tags. For more information, see Tagging Your Amazon ECS Resources.
-
For Propagate tags from, select one of the following:
-
Do not propagate – This option will not propagate any tags to the tasks in the service.
-
Service – This option will propagate the tags specified on your service to each of the tasks in the service.
-
Task Definitions – This option will propagate the tags specified in the task definition of a task to the tasks in the service.
Note If you specify a tag with the same
keyin the Tags section, it will override the tag propagated from either the service or the task definition. -
-
-
In the Tags section, specify the key and value for each tag to associate with the task. For more information, see Tagging Your Amazon ECS Resources.
-
Choose Next step and navigate to Step 2: Configure a network.

