ecs

package
v0.0.0-...-f856672 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerName     = "main"
	DockerRegistry    = "docker.io"
	EcrPublicRegistry = "public.ecr.aws"
	ProjectName       = types.ProjectName
)
View Source
const AwsLogsStreamPrefix = ProjectName

Variables

This section is empty.

Functions

func FindContainerOverrides

func FindContainerOverrides(detail *ECSTaskStateChange, containerName string) *ecstaskstatechange.OverridesItem

func FixupFargateConfig

func FixupFargateConfig(vCpu, memoryMiB float64) (cpu CpuUnits, memory MemoryMiB)

func GetLogStreamForTaskID

func GetLogStreamForTaskID(taskID string) string

func GetTaskID

func GetTaskID(taskArn TaskArn) string

func GetTaskStatus

func GetTaskStatus(ctx context.Context, taskArn TaskArn) error

func PlatformToArchOS

func PlatformToArchOS(platform string) (string, string)

func SplitClusterTask

func SplitClusterTask(taskArn TaskArn) (string, string)

func WaitForTask

func WaitForTask(ctx context.Context, taskArn TaskArn, poll time.Duration) error

Types

type AwsEcs

type AwsEcs struct {
	aws.Aws
	BucketName      string
	ClusterName     string
	LogGroupARN     string
	SecurityGroupID string
	Spot            bool
	SubNetID        string
	TaskDefARN      string
	VpcID           string
}

func (*AwsEcs) CreateUploadURL

func (a *AwsEcs) CreateUploadURL(ctx context.Context, name string) (string, error)

func (*AwsEcs) GetTaskArn

func (a *AwsEcs) GetTaskArn(taskID string) (TaskArn, error)

func (*AwsEcs) GetVpcID

func (a *AwsEcs) GetVpcID() string

func (AwsEcs) Info

func (a AwsEcs) Info(ctx context.Context, id TaskArn) (*types.TaskInfo, error)

func (*AwsEcs) MakeARN

func (a *AwsEcs) MakeARN(service, resource string) string

func (*AwsEcs) PopulateVPCandSubnetID

func (a *AwsEcs) PopulateVPCandSubnetID(ctx context.Context, vpcID, subnetID string) error

func (*AwsEcs) Run

func (a *AwsEcs) Run(ctx context.Context, env map[string]string, cmd ...string) (TaskArn, error)

func (AwsEcs) Stop

func (a AwsEcs) Stop(ctx context.Context, id types.TaskID) error

func (*AwsEcs) Tail

func (a *AwsEcs) Tail(ctx context.Context, taskArn TaskArn) error

func (*AwsEcs) TailTaskID

func (a *AwsEcs) TailTaskID(ctx context.Context, taskID string) (EventStream, error)

type CWLogGroupQuery

type CWLogGroupQuery struct {
	LogGroupInput LogGroupInput
	Start, End    time.Time
	// contains filtered or unexported fields
}

func (*CWLogGroupQuery) HasNext

func (c *CWLogGroupQuery) HasNext() bool

func (*CWLogGroupQuery) Next

func (c *CWLogGroupQuery) Next(ctx context.Context) ([]LogEvent, error)

type CpuUnits

type CpuUnits = uint

type ECSDeploymentStateChange

type ECSDeploymentStateChange struct {
	ECSServiceAction
	DeploymentId string `json:"deploymentId,omitempty"`
}

type ECSServiceAction

type ECSServiceAction = ecsserviceaction.ECSServiceAction

type Event

type Event struct {
	Detail     json.RawMessage `json:"detail"`
	Account    string          `json:"account"`
	DetailType string          `json:"detail-type"`
	Id         string          `json:"id"`
	Region     string          `json:"region"`
	Resources  []string        `json:"resources"`
	Source     string          `json:"source"`
	Time       time.Time       `json:"time"`
	Version    string          `json:"version"`
}

type EventStream

type EventStream interface {
	Close() error
	Events() <-chan types.StartLiveTailResponseStream
}

EventStream is an interface that represents a stream of events from a call to StartLiveTail

func TailLogGroup

func TailLogGroup(ctx context.Context, input LogGroupInput) (EventStream, error)

func TailLogGroups

func TailLogGroups(ctx context.Context, since time.Time, logGroups ...LogGroupInput) (EventStream, error)

type LogGroupInput

type LogGroupInput struct {
	LogGroupARN           string
	LogStreamNames        []string
	LogStreamNamePrefix   string
	LogEventFilterPattern string
}

LogGroupInput is like cloudwatchlogs.StartLiveTailInput but with only one loggroup and one logstream prefix.

type LogStreamInfo

type LogStreamInfo struct {
	Prefix    string
	Container string
	Firelens  bool
	TaskID    string
}

func GetLogStreamInfo

func GetLogStreamInfo(logStream string) *LogStreamInfo

type MemoryMiB

type MemoryMiB = uint

type TaskArn

type TaskArn = types.TaskID

Directories

Path Synopsis
cfn

Jump to

Keyboard shortcuts

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