Documentation
¶
Index ¶
- func ClusterName(input string) (string, error)
- func EligibleContainers(task types.Task) []types.Container
- func IsEligibleTask(task types.Task) bool
- func TaskID(input string) (string, error)
- type Clock
- type ECSAPI
- type Resolved
- type Resolver
- func (r *Resolver) Clusters(ctx context.Context) ([]string, error)
- func (r *Resolver) EligibleTasks(ctx context.Context, cluster, serviceName string) ([]types.Task, error)
- func (r *Resolver) WaitForEligibleTasks(ctx context.Context, cluster string, service string, maxWait time.Duration, ...) ([]types.Task, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterName ¶
ClusterName returns the short cluster name from a short name or ECS ARN.
func EligibleContainers ¶
EligibleContainers returns the containers ready for ECS Exec or port forwarding.
func IsEligibleTask ¶
IsEligibleTask reports whether a task contains at least one ready container.
Types ¶
type ECSAPI ¶
type ECSAPI interface {
ListClusters(context.Context, *ecs.ListClustersInput, ...func(*ecs.Options)) (*ecs.ListClustersOutput, error)
ListTasks(context.Context, *ecs.ListTasksInput, ...func(*ecs.Options)) (*ecs.ListTasksOutput, error)
DescribeTasks(context.Context, *ecs.DescribeTasksInput, ...func(*ecs.Options)) (*ecs.DescribeTasksOutput, error)
}
ECSAPI is the subset of the ECS client used to resolve executable targets.
type Resolved ¶
type Resolved struct {
ECSCluster string
ClusterName string
Task types.Task
TaskARN string
TaskID string
Container types.Container
ContainerName string
RuntimeID string
}
Resolved is a fully validated ECS target ready for Session Manager.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver retrieves ECS resources that are eligible for a target operation.
func NewResolver ¶
NewResolver creates a Resolver backed by client.
func (*Resolver) EligibleTasks ¶
func (r *Resolver) EligibleTasks(ctx context.Context, cluster, serviceName string) ([]types.Task, error)
EligibleTasks returns every task in cluster that is ready for an ECS target operation. When serviceName is non-empty, only that service is queried.
func (*Resolver) WaitForEligibleTasks ¶
func (r *Resolver) WaitForEligibleTasks( ctx context.Context, cluster string, service string, maxWait time.Duration, clock Clock, ) ([]types.Task, error)
WaitForEligibleTasks polls until the selected cluster contains at least one task ready for an ECS target operation or maxWait expires.