provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelManagedBy     string = "pipecd-dev-managed-by"  // Always be piped-ecs-plugin.
	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.
	ManagedByECSPlugin string = "piped-ecs-plugin"
)

Variables

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

Functions

func IsPipeCDManagedTaskSet

func IsPipeCDManagedTaskSet(ts *types.TaskSet) bool

IsPipeCDManagedTaskSet checks if the given TaskSet is managed by PipeCD ECS Plugin by looking for specific tags.

func LoadServiceDefinition

func LoadServiceDefinition(appDir, serviceDefinition string, input *sdk.ExecuteStageInput[config.ECSApplicationSpec]) (types.Service, error)

LoadServiceDefinition returns Service 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

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

MakeTags converts a map of tags to a slice of types.Tag which is used by AWS SDK.

func ParseServiceDefinition

func ParseServiceDefinition(appDir, serviceDefinition string) (types.Service, error)

ParseServiceDefinition returns Service object from a given service definition file without adding deployment tags

Use this for read-only operations like livestate that do not need PipeCD metadata injected

Types

type Client

type Client interface {
	ECS
	ELB
}

type ECS

type ECS interface {
	CreateService(ctx context.Context, service types.Service) (*types.Service, error)
	UpdateService(ctx context.Context, service types.Service) (*types.Service, error)
	DescribeService(ctx context.Context, service types.Service) (*types.Service, error)
	GetServiceTaskSets(ctx context.Context, service types.Service) ([]types.TaskSet, error)
	GetPrimaryTaskSet(ctx context.Context, service types.Service) (*types.TaskSet, error)
	CreateTaskSet(ctx context.Context, service types.Service, taskDefinition types.TaskDefinition, targetGroup *types.LoadBalancer, scale float64) (*types.TaskSet, error)
	UpdateServicePrimaryTaskSet(ctx context.Context, service types.Service, taskSet types.TaskSet) (*types.TaskSet, error)
	DeleteTaskSet(ctx context.Context, taskSet types.TaskSet) error
	GetTasks(ctx context.Context, service types.Service) ([]types.Task, error)
	ServiceExists(ctx context.Context, cluster, serviceName string) (bool, error)
	GetServiceStatus(ctx context.Context, cluster, serviceName string) (string, error)
	WaitServiceStable(ctx context.Context, cluster, serviceName string) error
	RegisterTaskDefinition(ctx context.Context, taskDef types.TaskDefinition) (*types.TaskDefinition, error)
	RunTask(ctx context.Context, taskDefinition types.TaskDefinition, clusterArn string, launchType string, awsVpcConfiguration *config.ECSVpcConfiguration, tags []types.Tag) error
	PruneServiceTasks(ctx context.Context, service types.Service) error
	ListTags(ctx context.Context, resourceArn string) ([]types.Tag, error)
	TagResource(ctx context.Context, resourceArn string, tags []types.Tag) error
	UntagResource(ctx context.Context, resourceArn string, tagKeys []string) error
}

ECS defines methods for interacting with ECS resources.

type ELB

type ELB interface {
	GetListenerArns(ctx context.Context, targetGroup types.LoadBalancer) ([]string, error)
	ModifyListeners(ctx context.Context, listenerArns []string, routingTrafficCfg RoutingTrafficConfig) ([]string, error)
}

ELB defines methods for interacting with ELB resources.

type Registry

type Registry interface {
	Client(name string, cfg config.ECSDeployTargetConfig) (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