API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see

We welcome your feedback on this new version of the documentation. Send your comments to


import ""

type Service struct { ClusterArn *string `locationName:"clusterArn" type:"string"` CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` CreatedBy *string `locationName:"createdBy" type:"string"` DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"` DeploymentController *DeploymentController `locationName:"deploymentController" type:"structure"` Deployments []*Deployment `locationName:"deployments" type:"list"` DesiredCount *int64 `locationName:"desiredCount" type:"integer"` EnableECSManagedTags *bool `locationName:"enableECSManagedTags" type:"boolean"` Events []*ServiceEvent `locationName:"events" type:"list"` HealthCheckGracePeriodSeconds *int64 `locationName:"healthCheckGracePeriodSeconds" type:"integer"` LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"` NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"` PendingCount *int64 `locationName:"pendingCount" type:"integer"` PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"` PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"` PlatformVersion *string `locationName:"platformVersion" type:"string"` PropagateTags *string `locationName:"propagateTags" type:"string" enum:"PropagateTags"` RoleArn *string `locationName:"roleArn" type:"string"` RunningCount *int64 `locationName:"runningCount" type:"integer"` SchedulingStrategy *string `locationName:"schedulingStrategy" type:"string" enum:"SchedulingStrategy"` ServiceArn *string `locationName:"serviceArn" type:"string"` ServiceName *string `locationName:"serviceName" type:"string"` ServiceRegistries []*ServiceRegistry `locationName:"serviceRegistries" type:"list"` Status *string `locationName:"status" type:"string"` Tags []*Tag `locationName:"tags" type:"list"` TaskDefinition *string `locationName:"taskDefinition" type:"string"` TaskSets []*TaskSet `locationName:"taskSets" type:"list"` }

Details on a service within a cluster


Type: *string

The Amazon Resource Name (ARN) of the cluster that hosts the service.


Type: *time.Time

The Unix timestamp for when the service was created.


Type: *string

The principal that created the service.


Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.


The deployment controller to use for the service. For more information, see Amazon ECS Deployment Types ( in the Amazon Elastic Container Service Developer Guide.


The details of an Amazon ECS service deployment. This is used when a service uses the CODE_DEPLOY deployment controller type.


Type: *int64

The desired number of instantiations of the task definition to keep running on the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.


Type: *bool

Specifies whether to enable Amazon ECS managed tags for the tasks in the service. For more information, see Tagging Your Amazon ECS Resources ( in the Amazon Elastic Container Service Developer Guide.


Details on an event associated with a service.


Type: *int64

The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.


Type: *string

The launch type on which your service is running. For more information, see Amazon ECS Launch Types ( in the Amazon Elastic Container Service Developer Guide.


Details on a load balancer that is used with a service.

If the service is using the ECS deployment controller, you are limited to one load balancer or target group.

If the service is using the CODE_DEPLOY deployment controller, the service is required to use either an Application Load Balancer or Network Load Balancer. When you are creating an AWS CodeDeploy deployment group, you specify two target groups (referred to as a targetGroupPair). Each target group binds to a separate task set in the deployment. The load balancer can also have up to two listeners, a required listener for production traffic and an optional listener that allows you to test new revisions of the service before routing production traffic to it.

Services with tasks that use the awsvpc network mode (for example, those with the Fargate launch type) only support Application Load Balancers and Network Load Balancers. Classic Load Balancers are not supported. Also, when you create any target groups for these services, you must choose ip as the target type, not instance. Tasks that use the awsvpc network mode are associated with an elastic network interface, not an Amazon EC2 instance.


An object representing the network configuration for a task or service.


Type: *int64

The number of tasks in the cluster that are in the PENDING state.


An object representing a constraint on task placement. For more information, see Task Placement Constraints ( in the Amazon Elastic Container Service Developer Guide.


The task placement strategy for a task or service. For more information, see Task Placement Strategies ( in the Amazon Elastic Container Service Developer Guide.


Type: *string

The platform version on which your tasks in the service are running. A platform version is only specified for tasks using the Fargate launch type. If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions ( in the Amazon Elastic Container Service Developer Guide.


Type: *string

Specifies whether to propagate the tags from the task definition or the service to the task. If no value is specified, the tags are not propagated.


Type: *string

The ARN of the IAM role associated with the service that allows the Amazon ECS container agent to register container instances with an Elastic Load Balancing load balancer.


Type: *int64

The number of tasks in the cluster that are in the RUNNING state.


Type: *string

The scheduling strategy to use for the service. For more information, see Services (

There are two service scheduler strategies available:

  • REPLICA-The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions.

  • DAEMON-The daemon scheduling strategy deploys exactly one task on each container instance in your cluster. When you are using this strategy, do not specify a desired number of tasks or any task placement strategies.

Fargate tasks do not support the DAEMON scheduling strategy.


Type: *string

The ARN that identifies the service. The ARN contains the arn:aws:ecs namespace, followed by the Region of the service, the AWS account ID of the service owner, the service namespace, and then the service name. For example, arn:aws:ecs:region:012345678910:service/my-service.


Type: *string

The name of your service. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a Region or across multiple Regions.


Details of the service registry.


Type: *string

The status of the service. The valid values are ACTIVE, DRAINING, or INACTIVE.


The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.


Type: *string

The task definition to use for tasks in the service. This value is specified when the service is created with CreateService, and it can be modified with UpdateService.


Information about a set of Amazon ECS tasks in an AWS CodeDeploy deployment. An Amazon ECS task set includes details such as the desired number of tasks, how many tasks are running, and whether the task set serves production traffic.



func (s Service) GoString() string

GoString returns the string representation


func (s *Service) SetClusterArn(v string) *Service

SetClusterArn sets the ClusterArn field's value.


func (s *Service) SetCreatedAt(v time.Time) *Service

SetCreatedAt sets the CreatedAt field's value.


func (s *Service) SetCreatedBy(v string) *Service

SetCreatedBy sets the CreatedBy field's value.


func (s *Service) SetDeploymentConfiguration(v *DeploymentConfiguration) *Service

SetDeploymentConfiguration sets the DeploymentConfiguration field's value.


func (s *Service) SetDeploymentController(v *DeploymentController) *Service

SetDeploymentController sets the DeploymentController field's value.


func (s *Service) SetDeployments(v []*Deployment) *Service

SetDeployments sets the Deployments field's value.


func (s *Service) SetDesiredCount(v int64) *Service

SetDesiredCount sets the DesiredCount field's value.


func (s *Service) SetEnableECSManagedTags(v bool) *Service

SetEnableECSManagedTags sets the EnableECSManagedTags field's value.


func (s *Service) SetEvents(v []*ServiceEvent) *Service

SetEvents sets the Events field's value.


func (s *Service) SetHealthCheckGracePeriodSeconds(v int64) *Service

SetHealthCheckGracePeriodSeconds sets the HealthCheckGracePeriodSeconds field's value.


func (s *Service) SetLaunchType(v string) *Service

SetLaunchType sets the LaunchType field's value.


func (s *Service) SetLoadBalancers(v []*LoadBalancer) *Service

SetLoadBalancers sets the LoadBalancers field's value.


func (s *Service) SetNetworkConfiguration(v *NetworkConfiguration) *Service

SetNetworkConfiguration sets the NetworkConfiguration field's value.


func (s *Service) SetPendingCount(v int64) *Service

SetPendingCount sets the PendingCount field's value.


func (s *Service) SetPlacementConstraints(v []*PlacementConstraint) *Service

SetPlacementConstraints sets the PlacementConstraints field's value.


func (s *Service) SetPlacementStrategy(v []*PlacementStrategy) *Service

SetPlacementStrategy sets the PlacementStrategy field's value.


func (s *Service) SetPlatformVersion(v string) *Service

SetPlatformVersion sets the PlatformVersion field's value.


func (s *Service) SetPropagateTags(v string) *Service

SetPropagateTags sets the PropagateTags field's value.


func (s *Service) SetRoleArn(v string) *Service

SetRoleArn sets the RoleArn field's value.


func (s *Service) SetRunningCount(v int64) *Service

SetRunningCount sets the RunningCount field's value.


func (s *Service) SetSchedulingStrategy(v string) *Service

SetSchedulingStrategy sets the SchedulingStrategy field's value.


func (s *Service) SetServiceArn(v string) *Service

SetServiceArn sets the ServiceArn field's value.


func (s *Service) SetServiceName(v string) *Service

SetServiceName sets the ServiceName field's value.


func (s *Service) SetServiceRegistries(v []*ServiceRegistry) *Service

SetServiceRegistries sets the ServiceRegistries field's value.


func (s *Service) SetStatus(v string) *Service

SetStatus sets the Status field's value.


func (s *Service) SetTags(v []*Tag) *Service

SetTags sets the Tags field's value.


func (s *Service) SetTaskDefinition(v string) *Service

SetTaskDefinition sets the TaskDefinition field's value.


func (s *Service) SetTaskSets(v []*TaskSet) *Service

SetTaskSets sets the TaskSets field's value.


func (s Service) String() string

String returns the string representation

On this page: