AWS Fundamentals Logo
AWS Fundamentals
AWS::ECS::Service

ECS Service

The AWS::ECS::Service resource creates an Amazon Elastic Container Service (Amazon ECS) service that runs and maintains the requested number of tasks and associated load balancers. The stack update fails if you change any properties that require replacement and at least one ECS Service Connect ServiceConnectConfiguration property is configured. This is because AWS CloudFormation creates the replacement service first, but each ServiceConnectService must have a name that is unique...

Properties

26 configurable properties. Click a row to see details.

Filter:
PropertyTypeFlags
AvailabilityZoneRebalancing
string
CapacityProviderStrategy
Array<CapacityProviderStrategyItem>
Cluster
string
Create-only
DeploymentConfiguration
DeploymentConfiguration
DeploymentController
DeploymentController
DesiredCount
integer
EnableECSManagedTags
boolean
EnableExecuteCommand
boolean
ForceNewDeployment
ForceNewDeployment
Write-only
HealthCheckGracePeriodSeconds
integer
LaunchType
string
LoadBalancers
Array<LoadBalancer>
NetworkConfiguration
NetworkConfiguration
PlacementConstraints
Array<PlacementConstraint>
PlacementStrategies
Array<PlacementStrategy>
PlatformVersion
string
PropagateTags
string
Role
string
Create-only
SchedulingStrategy
string
Create-only
ServiceConnectConfiguration
ServiceConnectConfiguration
Write-only
ServiceName
string
Create-only
ServiceRegistries
Array<ServiceRegistry>
Tags
Array<Tag>
TaskDefinition
string
VolumeConfigurations
Array<ServiceVolumeConfiguration>
Write-only
VpcLatticeConfigurations
Array<VpcLatticeConfiguration>

Return Values

Values returned after the resource is created. Access these with Fn::GetAtt.

AttributeTypeDescription
Namestring-
ServiceArnstring-

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::ECS::Service

Resources:
  MyResource:
    Type: AWS::ECS::Service
    Properties:
      Tags:
        - Key: Environment
          Value: Production

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

read

ecs:DescribeServices

create

ecs:CreateServiceecs:DescribeServiceDeploymentsecs:DescribeServicesecs:ListServiceDeploymentsiam:PassRoleecs:TagResource

update

ecs:DescribeServiceDeploymentsecs:DescribeServicesecs:ListServiceDeploymentsecs:ListTagsForResourceecs:StopServiceDeploymentecs:TagResourceecs:UntagResourceecs:UpdateService

list

ecs:DescribeServicesecs:ListClustersecs:ListServices

delete

ecs:DeleteServiceecs:DescribeServices

Get the ECS Cheat Sheet

Everything you need to know about ECS on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

ServiceECS
Properties28
Required0
TaggingSupported
Primary IDServiceArn

Supported Operations

ReadCreateUpdateListDelete

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

ClusterRoleSchedulingStrategyServiceName

External Links