AWS SDK for Go (PILOT)
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 https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

Service

import "github.com/aws/aws-sdk-go/service/ecs"

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

ClusterArn

Type: *string

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

CreatedAt

Type: *time.Time

The Unix timestamp for when the service was created.

CreatedBy

Type: *string

The principal that created the service.

DeploymentConfiguration

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

DeploymentController

The deployment controller to use for the service. For more information, see Amazon ECS Deployment Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the Amazon Elastic Container Service Developer Guide.

Deployments

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

DesiredCount

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.

EnableECSManagedTags

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 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the Amazon Elastic Container Service Developer Guide.

Events

Details on an event associated with a service.

HealthCheckGracePeriodSeconds

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.

LaunchType

Type: *string

The launch type on which your service is running. For more information, see Amazon ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the Amazon Elastic Container Service Developer Guide.

LoadBalancers

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.

NetworkConfiguration

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

PendingCount

Type: *int64

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

PlacementConstraints

An object representing a constraint on task placement. For more information, see Task Placement Constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) in the Amazon Elastic Container Service Developer Guide.

PlacementStrategy

The task placement strategy for a task or service. For more information, see Task Placement Strategies (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) in the Amazon Elastic Container Service Developer Guide.

PlatformVersion

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 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the Amazon Elastic Container Service Developer Guide.

PropagateTags

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.

RoleArn

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.

RunningCount

Type: *int64

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

SchedulingStrategy

Type: *string

The scheduling strategy to use for the service. For more information, see Services (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html).

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.

ServiceArn

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.

ServiceName

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.

ServiceRegistries

Details of the service registry.

Status

Type: *string

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

Tags

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.

TaskDefinition

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.

TaskSets

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.

Method

GoString

func (s Service) GoString() string

GoString returns the string representation

SetClusterArn

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

SetClusterArn sets the ClusterArn field's value.

SetCreatedAt

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

SetCreatedAt sets the CreatedAt field's value.

SetCreatedBy

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

SetCreatedBy sets the CreatedBy field's value.

SetDeploymentConfiguration

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

SetDeploymentConfiguration sets the DeploymentConfiguration field's value.

SetDeploymentController

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

SetDeploymentController sets the DeploymentController field's value.

SetDeployments

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

SetDeployments sets the Deployments field's value.

SetDesiredCount

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

SetDesiredCount sets the DesiredCount field's value.

SetEnableECSManagedTags

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

SetEnableECSManagedTags sets the EnableECSManagedTags field's value.

SetEvents

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

SetEvents sets the Events field's value.

SetHealthCheckGracePeriodSeconds

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

SetHealthCheckGracePeriodSeconds sets the HealthCheckGracePeriodSeconds field's value.

SetLaunchType

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

SetLaunchType sets the LaunchType field's value.

SetLoadBalancers

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

SetLoadBalancers sets the LoadBalancers field's value.

SetNetworkConfiguration

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

SetNetworkConfiguration sets the NetworkConfiguration field's value.

SetPendingCount

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

SetPendingCount sets the PendingCount field's value.

SetPlacementConstraints

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

SetPlacementConstraints sets the PlacementConstraints field's value.

SetPlacementStrategy

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

SetPlacementStrategy sets the PlacementStrategy field's value.

SetPlatformVersion

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

SetPlatformVersion sets the PlatformVersion field's value.

SetPropagateTags

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

SetPropagateTags sets the PropagateTags field's value.

SetRoleArn

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

SetRoleArn sets the RoleArn field's value.

SetRunningCount

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

SetRunningCount sets the RunningCount field's value.

SetSchedulingStrategy

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

SetSchedulingStrategy sets the SchedulingStrategy field's value.

SetServiceArn

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

SetServiceArn sets the ServiceArn field's value.

SetServiceName

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

SetServiceName sets the ServiceName field's value.

SetServiceRegistries

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

SetServiceRegistries sets the ServiceRegistries field's value.

SetStatus

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

SetStatus sets the Status field's value.

SetTags

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

SetTags sets the Tags field's value.

SetTaskDefinition

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

SetTaskDefinition sets the TaskDefinition field's value.

SetTaskSets

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

SetTaskSets sets the TaskSets field's value.

String

func (s Service) String() string

String returns the string representation

On this page: