ecs

package
v0.12.19 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConsoleURLForService added in v0.0.7

func BuildConsoleURLForService(cluster, service string) string

BuildConsoleURLForService builds the console url for a service

func CopyTaskDefinition added in v0.2.10

func CopyTaskDefinition(existingTask *ecs.TaskDefinition, toFamilyName string, modifiers ...func(*ecs.ContainerDefinition)) (*ecs.TaskDefinition, error)

CopyTaskDefinitionWithCommand registers a new task, based on the passed task, but with new command.

func CreateNewTaskWithEnvironment added in v0.0.7

func CreateNewTaskWithEnvironment(existingTask *ecs.TaskDefinition, env []*ecs.KeyValuePair) (*ecs.TaskDefinition, error)

CreateNewTaskWithEnvironment registers a new task, based on the passed task, but with new environment.

func CreateNewTaskWithImage added in v0.2.5

func CreateNewTaskWithImage(existingTask *ecs.TaskDefinition, imageURL string) (*ecs.TaskDefinition, error)

CreateNewTaskWithImage registers a new task, based on the passed task, but with new image.

func CreateNewTaskWithMemory added in v0.2.17

func CreateNewTaskWithMemory(existingTask *ecs.TaskDefinition, memory *int64, memoryReservation *int64) (*ecs.TaskDefinition, error)

CreateNewTaskWithMemory registers a new task definition, overwriting memory params

func CreatePostDeploymentTask added in v0.2.13

func CreatePostDeploymentTask(input *CreatePostDeploymentTaskInput) error

CreatePostDeploymentTask listens for SERVICE_STEADY_STATE events matching the service and cluster, and runs a custom command when a deployment is complete

func CreateRefreshDeployment added in v0.2.16

func CreateRefreshDeployment(cluster, service string) error

CreateRefreshDeployment forces a new deployment on a service.

func CreateScheduledTask added in v0.1.6

func CreateScheduledTask(cluster, service, taskSuffix, scheduleExpression, command string) error

CreateScheduledTask creates a scheduled task in an ECS cluster with the specified paramters

func DeployTaskToService added in v0.0.7

func DeployTaskToService(cluster, service string, task *ecs.TaskDefinition) (*ecs.Service, error)

DeployTaskToService deploys a given task definition to a cluster/service

func EssentialImage added in v0.2.5

func EssentialImage(task *ecs.TaskDefinition) string

EssentialImage returns the essential image of a task def

func FindNewestDefinition added in v0.2.5

func FindNewestDefinition(familyPrefix string) (*ecs.TaskDefinition, error)

FindNewestDefinition finds the most recent task definition of the service's task family

func FindRoleByName added in v0.1.6

func FindRoleByName(name string) (*iam.Role, error)

FindRoleByName paginates through roles and returns any found that match the name string

func FindService added in v0.0.7

func FindService(cluster, service string) (*ecs.Service, error)

FindService finds a service struct by name

func GetAllLogs added in v0.1.9

func GetAllLogs(region string, params *cloudwatchlogs.GetLogEventsInput) ([]string, error)

GetAllLogs retrieves the entire log history

func GetAllTasksByDefinition added in v0.1.9

func GetAllTasksByDefinition(cluster string, def *ecs.TaskDefinition, status string) ([]*ecs.Task, error)

GetAllTasksByDefinition gets the tasks that have run recently for a cluster and service

func GetAllTasksByDefinitionStatus added in v0.1.9

func GetAllTasksByDefinitionStatus(cluster string, def *ecs.TaskDefinition, status *string) ([]*ecs.Task, error)

GetAllTasksByDefinitionStatus gets all of the tasks of a certain status for a task definition

func GetClusterInstances added in v0.1.4

func GetClusterInstances(cluster string) ([]string, error)

GetClusterInstances returns the container instances of a cluster by id

func GetClusterNames

func GetClusterNames() ([]string, error)

GetClusterNames returns a slice of strings representing cluster names

func GetContainerInstances

func GetContainerInstances(cluster string, service string) ([]string, error)

