pkg

package
v0.0.0-...-56a2cb5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTaskDefinition

func GenerateTaskDefinition(input *GenerateTaskDefinitionInput, client *ecs.Client, logger *log.Entry) (*types.TaskDefinition, bool, error)

Types

type CapacityProviderStrategy

type CapacityProviderStrategy struct {
	CapacityProvider string `mapstructure:"capacity_provider" validate:"required"`
	Base             int32  `mapstructure:"base"`
	Weight           int32  `mapstructure:"weight"`
}

type Config

type Config struct {
	Version string `mapstructure:"version" validate:"required,oneof=v1"`
	Cluster string `mapstructure:"cluster" validate:"required"`

	Services []Service `mapstructure:"services" validate:"omitempty,dive"`
	Tasks    Tasks     `mapstructure:"tasks" validate:"omitempty,dive"`
}

func (*Config) DeployServices

func (config *Config) DeployServices(newContainerImageTag *string, client *ecs.Client) error

func (*Config) DeployTasks

func (config *Config) DeployTasks(newContainerImageTag *string, stage TaskStage, client *ecs.Client) error

func (*Config) Validate

func (config *Config) Validate() error

type GenerateTaskDefinitionInput

type GenerateTaskDefinitionInput struct {
	// The docker image tag to use when updating the container image.
	//
	// This member is required.
	ImageTag *string

	// The task definition to use as a foundation for a new task definition.
	// Could be the family for the latest ACTIVE revision, family and revision
	// (family:revision) for a specific revision in the family, or full Amazon
	// Resource Name (ARN) of the task definition.
	//
	// This member is required.
	TaskDefinition *string

	// Container mapping for easy lookup of containers that should be updated,
	// basically create a map with the container name as the key and `true` as
	// the value.
	//
	// This member is required.
	UpdateableContainers map[string]bool
}

type NetworkConfiguration

type NetworkConfiguration struct {
	VpcConfiguration VpcConfiguration `mapstructure:"vpc_configuration" validate:"required,dive"`
}

type Service

type Service struct {
	Name       string   `mapstructure:"name" validate:"required"`
	Containers []string `mapstructure:"containers" validate:"required,min=1,dive"`

	Force   *bool  `mapstructure:"force"`
	MaxWait *int64 `mapstructure:"max_wait" validate:"omitempty,min=5"`
}

type Status

type Status string
const (
	FailedStatus    Status = "failed"
	SkippedStatus   Status = "skipped"
	SucceededStatus Status = "succeeded"
)

type Task

type Task struct {
	Family     string   `mapstructure:"family" validate:"required"`
	Containers []string `mapstructure:"containers" validate:"required,min=1,dive"`
	Count      int32    `mapstructure:"count" validate:"required,min=1,max=10"`

	CapacityProviderStrategies []CapacityProviderStrategy `mapstructure:"capacity_provider_strategies" validate:"omitempty,max=6,dive"`
	LaunchType                 *string                    `mapstructure:"launch_type" validate:"omitempty,oneof=ec2 fargate external"`
	NetworkConfiguration       *NetworkConfiguration      `mapstructure:"network_configuration" validate:"omitempty,dive"`
}

type TaskStage

type TaskStage string
const (
	TaskStagePost TaskStage = "post"
	TaskStagePre  TaskStage = "pre"
)

type Tasks

type Tasks struct {
	Pre  []Task `mapstructure:"pre" validate:"omitempty,dive"`
	Post []Task `mapstructure:"post" validate:"omitempty,dive"`
}

type VpcConfiguration

type VpcConfiguration struct {
	AssignPublicIP bool     `mapstructure:"assign_public_ip" validate:"required"`
	SecurityGroups []string `mapstructure:"security_groups" validate:"required,min=1,max=5,dive"`
	Subnets        []string `mapstructure:"subnets" validate:"required,min=1,max=16,dive"`
}

Jump to

Keyboard shortcuts

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