elb

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 26 Imported by: 0

README

ELB (Classic)

Parity grade: A · SDK aws-sdk-go-v2/service/elasticloadbalancing@v1.33.21 · last audited 2026-07-12 (49e505cb)

Coverage

Operations audited 29 (24 ok, 3 partial, 2 other)
Feature families 2 (2 ok)
Known gaps 3
Deferred items 1
Resource leaks clean
Known gaps
  • ApplySecurityGroupsToLoadBalancer / AttachLoadBalancerToSubnets accept any security-group/subnet ID string without validating existence against EC2 state (real AWS returns InvalidSecurityGroup/InvalidSubnet/SubnetNotFound) -- cross-service, out of scope for this pass, needs an EC2 backend lookup hook
  • SetLoadBalancerListenerSSLCertificate / CreateLoadBalancer HTTPS listeners validate SSLCertificateId only by ARN-prefix regex, not cross-service ACM/IAM existence (real AWS returns CertificateNotFound) -- cross-service, out of scope
  • CreateLoadBalancerPolicy has no TooManyPolicies limit (AWS models TooManyPoliciesException for this op per the SDK's op-specific error switch, but no default per-LB policy count limit is documented anywhere gopherstack could source a correct number from; fabricating one risked being wrong, so left unenforced rather than guessed)
Deferred
  • none — full op-by-op pass completed this round

More

Documentation

Overview

Package elb provides an in-memory implementation of the AWS Classic Elastic Load Balancing (ELB) service.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLoadBalancerNotFound is returned when the requested load balancer does not exist.
	ErrLoadBalancerNotFound = awserr.New("LoadBalancerNotFound", awserr.ErrNotFound)

	// ErrLoadBalancerAlreadyExists is returned when a load balancer with that name already exists.
	ErrLoadBalancerAlreadyExists = awserr.New("DuplicateLoadBalancerName", awserr.ErrAlreadyExists)

	// ErrInvalidParameter is returned when a request parameter is invalid or missing.
	ErrInvalidParameter = awserr.New("ValidationError", awserr.ErrInvalidParameter)

	// ErrUnknownAction is returned when the requested action is not recognized.
	ErrUnknownAction = awserr.New("InvalidAction", awserr.ErrInvalidParameter)

	// ErrPolicyNotFound is returned when a policy does not exist.
	ErrPolicyNotFound = awserr.New("PolicyNotFound", awserr.ErrNotFound)

	// ErrPolicyAlreadyExists is returned when a policy with that name already exists.
	ErrPolicyAlreadyExists = awserr.New("DuplicatePolicyName", awserr.ErrAlreadyExists)

	// ErrValidation is a generic validation error sentinel mapped to HTTP 400.
	ErrValidation = awserr.New("ValidationError", awserr.ErrInvalidParameter)

	// ErrListenerNotFound is returned when a listener on the requested port does not exist.
	ErrListenerNotFound = awserr.New("ListenerNotFound", awserr.ErrNotFound)

	// ErrInvalidInstance is returned when a specified instance is not registered with the LB.
	ErrInvalidInstance = awserr.New("InvalidInstance", awserr.ErrInvalidParameter)

	// ErrDuplicateListener is returned when a listener already exists on the requested port.
	ErrDuplicateListener = awserr.New("DuplicateListener", awserr.ErrAlreadyExists)

	// ErrInvalidConfiguration is returned when an operation is not valid for the LB's configuration.
	ErrInvalidConfiguration = awserr.New("InvalidConfigurationRequest", awserr.ErrInvalidParameter)

	// ErrTooManyLoadBalancers is returned when creating a load balancer would exceed the
	// per-region account limit (AWS: TooManyAccessPointsException / "TooManyLoadBalancers").
	ErrTooManyLoadBalancers = awserr.New("TooManyLoadBalancers", awserr.ErrInvalidParameter)

	// ErrTooManyTags is returned when tagging a load balancer would exceed the per-resource
	// tag limit (AWS: TooManyTagsException / "TooManyTags").
	ErrTooManyTags = awserr.New("TooManyTags", awserr.ErrInvalidParameter)

	// ErrDuplicateTagKeys is returned when a single AddTags/CreateLoadBalancer request
	// specifies the same tag key more than once (AWS: DuplicateTagKeysException).
	ErrDuplicateTagKeys = awserr.New("DuplicateTagKeys", awserr.ErrInvalidParameter)

	// ErrInvalidScheme is returned when the Scheme parameter is not 'internet-facing' or
	// 'internal' (AWS: InvalidSchemeException).
	ErrInvalidScheme = awserr.New("InvalidScheme", awserr.ErrInvalidParameter)

	// ErrPolicyTypeNotFound is returned when the requested policy type name does not exist
	// (AWS: PolicyTypeNotFoundException). Distinct from ErrPolicyNotFound, which is for
	// policy *instances*, not policy *types*.
	ErrPolicyTypeNotFound = awserr.New("PolicyTypeNotFound", awserr.ErrNotFound)

	// ErrUnsupportedProtocol is returned when a listener specifies a protocol other than
	// HTTP, HTTPS, TCP, or SSL (AWS: UnsupportedProtocolException).
	ErrUnsupportedProtocol = awserr.New("UnsupportedProtocol", awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("ELB provider: nil AppContext")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AccessLog

type AccessLog struct {
	S3BucketName   string `json:"s3BucketName"`
	S3BucketPrefix string `json:"s3BucketPrefix"`
	EmitInterval   int32  `json:"emitInterval"`
	Enabled        bool   `json:"enabled"`
}

AccessLog holds access-log configuration for a Classic ELB.

type AccountLimit

type AccountLimit struct {
	Name string
	Max  string
}

AccountLimit represents a single ELB account limit.

type BackendServerDescription

type BackendServerDescription struct {
	PolicyNames  []string `json:"policyNames"`
	InstancePort int32    `json:"instancePort"`
}

BackendServerDescription maps an instance port to the policies applied to it.

type CreateLoadBalancerInput

type CreateLoadBalancerInput struct {
	LoadBalancerName  string
	Scheme            string
	AvailabilityZones []string
	SecurityGroups    []string
	Subnets           []string
	Listeners         []Listener
}

CreateLoadBalancerInput holds input for CreateLoadBalancer.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler is the Echo HTTP handler for Classic ELB operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new ELB handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this handler instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the ELB action from the request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the load balancer name from the request.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported ELB operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for ELB operations.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears the backend state, delegating to the underlying StorageBackend.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches Classic ELB requests. ELB requests are form-encoded POSTs with Version=2012-06-01.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

h.Backend is the StorageBackend interface, which does not declare Snapshot/Restore, so InMemoryBackend's methods (above) are not promoted to Handler automatically. Without this delegation, cli.go's setupPersistence type-asserts the registered service.Registerable (this *Handler) against persistence.Persistable, fails silently, and never registers elb for snapshot/restore despite the backend being fully capable. Mirrors services/securityhub's identical Handler-level delegation.

type HealthCheck

type HealthCheck struct {
	Target             string `json:"target"`
	Interval           int32  `json:"interval"`
	Timeout            int32  `json:"timeout"`
	UnhealthyThreshold int32  `json:"unhealthyThreshold"`
	HealthyThreshold   int32  `json:"healthyThreshold"`
}

HealthCheck holds health-check configuration for a load balancer.

type InMemoryBackend

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

InMemoryBackend implements StorageBackend using two [store.Table]s.

Classic ELB load balancer names (and, transitively, policy names) are unique only WITHIN a region -- see getRegion's region-isolation doc above -- so both tables are keyed by a composite "region|name" key (see store_setup.go) rather than a bare name, and a secondary index groups entries by their owning region/load-balancer for region- and load-balancer-scoped scans. Callers must hold b.mu while accessing either table or index.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new InMemoryBackend.

func (*InMemoryBackend) AddLoadBalancerInternal

func (b *InMemoryBackend) AddLoadBalancerInternal(lb LoadBalancer)

AddLoadBalancerInternal inserts a pre-built LoadBalancer for seeding test state. The lb is deep-copied on insertion. Tags is initialised if nil. Region defaults to the backend's configured region if unset, matching every other insertion path (e.g. CreateLoadBalancer) so the seeded LB is reachable via the default-region fallback in getRegion.

func (*InMemoryBackend) AddTags

func (b *InMemoryBackend) AddTags(ctx context.Context, names []string, kvs []tags.KV) error

AddTags adds or updates tags on one or more load balancers.

func (*InMemoryBackend) ApplySecurityGroupsToLoadBalancer

func (b *InMemoryBackend) ApplySecurityGroupsToLoadBalancer(
	ctx context.Context, name string, securityGroups []string,
) ([]string, error)

ApplySecurityGroupsToLoadBalancer replaces the security groups for a VPC load balancer.

func (*InMemoryBackend) AttachLoadBalancerToSubnets

func (b *InMemoryBackend) AttachLoadBalancerToSubnets(
	ctx context.Context, name string, subnets []string,
) ([]string, error)

AttachLoadBalancerToSubnets adds subnets to an existing load balancer.

func (*InMemoryBackend) ConfigureHealthCheck

func (b *InMemoryBackend) ConfigureHealthCheck(
	ctx context.Context, name string, hc HealthCheck,
) (*HealthCheck, error)

ConfigureHealthCheck sets the health-check configuration on a load balancer.

func (*InMemoryBackend) CreateAppCookieStickinessPolicy

func (b *InMemoryBackend) CreateAppCookieStickinessPolicy(
	ctx context.Context,
	name, policyName, cookieName string,
) error

CreateAppCookieStickinessPolicy creates an application-cookie stickiness policy.

func (*InMemoryBackend) CreateLBCookieStickinessPolicy

func (b *InMemoryBackend) CreateLBCookieStickinessPolicy(
	ctx context.Context, name, policyName string, cookieExpirationPeriod int64,
) error

CreateLBCookieStickinessPolicy creates an LB-cookie stickiness policy.

func (*InMemoryBackend) CreateLoadBalancer

func (b *InMemoryBackend) CreateLoadBalancer(
	ctx context.Context,
	input CreateLoadBalancerInput,
) (*LoadBalancer, error)

CreateLoadBalancer creates a new Classic ELB load balancer in the caller's region.

func (*InMemoryBackend) CreateLoadBalancerListeners

func (b *InMemoryBackend) CreateLoadBalancerListeners(ctx context.Context, name string, listeners []Listener) error

CreateLoadBalancerListeners adds listeners to an existing load balancer. Idempotent: if a listener on the same port already exists with identical settings, it is a no-op. Returns DuplicateListener if the port is in use with different settings.

func (*InMemoryBackend) CreateLoadBalancerPolicy

func (b *InMemoryBackend) CreateLoadBalancerPolicy(
	ctx context.Context,
	name, policyName, policyTypeName string,
	attrs []PolicyAttribute,
) error

CreateLoadBalancerPolicy creates a policy with custom attributes.

func (*InMemoryBackend) DeleteLoadBalancer

func (b *InMemoryBackend) DeleteLoadBalancer(ctx context.Context, name string) error

DeleteLoadBalancer removes a load balancer by name and all of its policies within the caller's region.

func (*InMemoryBackend) DeleteLoadBalancerListeners

func (b *InMemoryBackend) DeleteLoadBalancerListeners(ctx context.Context, name string, ports []int32) error

DeleteLoadBalancerListeners removes listeners by port from an existing load balancer.

func (*InMemoryBackend) DeleteLoadBalancerPolicy

func (b *InMemoryBackend) DeleteLoadBalancerPolicy(ctx context.Context, name, policyName string) error

DeleteLoadBalancerPolicy removes a policy from a load balancer.

func (*InMemoryBackend) DeregisterInstancesFromLoadBalancer

func (b *InMemoryBackend) DeregisterInstancesFromLoadBalancer(
	ctx context.Context, name string, instances []Instance,
) ([]Instance, error)

DeregisterInstancesFromLoadBalancer removes EC2 instances from a load balancer.

func (*InMemoryBackend) DescribeAccountLimits

func (b *InMemoryBackend) DescribeAccountLimits(_ context.Context) ([]AccountLimit, error)

DescribeAccountLimits returns the current ELB account limits.

func (*InMemoryBackend) DescribeInstanceHealth

func (b *InMemoryBackend) DescribeInstanceHealth(
	ctx context.Context, name string, instances []Instance,
) ([]InstanceState, error)

DescribeInstanceHealth returns the health state of registered instances.

func (*InMemoryBackend) DescribeLoadBalancerAttributes

func (b *InMemoryBackend) DescribeLoadBalancerAttributes(
	ctx context.Context, name string,
) (*LoadBalancerAttributes, error)

DescribeLoadBalancerAttributes returns the tunable attributes for a load balancer.

func (*InMemoryBackend) DescribeLoadBalancerPolicies

func (b *InMemoryBackend) DescribeLoadBalancerPolicies(
	ctx context.Context,
	name string,
	policyNames []string,
) ([]LoadBalancerPolicy, error)

DescribeLoadBalancerPolicies returns policies associated with the given load balancer, optionally filtered by policy names.

func (*InMemoryBackend) DescribeLoadBalancerPolicyTypes

func (b *InMemoryBackend) DescribeLoadBalancerPolicyTypes(
	_ context.Context, policyTypeNames []string,
) ([]PolicyTypeDescription, error)

DescribeLoadBalancerPolicyTypes returns the specified policy type descriptions. If policyTypeNames is non-empty, an error is returned for any unknown type name.

func (*InMemoryBackend) DescribeLoadBalancers

func (b *InMemoryBackend) DescribeLoadBalancers(ctx context.Context, names []string) ([]LoadBalancer, error)

DescribeLoadBalancers returns load balancers in the caller's region, optionally filtered by name.

func (*InMemoryBackend) DescribeTags

func (b *InMemoryBackend) DescribeTags(ctx context.Context, names []string) (map[string][]tags.KV, error)

DescribeTags returns the tags for the given load balancers.

func (*InMemoryBackend) DetachLoadBalancerFromSubnets

func (b *InMemoryBackend) DetachLoadBalancerFromSubnets(
	ctx context.Context, name string, subnets []string,
) ([]string, error)

DetachLoadBalancerFromSubnets removes subnets from an existing load balancer.

func (*InMemoryBackend) DisableAvailabilityZonesForLoadBalancer

func (b *InMemoryBackend) DisableAvailabilityZonesForLoadBalancer(
	ctx context.Context, name string, azs []string,
) ([]string, error)

DisableAvailabilityZonesForLoadBalancer removes availability zones from an existing load balancer.

func (*InMemoryBackend) EnableAvailabilityZonesForLoadBalancer

func (b *InMemoryBackend) EnableAvailabilityZonesForLoadBalancer(
	ctx context.Context, name string, azs []string,
) ([]string, error)

EnableAvailabilityZonesForLoadBalancer adds availability zones to an existing load balancer.

func (*InMemoryBackend) ModifyLoadBalancerAttributes

func (b *InMemoryBackend) ModifyLoadBalancerAttributes(
	ctx context.Context,
	name string,
	attrs LoadBalancerAttributes,
) (*LoadBalancerAttributes, error)

ModifyLoadBalancerAttributes updates the tunable attributes for a load balancer.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend was configured with. It is the fallback region used when a request context carries no region.

func (*InMemoryBackend) RegisterInstancesWithLoadBalancer

func (b *InMemoryBackend) RegisterInstancesWithLoadBalancer(
	ctx context.Context, name string, instances []Instance,
) ([]Instance, error)

RegisterInstancesWithLoadBalancer registers EC2 instances with a load balancer.

func (*InMemoryBackend) RemoveTags

func (b *InMemoryBackend) RemoveTags(ctx context.Context, names []string, keys []string) error

RemoveTags removes the specified tag keys from one or more load balancers.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all backend state across every region. All Tags registries are closed to avoid metric leaks.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot produced by Snapshot.

func (*InMemoryBackend) SetLoadBalancerListenerSSLCertificate

func (b *InMemoryBackend) SetLoadBalancerListenerSSLCertificate(
	ctx context.Context, name string, port int32, certID string,
) error

SetLoadBalancerListenerSSLCertificate sets the SSL certificate for an existing listener.

func (*InMemoryBackend) SetLoadBalancerPoliciesForBackendServer

func (b *InMemoryBackend) SetLoadBalancerPoliciesForBackendServer(
	ctx context.Context,
	name string,
	instancePort int32,
	policyNames []string,
) error

SetLoadBalancerPoliciesForBackendServer sets the policies for a backend server instance port.

func (*InMemoryBackend) SetLoadBalancerPoliciesOfListener

func (b *InMemoryBackend) SetLoadBalancerPoliciesOfListener(
	ctx context.Context, name string, port int32, policyNames []string,
) error

SetLoadBalancerPoliciesOfListener sets the policies for an existing listener.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON.

LoadBalancers is populated from a hand-built DTO list (lbSnapshot), not via b.registry.SnapshotAll(), because LoadBalancer carries a live *tags.Tags pointer whose zero-value JSON round-trip would reattach it to a generic "json.tags" Prometheus label instead of the per-resource "elb.<name>" label every other Tags-creation path in this backend uses (see fromLBSnapshot). Policies has no such live state, so it round-trips directly as a plain b.policies.Snapshot() -- a "clean" table in Phase 3.3 terms.

type Instance

type Instance struct {
	InstanceID string `json:"instanceId"`
}

Instance is an EC2 instance registered with a load balancer.

type InstanceState

type InstanceState struct {
	InstanceID  string
	State       string
	ReasonCode  string
	Description string
}

InstanceState represents the health state of a registered instance.

type Listener

type Listener struct {
	Protocol         string   `json:"protocol"`
	InstanceProtocol string   `json:"instanceProtocol"`
	SSLCertificateID string   `json:"sslCertificateId,omitempty"`
	PolicyNames      []string `json:"policyNames,omitempty"`
	LoadBalancerPort int32    `json:"loadBalancerPort"`
	InstancePort     int32    `json:"instancePort"`
}

Listener is a single protocol/port mapping on a load balancer.

type LoadBalancer

type LoadBalancer struct {
	CreatedTime               time.Time
	HealthCheck               *HealthCheck
	Tags                      *tags.Tags
	ARN                       string
	VPCId                     string
	Region                    string
	CanonicalHostedZoneName   string
	CanonicalHostedZoneNameID string
	Scheme                    string
	LoadBalancerName          string
	AccountID                 string
	DNSName                   string
	Listeners                 []Listener
	Instances                 []Instance
	BackendServerDescriptions []BackendServerDescription
	AvailabilityZones         []string
	SecurityGroups            []string
	Subnets                   []string
	Attributes                LoadBalancerAttributes
	IsVPC                     bool
}

LoadBalancer represents a Classic ELB load balancer.

type LoadBalancerAttributes

type LoadBalancerAttributes struct {
	DesyncMitigationMode      string    `json:"desyncMitigationMode"`
	AccessLog                 AccessLog `json:"accessLog"`
	ConnectionDrainingTimeout int32     `json:"connectionDrainingTimeout"`
	IdleTimeout               int32     `json:"idleTimeout"`
	CrossZoneLoadBalancing    bool      `json:"crossZoneLoadBalancing"`
	ConnectionDraining        bool      `json:"connectionDraining"`
}

LoadBalancerAttributes holds tunable attributes for a Classic ELB.

type LoadBalancerPolicy

type LoadBalancerPolicy struct {
	PolicyName                  string            `json:"policyName"`
	PolicyTypeName              string            `json:"policyTypeName"`
	LoadBalancerName            string            `json:"loadBalancerName"`
	Region                      string            `json:"region,omitempty"`
	PolicyAttributeDescriptions []PolicyAttribute `json:"policyAttributeDescriptions"`
}

LoadBalancerPolicy represents a Classic ELB policy.

type PolicyAttribute

type PolicyAttribute struct {
	AttributeName  string `json:"attributeName"`
	AttributeValue string `json:"attributeValue"`
}

PolicyAttribute is a single attribute for a load balancer policy.

type PolicyAttributeTypeDescription

type PolicyAttributeTypeDescription struct {
	AttributeName string
	AttributeType string
	Cardinality   string
	DefaultValue  string
	Description   string
}

PolicyAttributeTypeDescription describes the attributes of a policy type.

type PolicyTypeDescription

type PolicyTypeDescription struct {
	PolicyTypeName                  string
	Description                     string
	PolicyAttributeTypeDescriptions []PolicyAttributeTypeDescription
}

PolicyTypeDescription describes a Classic ELB policy type.

type Provider

type Provider struct{}

Provider implements service.Provider for the ELB service.

func (*Provider) Init

Init initializes the ELB backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the logical name of the provider.

type StorageBackend

type StorageBackend interface {
	Reset()
	Region() string

	CreateLoadBalancer(ctx context.Context, input CreateLoadBalancerInput) (*LoadBalancer, error)
	DeleteLoadBalancer(ctx context.Context, name string) error
	DescribeLoadBalancers(ctx context.Context, names []string) ([]LoadBalancer, error)

	CreateLoadBalancerListeners(ctx context.Context, name string, listeners []Listener) error
	DeleteLoadBalancerListeners(ctx context.Context, name string, ports []int32) error

	RegisterInstancesWithLoadBalancer(ctx context.Context, name string, instances []Instance) ([]Instance, error)
	DeregisterInstancesFromLoadBalancer(ctx context.Context, name string, instances []Instance) ([]Instance, error)

	ConfigureHealthCheck(ctx context.Context, name string, hc HealthCheck) (*HealthCheck, error)

	ModifyLoadBalancerAttributes(
		ctx context.Context, name string, attrs LoadBalancerAttributes,
	) (*LoadBalancerAttributes, error)
	DescribeLoadBalancerAttributes(ctx context.Context, name string) (*LoadBalancerAttributes, error)

	AddTags(ctx context.Context, names []string, kvs []tags.KV) error
	DescribeTags(ctx context.Context, names []string) (map[string][]tags.KV, error)
	RemoveTags(ctx context.Context, names []string, keys []string) error

	ApplySecurityGroupsToLoadBalancer(ctx context.Context, name string, securityGroups []string) ([]string, error)
	AttachLoadBalancerToSubnets(ctx context.Context, name string, subnets []string) ([]string, error)
	DetachLoadBalancerFromSubnets(ctx context.Context, name string, subnets []string) ([]string, error)
	EnableAvailabilityZonesForLoadBalancer(ctx context.Context, name string, azs []string) ([]string, error)
	DisableAvailabilityZonesForLoadBalancer(ctx context.Context, name string, azs []string) ([]string, error)
	SetLoadBalancerListenerSSLCertificate(ctx context.Context, name string, port int32, certID string) error
	SetLoadBalancerPoliciesOfListener(ctx context.Context, name string, port int32, policyNames []string) error
	SetLoadBalancerPoliciesForBackendServer(
		ctx context.Context, name string, instancePort int32, policyNames []string,
	) error

	CreateAppCookieStickinessPolicy(ctx context.Context, name, policyName, cookieName string) error
	CreateLBCookieStickinessPolicy(ctx context.Context, name, policyName string, cookieExpirationPeriod int64) error
	CreateLoadBalancerPolicy(
		ctx context.Context,
		name, policyName, policyTypeName string,
		attrs []PolicyAttribute,
	) error
	DeleteLoadBalancerPolicy(ctx context.Context, name, policyName string) error

	DescribeAccountLimits(ctx context.Context) ([]AccountLimit, error)
	DescribeInstanceHealth(ctx context.Context, name string, instances []Instance) ([]InstanceState, error)
	DescribeLoadBalancerPolicies(ctx context.Context, name string, policyNames []string) ([]LoadBalancerPolicy, error)
	DescribeLoadBalancerPolicyTypes(ctx context.Context, policyTypeNames []string) ([]PolicyTypeDescription, error)
}

StorageBackend is the interface for the ELB in-memory store.

Every operation that touches per-load-balancer state takes a context.Context so the backend can resolve the caller's AWS region and route the operation to that region's isolated store. Region returns the backend's default region for callers (e.g. the HTTP handler) that need a fallback when the request omits a region.

Jump to

Keyboard shortcuts

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