Documentation
¶
Index ¶
- Constants
- Variables
- func IsPipeCDManagedTaskSet(ts *types.TaskSet) bool
- func LoadServiceDefinition(appDir, serviceDefinition string, ...) (types.Service, error)
- func LoadTargetGroups(targetGroups config.ECSTargetGroups) (*types.LoadBalancer, *types.LoadBalancer, error)
- func LoadTaskDefinition(appDir, taskDefinition string) (types.TaskDefinition, error)
- func MakeTags(tags map[string]string) []types.Tag
- func ParseServiceDefinition(appDir, serviceDefinition string) (types.Service, error)
- type Client
- type ECS
- type ELB
- type Registry
- type RoutingTrafficConfig
Constants ¶
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 ¶
var ErrNoTargetGroup = errors.New("no target group")
Functions ¶
func IsPipeCDManagedTaskSet ¶
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 ParseServiceDefinition ¶
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 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