GetContainerInstances returns the container instances of a cluster

func GetCurrentTaskDefinition added in v0.0.6

func GetCurrentTaskDefinition(cluster, service string) (*ecs.TaskDefinition, error)

GetCurrentTaskDefinition returns a service's current task definition

func GetDeployedEssentialContainer added in v0.0.6

func GetDeployedEssentialContainer(cluster, service string) (*ecs.ContainerDefinition, error)

GetDeployedEssentialContainer gets the currently deployed "essential" container definition of a cluster service

func GetEssentialContainer added in v0.0.6

func GetEssentialContainer(task *ecs.TaskDefinition) (*ecs.ContainerDefinition, error)

GetEssentialContainer returns the essential container

func GetLogs added in v0.0.14

func GetLogs(cluster, service, status string) error

GetLogs returns cloudwatch logs for a specific set of log streams matching a pattern within a log group and region

func GetNewestTaskDefinition added in v0.2.9

func GetNewestTaskDefinition(cluster, service string) (*ecs.TaskDefinition, error)

func GetTask added in v0.2.9

func GetTask(cluster, arn string) (*ecs.Task, error)

func GetTaskDefinition added in v0.1.7

func GetTaskDefinition(arn string) (*ecs.TaskDefinition, error)

GetTaskDefinition returns a task definition by arn

func GetTaskIDFromArn added in v0.1.9

func GetTaskIDFromArn(arn string) string

GetTaskIDFromArn returns the last part of an arn for an ecs task

func GetTaskLogs added in v0.1.7

func GetTaskLogs(def *ecs.TaskDefinition, taskID string) error

GetTaskLogs prints logs to stdout

func KeyPairsToString added in v0.0.7

func KeyPairsToString(kv []*ecs.KeyValuePair) string

KeyPairsToString takes a list of key pairs... and prints them into a multiline block

func ListClusters added in v0.2.13

func ListClusters() ([]string, error)

func ListLogEvents added in v0.0.14

func ListLogEvents(group, name, region string) error

ListLogEvents accepts a single group and stream name and prints the cloudwatch logs to stdout

func ListServices added in v0.0.10

func ListServices(cluster string) ([]string, error)

ListServices lists services for a cluster by plain name

func LocateTaskDef added in v0.2.9

func LocateTaskDef(cluster, service, source string) (*ecs.TaskDefinition, error)

func PrintTaskURLs added in v0.2.17

func PrintTaskURLs(clusterName string, service *ecs.Service) ([]string, error)

func RunTaskWithCommand added in v0.1.4

func RunTaskWithCommand(cluster string, task *ecs.TaskDefinition, command string) (*ecs.RunTaskOutput, error)

RunTaskWithCommand runs a one-off task with a command override.

func ScaleService added in v0.0.11

func ScaleService(cluster, service string, desiredCount int) (*ecs.Service, error)

ScaleService sets the desired count of a service

func StringToKeyPairs added in v0.0.7

func StringToKeyPairs(input string) ([]*ecs.KeyValuePair, error)

StringToKeyPairs takes a string, and turns it back into an array of key pairs

func TaskExitCode added in v0.1.7

func TaskExitCode(task *ecs.Task) (*int64, error)

TaskExitCode will tell you if the exit code of a task

func UpdateAgent added in v0.1.4

func UpdateAgent(cluster, containerInstanceARN string) error

UpdateAgent will update the agents for all instances in a cluster

func ValidateCluster

func ValidateCluster(cluster string) error

ValidateCluster returns an error if the cluster is not found

func WithCommand added in v0.2.10

func WithCommand(command string) func(definition *ecs.ContainerDefinition)

func WithName added in v0.2.10

func WithName(name string) func(definition *ecs.ContainerDefinition)

Types

type CreatePostDeploymentTaskInput added in v0.2.13

type CreatePostDeploymentTaskInput struct {
	SourceCluster string
	SourceService string
	TargetCluster string
	TargetService string
	Command       string
}

CreatePostDeploymentTaskInput parameterizes the CreatePostDeploymentTask command

Jump to

Keyboard shortcuts

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