ecs

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelManagedBy   string = "pipecd-dev-managed-by"  // Always be piped.
	LabelPiped       string = "pipecd-dev-piped"       // The id of piped handling this application.
	LabelApplication string = "pipecd-dev-application" // The application this resource belongs to.
	LabelCommitHash  string = "pipecd-dev-commit-hash" // Hash value of the deployed commit.
	ManagedByPiped   string = "piped"
)

Variables

View Source
var ErrNoTargetGroup = errors.New("no target group")

Functions

func FindArtifactVersions

func FindArtifactVersions(taskDefinition types.TaskDefinition) ([]*model.ArtifactVersion, error)

FindArtifactVersions parses artifact versions from ECS task definition.

func FindImageTag

func FindImageTag(taskDefinition types.TaskDefinition) (string, error)

FindImageTag parses image tag from given ECS task definition.

func IsPipeCDManagedTaskSet added in v0.45.4

func IsPipeCDManagedTaskSet(ts *types.TaskSet) bool

func LoadServiceDefinition

func LoadServiceDefinition(appDir, serviceDefinitionFilename string) (types.Service, error)

LoadServiceDefinition returns ServiceDefinition object from a given service definition file.

func LoadTargetGroups

func LoadTargetGroups(targetGroups config.ECSTargetGroups) (*types.LoadBalancer, *types.LoadBalancer, error)

LoadTargetGroups returns primary & canary target groups according to the defined in pipe definition file.

func LoadTaskDefinition

func LoadTaskDefinition(appDir, taskDefinition string) (types.TaskDefinition, error)

LoadTaskDefinition returns TaskDefinition object from a given task definition file.

func MakeTags added in v0.41.4

func MakeTags(tags map[string]string) []types.Tag

Types

type Client

type Client interface {
	ECS
	ELB
}

Client is wrapper of ECS client.

type ECS

type ECS interface {
	ServiceExists(ctx context.Context, clusterName string, servicesName string) (bool, error)
	CreateService(ctx context.Context, service types.Service) (*types.Service, error)
	UpdateService(ctx context.Context, service types.Service) (*types.Service, error)
	WaitServiceStable(ctx context.Context, service types.Service) error
	RegisterTaskDefinition(ctx context.Context, taskDefinition types.TaskDefinition) (*types.TaskDefinition, error)
	RunTask(ctx context.Context, taskDefinition types.TaskDefinition, clusterArn string, launchType string, awsVpcConfiguration *config.ECSVpcConfiguration, tags []types.Tag) error
	GetServiceTaskSets(ctx context.Context, service types.Service) ([]*types.TaskSet, error)
	CreateTaskSet(ctx context.Context, service types.Service, taskDefinition types.TaskDefinition, targetGroup *types.LoadBalancer, scale int) (*types.TaskSet, error)
	DeleteTaskSet(ctx context.Context, taskSet types.TaskSet) error
	UpdateServicePrimaryTaskSet(ctx context.Context, service types.Service, taskSet types.TaskSet) (*types.TaskSet, error)
	TagResource(ctx context.Context, resourceArn string, tags []types.Tag) error
}

type ELB

type ELB interface {
	GetListenerArns(ctx context.Context, targetGroup types.LoadBalancer) ([]string, error)
	// ModifyListeners modifies the actions of type ActionTypeEnumForward to perform routing traffic
	// to the given target groups. Other actions won't be modified.
	ModifyListeners(ctx context.Context, listenerArns []string, routingTrafficCfg RoutingTrafficConfig) error
}

type Registry

type Registry interface {
	Client(name string, cfg *config.PlatformProviderECSConfig, logger *zap.Logger) (Client, error)
}

Registry holds a pool of aws client wrappers.

func DefaultRegistry

func DefaultRegistry() Registry

DefaultRegistry returns a pool of aws clients and a mutex associated with it.

type RoutingTrafficConfig

type RoutingTrafficConfig []targetGroupWeight

Jump to

Keyboard shortcuts

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