Documentation
¶
Overview ¶
Package aws provides AWS EC2 and load balancer implementation of the infrastructure provider interface.
Index ¶
- type Options
- type Provider
- func (p *Provider) AssignLeaderNetwork(ctx context.Context, providerInstanceID string, ln provider.LeaderNetwork) error
- func (p *Provider) CheckSubnetCapacity(ctx context.Context, subnetID string) (bool, error)
- func (p *Provider) CreateInstance(ctx context.Context, req provider.CreateInstanceRequest) (*provider.CreateInstanceResponse, error)
- func (p *Provider) DeleteInstance(ctx context.Context, instanceID, providerInstanceID string) error
- func (p *Provider) DeregisterFromLB(ctx context.Context, req provider.DeregisterLBRequest) error
- func (p *Provider) GetInstanceStatus(ctx context.Context, instanceID, providerInstanceID string) (*provider.InstanceStatus, error)
- func (p *Provider) Kind() string
- func (p *Provider) ListInstances(ctx context.Context, req provider.ListInstancesRequest) (*provider.ListInstancesResponse, error)
- func (p *Provider) ListLBInstances(ctx context.Context, req provider.ListLBInstancesRequest) ([]string, error)
- func (p *Provider) RegisterWithLB(ctx context.Context, req provider.RegisterLBRequest) error
- func (p *Provider) ReleaseLeaderNetwork(ctx context.Context, providerInstanceID string, ln provider.LeaderNetwork) error
- type ProviderOptions
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 ¶
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 ¶
CheckSubnetCapacity checks if a subnet has available IP addresses
func (*Provider) CreateInstance ¶
func (p *Provider) CreateInstance(ctx context.Context, req provider.CreateInstanceRequest) (*provider.CreateInstanceResponse, error)
CreateInstance creates a new EC2 instance
func (*Provider) DeleteInstance ¶
DeleteInstance terminates an EC2 instance by provider instance ID
func (*Provider) DeregisterFromLB ¶
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) ListInstances ¶
func (p *Provider) ListInstances(ctx context.Context, req provider.ListInstancesRequest) (*provider.ListInstancesResponse, error)
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 ¶
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