ecs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInstanceNotFoundByID defines an error for when the instance with the provided provider ID is missing.
	ErrInstanceNotFoundByID = errors.New("failed to find instance by id")

	// ErrShowInstance defines an error for when ECS SDK returns error when showing instances.
	ErrShowInstance = errors.New("failed to show instance by id")
)

Functions

This section is empty.

Types

type CloudConfig added in v0.1.0

type CloudConfig struct {
	Region          string
	AccessKey       string
	SecretKey       string
	VPCID           string
	NeutronSubnetID string
}

CloudConfig holds the configuration for the cloud provider.

type CloudInitConfig added in v0.1.0

type CloudInitConfig struct {
	WriteFiles []*WriteFile `yaml:"write_files,omitempty"`
	RunCmd     []string     `yaml:"runcmd,omitempty"`
}

CloudInitConfig represents the structure of a cloud-init configuration.

type Service

type Service struct {
	ECSClient *ecsiface.EcsClient
	// contains filtered or unexported fields
}

Service holds a collection of interfaces. The interfaces are broken down like this to group functions together. One alternative is to have a large list of functions from the ecs client.

func NewService

func NewService(clusterScope scope.ECSScope) (*Service, error)

NewService returns a new service given the ECS api client.

func (*Service) AttachInstanceToElb

func (s *Service) AttachInstanceToElb(instance *infrav1.Instance) error

func (*Service) CheckJob

func (s *Service) CheckJob(jobId string) error

func (*Service) CreateInstance

func (s *Service) CreateInstance(scope *scope.MachineScope, userData []byte,
	userDataFormat string,
) (*infrav1.Instance, error)

func (*Service) DetachInstanceFromElb

func (s *Service) DetachInstanceFromElb(instance *infrav1.Instance) error

func (*Service) GetCoreSecurityGroups

func (s *Service) GetCoreSecurityGroups(scope *scope.MachineScope) ([]string, error)

func (*Service) InstanceIfExists

func (s *Service) InstanceIfExists(id *string) (*infrav1.Instance, error)

func (*Service) SDKToInstance

func (s *Service) SDKToInstance(v *ecsModel.ShowServerResponse) (*infrav1.Instance, error)

func (*Service) ShowInstance

func (s *Service) ShowInstance(serverId string) (*ecsModel.ShowServerResponse, error)

func (*Service) TerminateInstance

func (s *Service) TerminateInstance(id string) error

type WriteFile added in v0.1.0

type WriteFile struct {
	Path        string `yaml:"path"`
	Owner       string `yaml:"owner"`
	Permissions string `yaml:"permissions"`
	Content     string `yaml:"content"`
}

WriteFile represents a file to be written by cloud-init.

Jump to

Keyboard shortcuts

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