aws

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package aws provides AWS EC2 and load balancer implementation of the infrastructure provider interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Config provider.ProviderConfig
	Logger *slog.Logger
}

Options contains options for creating an AWS provider

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements the provider.Provider and provider.LoadBalancerProvider interfaces for AWS

func NewProvider

func NewProvider(opts Options) (*Provider, error)

NewProvider creates a new AWS provider with both EC2 and ELBv2 capabilities

func (*Provider) AssignLeaderNetwork

func (p *Provider) AssignLeaderNetwork(ctx context.Context, providerInstanceID string, ln provider.LeaderNetwork) error

AssignLeaderNetwork attaches the specified ENI to the specified instance

func (*Provider) CheckSubnetCapacity

func (p *Provider) CheckSubnetCapacity(ctx context.Context, subnetID string) (bool, error)

CheckSubnetCapacity checks if a subnet has available IP addresses

func (*Provider) CreateInstance

CreateInstance creates a new EC2 instance

func (*Provider) DeleteInstance

func (p *Provider) DeleteInstance(ctx context.Context, instanceID, providerInstanceID string) error

DeleteInstance terminates an EC2 instance by provider instance ID

func (*Provider) DeregisterFromLB

func (p *Provider) DeregisterFromLB(ctx context.Context, req provider.DeregisterLBRequest) error

DeregisterFromLB removes an instance from all AWS NLB target groups in the config

func (*Provider) GetInstanceStatus

func (p *Provider) GetInstanceStatus(ctx context.Context, instanceID, providerInstanceID string) (*provider.InstanceStatus, error)

GetInstanceStatus returns the current status of an EC2 instance

func (*Provider) Kind

func (p *Provider) Kind() string

func (*Provider) ListInstances

ListInstances returns instances with pagination support for large result sets

func (*Provider) ListLBInstances

func (p *Provider) ListLBInstances(ctx context.Context, req provider.ListLBInstancesRequest) ([]string, error)

ListLBInstances lists all instances currently registered with the first AWS NLB target group (all target groups for the same LB should have the same instances)

func (*Provider) RegisterWithLB

func (p *Provider) RegisterWithLB(ctx context.Context, req provider.RegisterLBRequest) error

RegisterWithLB registers an instance with all AWS NLB target groups in the config

func (*Provider) ReleaseLeaderNetwork

func (p *Provider) ReleaseLeaderNetwork(ctx context.Context, providerInstanceID string, ln provider.LeaderNetwork) error

ReleaseLeaderNetwork detaches the specified NetworkInterface from the specified instance

type ProviderOptions

type ProviderOptions struct {
	Profile string `json:"profile"` // AWS profile name (optional)
}

ProviderOptions contains AWS-specific configuration options

Jump to

Keyboard shortcuts

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