Documentation
¶
Overview ¶
Package cluster provides functionality for managing AWS ECS clusters, including service management, task definitions, and container operations.
Index ¶
- Variables
- type Cluster
- func (c *Cluster) Attach(ctx context.Context, taskARN arn.ARN, containerName string, command []string) error
- func (c *Cluster) Deploy(ctx context.Context, serviceName string, taskDefinitionARN arn.ARN) error
- func (c *Cluster) DescribeAllServices(ctx context.Context) ([]types.Service, error)
- func (c *Cluster) DescribeServiceTaskDefinitions(ctx context.Context) ([]ServiceTaskDefinition, error)
- func (c *Cluster) GetFirstTaskARN(ctx context.Context, serviceName string) (arn.ARN, error)
- func (c *Cluster) ReplaceTaskDefinitionTag(ctx context.Context, taskDefinitionARN arn.ARN, ...) (arn.ARN, error)
- func (c *Cluster) RunConsole(ctx context.Context, serviceName string, containerName string) (arn.ARN, error)
- type ServiceTaskDefinition
Constants ¶
This section is empty.
Variables ¶
var ( // ErrServiceNotFound is returned when a requested service cannot be found in the cluster. ErrServiceNotFound = errors.New("service not found") // ErrContainerNotFound is returned when a requested container cannot be found in a task. ErrContainerNotFound = errors.New("container not found") // ErrTaskNotFound is returned when a requested task cannot be found in the cluster. ErrTaskNotFound = errors.New("task not found") // ErrNoTasks is returned when there are no running tasks in the service. ErrNoTasks = errors.New("no tasks running") // ErrInvalidImage is returned when the image format is not valid. ErrInvalidImage = errors.New("invalid image format") // ErrInvalidTaskDefinition is returned when the task definition ARN format is not valid. ErrInvalidTaskDefinition = errors.New("invalid task definition ARN") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster represents an AWS ECS cluster with methods for managing services and tasks.
func NewCluster ¶
NewCluster creates a new Cluster instance with the provided AWS configuration and cluster name.
func (*Cluster) Attach ¶
func (c *Cluster) Attach(ctx context.Context, taskARN arn.ARN, containerName string, command []string) error
Attach attaches to a running container and executes a command.
func (*Cluster) DescribeAllServices ¶
DescribeAllServices returns a list of all services in the cluster.
func (*Cluster) DescribeServiceTaskDefinitions ¶
func (c *Cluster) DescribeServiceTaskDefinitions(ctx context.Context) ([]ServiceTaskDefinition, error)
DescribeServiceTaskDefinitions returns all services and their associated task definitions.
func (*Cluster) GetFirstTaskARN ¶
GetFirstTaskARN returns the ARN of the first running task for a service.
type ServiceTaskDefinition ¶
type ServiceTaskDefinition struct {
Service types.Service
TaskDefinition types.TaskDefinition
}
ServiceTaskDefinition represents a service and its associated task definition.