task

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package task provides support for running Amazon ECS tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultClusterGetter

type DefaultClusterGetter interface {
	DefaultCluster() (string, error)
}

DefaultClusterGetter gets the default cluster.

type DefaultVPCRunner

type DefaultVPCRunner struct {
	// Count of the tasks to be launched.
	Count int
	// Group Name fo the tasks that use the same task definition.
	GroupName string

	// Interfaces to interact with dependencies. Must not be nil.
	VPCGetter     VPCGetter
	ClusterGetter DefaultClusterGetter
	Starter       TaskRunner
}

DefaultVPCRunner can run an Amazon ECS task in the default VPC and the default cluster.

func (*DefaultVPCRunner) Run

func (r *DefaultVPCRunner) Run() ([]string, error)

Run runs tasks in default cluster and default subnets, and returns the task ARNs.

type EnvRunner

type EnvRunner struct {
	// Count of the tasks to be launched.
	Count int
	// Group Name of the tasks that use the same task definition.
	GroupName string

	// App and Env in which the tasks will be launched.
	App string
	Env string

	// Interfaces to interact with dependencies. Must not be nil.
	VPCGetter     VPCGetter
	ClusterGetter ResourceGetter
	Starter       TaskRunner
}

EnvRunner can run an Amazon ECS task in the VPC and the cluster of an environment.

func (*EnvRunner) Run

func (r *EnvRunner) Run() ([]string, error)

Run runs tasks in the environment of the application, and returns the task ARNs.

type NetworkConfigRunner

type NetworkConfigRunner struct {
	// Count of the tasks to be launched.
	Count int
	// Group Name of the tasks that use the same task definition.
	GroupName string

	// Network configuration
	Subnets        []string
	SecurityGroups []string

	// Interfaces to interact with dependencies. Must not be nil.
	ClusterGetter DefaultClusterGetter
	Starter       TaskRunner
}

NetworkConfigRunner runs an Amazon ECS task in the specified network configuration and the default cluster.

func (*NetworkConfigRunner) Run

func (r *NetworkConfigRunner) Run() ([]string, error)

Run runs tasks in the subnets and the security groups, and returns the task ARNs.

type ResourceGetter

type ResourceGetter interface {
	GetResourcesByTags(resourceType string, tags map[string]string) ([]*resourcegroups.Resource, error)
}

ResourceGetter gets resources by tags.

type TaskRunner

type TaskRunner interface {
	RunTask(input ecs.RunTaskInput) ([]string, error)
}

TaskRunner runs the tasks and wait for it to start.

type VPCGetter

type VPCGetter interface {
	SubnetIDs(filters ...ec2.Filter) ([]string, error)
	SecurityGroups(filters ...ec2.Filter) ([]string, error)
	PublicSubnetIDs(filters ...ec2.Filter) ([]string, error)
}

VpcGetter gets subnets and security groups.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL