Documentation
¶
Index ¶
- Variables
- type Action
- type AuthenticateCognitoConfig
- type AuthenticateOidcConfig
- type AvailabilityZone
- type CapacityReservation
- type Certificate
- type Condition
- type CreateListenerInput
- type CreateLoadBalancerInput
- type CreateRuleInput
- type CreateTargetGroupInput
- type FixedResponseConfig
- type ForwardConfig
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AddListenerCertificates(listenerArn string, certs []Certificate) error
- func (b *InMemoryBackend) AddTags(resourceArns []string, kvs []tags.KV) error
- func (b *InMemoryBackend) AddTrustStoreRevocations(trustStoreArn string, contents []RevocationContentInput) ([]TrustStoreRevocation, error)
- func (b *InMemoryBackend) Close()
- func (b *InMemoryBackend) CreateListener(input CreateListenerInput) (*Listener, error)
- func (b *InMemoryBackend) CreateLoadBalancer(input CreateLoadBalancerInput) (*LoadBalancer, error)
- func (b *InMemoryBackend) CreateRule(input CreateRuleInput) (*Rule, error)
- func (b *InMemoryBackend) CreateTargetGroup(input CreateTargetGroupInput) (*TargetGroup, error)
- func (b *InMemoryBackend) CreateTrustStore(name string, kvs []tags.KV) (*TrustStore, error)
- func (b *InMemoryBackend) DeleteListener(listenerArn string) error
- func (b *InMemoryBackend) DeleteLoadBalancer(lbArn string) error
- func (b *InMemoryBackend) DeleteRule(ruleArn string) error
- func (b *InMemoryBackend) DeleteSharedTrustStoreAssociation(trustStoreArn, resourceArn string) error
- func (b *InMemoryBackend) DeleteTargetGroup(tgArn string) error
- func (b *InMemoryBackend) DeleteTrustStore(trustStoreArn string) error
- func (b *InMemoryBackend) DeregisterTargets(tgArn string, targets []Target) error
- func (b *InMemoryBackend) DescribeCapacityReservation(lbArn string) (*CapacityReservation, error)
- func (b *InMemoryBackend) DescribeListenerAttributes(listenerArn string) (map[string]string, error)
- func (b *InMemoryBackend) DescribeListenerCertificates(listenerArn string) ([]Certificate, error)
- func (b *InMemoryBackend) DescribeListeners(lbArn string, listenerArns []string) ([]Listener, error)
- func (b *InMemoryBackend) DescribeLoadBalancers(arns []string, names []string) ([]LoadBalancer, error)
- func (b *InMemoryBackend) DescribeRules(listenerArn string, ruleArns []string) ([]Rule, error)
- func (b *InMemoryBackend) DescribeTags(resourceArns []string) (map[string][]tags.KV, error)
- func (b *InMemoryBackend) DescribeTargetGroupAttributes(tgArn string) (map[string]string, error)
- func (b *InMemoryBackend) DescribeTargetGroups(arns []string, names []string, lbArn string) ([]TargetGroup, error)
- func (b *InMemoryBackend) DescribeTargetHealth(tgArn string) ([]TargetHealthDescription, error)
- func (b *InMemoryBackend) DescribeTrustStoreAssociations(trustStoreArn string) ([]string, error)
- func (b *InMemoryBackend) DescribeTrustStoreRevocations(trustStoreArn string) ([]TrustStoreRevocation, error)
- func (b *InMemoryBackend) DescribeTrustStores(arns []string, names []string) ([]TrustStore, error)
- func (b *InMemoryBackend) GetResourcePolicy(resourceArn string) (string, error)
- func (b *InMemoryBackend) ModifyCapacityReservation(lbArn string, minimumCapacityUnits *int32, reset bool) (*CapacityReservation, error)
- func (b *InMemoryBackend) ModifyIPPools(lbArn string, ipv4PoolID *string, removeIPv4 bool) (*LoadBalancer, error)
- func (b *InMemoryBackend) ModifyListener(input ModifyListenerInput) (*Listener, error)
- func (b *InMemoryBackend) ModifyListenerAttributes(listenerArn string, attrs map[string]string) (*Listener, error)
- func (b *InMemoryBackend) ModifyLoadBalancerAttributes(lbArn string, attrs map[string]string) (*LoadBalancer, error)
- func (b *InMemoryBackend) ModifyRule(ruleArn string, actions []Action, conditions []Condition) (*Rule, error)
- func (b *InMemoryBackend) ModifyTargetGroup(input ModifyTargetGroupInput) (*TargetGroup, error)
- func (b *InMemoryBackend) ModifyTargetGroupAttributes(tgArn string, attrs map[string]string) (*TargetGroup, error)
- func (b *InMemoryBackend) ModifyTrustStore(trustStoreArn, name string) (*TrustStore, error)
- func (b *InMemoryBackend) PutResourcePolicy(resourceArn, policy string) error
- func (b *InMemoryBackend) RegisterTargets(tgArn string, targets []Target) error
- func (b *InMemoryBackend) RemoveListenerCertificates(listenerArn string, certArns []string) error
- func (b *InMemoryBackend) RemoveTags(resourceArns []string, keys []string) error
- func (b *InMemoryBackend) RemoveTrustStoreRevocations(trustStoreArn string, revocationIDs []int64) error
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetIPAddressType(lbArn string, ipType string) (*LoadBalancer, error)
- func (b *InMemoryBackend) SetRulePriorities(priorities []RulePriority) ([]Rule, error)
- func (b *InMemoryBackend) SetSecurityGroups(lbArn string, sgs []string) (*LoadBalancer, error)
- func (b *InMemoryBackend) SetSubnets(lbArn string, mappings []SubnetMapping) (*LoadBalancer, error)
- func (b *InMemoryBackend) SetTargetHealthState(tgArn, targetID string, port int32, state, reason string) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- type Listener
- type LoadBalancer
- type LoadBalancerState
- type Matcher
- type ModifyListenerInput
- type ModifyTargetGroupInput
- type MutualAuthentication
- type Provider
- type QueryStringPair
- type RedirectConfig
- type RevocationContentInput
- type Rule
- type RulePriority
- type StorageBackend
- type SubnetMapping
- type Target
- type TargetGroup
- type TargetGroupTuple
- type TargetHealthDescription
- type TrustStore
- type TrustStoreRevocation
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLoadBalancerNotFound is returned when the requested load balancer does not exist. ErrLoadBalancerNotFound = awserr.New("LoadBalancerNotFound", awserr.ErrNotFound) // ErrTargetGroupNotFound is returned when the requested target group does not exist. ErrTargetGroupNotFound = awserr.New("TargetGroupNotFound", awserr.ErrNotFound) // ErrListenerNotFound is returned when the requested listener does not exist. ErrListenerNotFound = awserr.New("ListenerNotFound", awserr.ErrNotFound) // ErrRuleNotFound is returned when the requested rule does not exist. ErrRuleNotFound = awserr.New("RuleNotFound", awserr.ErrNotFound) // ErrTrustStoreNotFound is returned when the requested trust store does not exist. ErrTrustStoreNotFound = awserr.New("TrustStoreNotFound", awserr.ErrNotFound) // ErrLoadBalancerAlreadyExists is returned when a load balancer with that name already exists. ErrLoadBalancerAlreadyExists = awserr.New("DuplicateLoadBalancerName", awserr.ErrAlreadyExists) // ErrTargetGroupAlreadyExists is returned when a target group with that name already exists. ErrTargetGroupAlreadyExists = awserr.New("DuplicateTargetGroupName", awserr.ErrAlreadyExists) // ErrTrustStoreAlreadyExists is returned when a trust store with that name already exists. ErrTrustStoreAlreadyExists = awserr.New("DuplicateTrustStoreName", 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) // ErrDuplicateRulePriority is returned when two rules have the same priority. // AWS's real error code for this condition is "PriorityInUse" (PriorityInUseException), // not "DuplicatePriority" — verified against aws-sdk-go-v2/service/elasticloadbalancingv2/types. ErrDuplicateRulePriority = awserr.New("PriorityInUse", awserr.ErrInvalidParameter) // ErrOperationNotPermitted is returned when the operation is not allowed (e.g. deleting default rule). ErrOperationNotPermitted = awserr.New("OperationNotPermitted", awserr.ErrInvalidParameter) // ErrDuplicateListener is returned when a listener on the same port already exists. ErrDuplicateListener = awserr.New("DuplicateListener", awserr.ErrAlreadyExists) // ErrTargetGroupInUse is returned when attempting to delete a target group that is still referenced. ErrTargetGroupInUse = awserr.New("ResourceInUse", awserr.ErrInvalidParameter) // ErrInvalidConfigurationRequest is returned when a configuration is invalid for the LB type. ErrInvalidConfigurationRequest = awserr.New( "InvalidConfigurationRequest", awserr.ErrInvalidParameter, ) // ErrResourcePolicyNotFound is returned when no resource policy is set for a resource. ErrResourcePolicyNotFound = awserr.New("ResourceNotFound", awserr.ErrNotFound) // ErrTrustStoreAssociationNotFound is returned when a shared trust store association does not exist. ErrTrustStoreAssociationNotFound = awserr.New("AssociationNotFound", awserr.ErrNotFound) )
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
RedirectConfig *RedirectConfig `json:"redirectConfig,omitempty"`
FixedResponseConfig *FixedResponseConfig `json:"fixedResponseConfig,omitempty"`
ForwardConfig *ForwardConfig `json:"forwardConfig,omitempty"`
AuthenticateCognitoConfig *AuthenticateCognitoConfig `json:"authenticateCognitoConfig,omitempty"`
AuthenticateOidcConfig *AuthenticateOidcConfig `json:"authenticateOidcConfig,omitempty"`
Type string `json:"type"`
TargetGroupArn string `json:"targetGroupArn"`
Order int32 `json:"order,omitempty"`
}
Action represents a listener or rule action.
type AuthenticateCognitoConfig ¶
type AuthenticateCognitoConfig struct {
AuthenticationRequestExtraParams map[string]string `json:"authenticationRequestExtraParams,omitempty"`
UserPoolArn string `json:"userPoolArn"`
UserPoolClientID string `json:"userPoolClientId"`
UserPoolDomain string `json:"userPoolDomain"`
SessionCookieName string `json:"sessionCookieName,omitempty"`
Scope string `json:"scope,omitempty"`
OnUnauthenticatedRequest string `json:"onUnauthenticatedRequest,omitempty"`
SessionTimeout int64 `json:"sessionTimeout,omitempty"`
}
AuthenticateCognitoConfig holds configuration for authenticate-cognito actions.
type AuthenticateOidcConfig ¶
type AuthenticateOidcConfig struct {
AuthenticationRequestExtraParams map[string]string `json:"authenticationRequestExtraParams,omitempty"`
Issuer string `json:"issuer"`
AuthorizationEndpoint string `json:"authorizationEndpoint"`
TokenEndpoint string `json:"tokenEndpoint"`
UserInfoEndpoint string `json:"userInfoEndpoint"`
ClientID string `json:"clientId"`
ClientSecret string `json:"clientSecret,omitempty"`
SessionCookieName string `json:"sessionCookieName,omitempty"`
Scope string `json:"scope,omitempty"`
OnUnauthenticatedRequest string `json:"onUnauthenticatedRequest,omitempty"`
SessionTimeout int64 `json:"sessionTimeout,omitempty"`
}
AuthenticateOidcConfig holds configuration for authenticate-oidc actions.
type AvailabilityZone ¶
type AvailabilityZone struct {
ZoneName string `json:"zoneName"`
SubnetID string `json:"subnetId,omitempty"`
}
AvailabilityZone holds the zone name and subnet ID for an LB availability zone mapping.
type CapacityReservation ¶
type CapacityReservation struct {
LastModifiedTime time.Time `json:"lastModifiedTime"`
MinimumCapacityUnits int32 `json:"minimumCapacityUnits"`
DecreaseRequestsRemaining int32 `json:"decreaseRequestsRemaining"`
}
CapacityReservation holds the capacity reservation state for a load balancer, as set by ModifyCapacityReservation and read by DescribeCapacityReservation.
type Certificate ¶
type Certificate struct {
CertificateArn string `json:"certificateArn"`
IsDefault bool `json:"isDefault"`
}
Certificate represents a listener certificate.
type Condition ¶
type Condition struct {
// Field is the condition type: host-header, path-pattern, http-header,
// http-request-method, query-string, source-ip.
Field string `json:"field"`
// Values holds the condition values (used for host-header, path-pattern,
// http-request-method, source-ip).
Values []string `json:"values,omitempty"`
// RegexValues holds regular expressions to match instead of exact/wildcard
// Values. Valid only for host-header, path-pattern, and http-header conditions
// (types.RuleCondition.RegexValues / HostHeaderConditionConfig.RegexValues /
// PathPatternConditionConfig.RegexValues / HttpHeaderConditionConfig.RegexValues).
RegexValues []string `json:"regexValues,omitempty"`
// HTTPHeaderName is only set for http-header conditions.
HTTPHeaderName string `json:"httpHeaderName,omitempty"`
// QueryStringPairs holds key/value pairs for query-string conditions.
QueryStringPairs []QueryStringPair `json:"queryStringPairs,omitempty"`
}
Condition represents an ELBv2 rule condition (e.g. host-header, path-pattern, http-header).
type CreateListenerInput ¶
type CreateListenerInput struct {
MutualAuthentication *MutualAuthentication
LoadBalancerArn string
Protocol string
SSLPolicy string
AlpnPolicy []string
DefaultActions []Action
Tags []tags.KV
Certificates []Certificate
Port int32
}
CreateListenerInput holds the parameters for creating a listener.
type CreateLoadBalancerInput ¶
type CreateLoadBalancerInput struct {
Name string
Scheme string
Type string
IPAddressType string
Subnets []string // plain subnet IDs (Subnets.member.N)
SubnetMappings []SubnetMapping // rich subnet mappings (SubnetMappings.member.N)
SecurityGroups []string
Tags []tags.KV
}
CreateLoadBalancerInput holds the parameters for creating a load balancer.
type CreateRuleInput ¶
type CreateRuleInput struct {
ListenerArn string
Priority string
Actions []Action
Conditions []Condition
Tags []tags.KV
}
CreateRuleInput holds the parameters for creating a listener rule.
type CreateTargetGroupInput ¶
type CreateTargetGroupInput struct {
Name string
Protocol string
ProtocolVersion string
VpcID string
TargetType string
HealthCheckProtocol string
HealthCheckPort string
HealthCheckPath string
Matcher Matcher
Tags []tags.KV
Port int32
HealthCheckIntervalSeconds int32
HealthCheckTimeoutSeconds int32
HealthyThresholdCount int32
UnhealthyThresholdCount int32
HealthCheckEnabled bool
}
CreateTargetGroupInput holds the parameters for creating a target group.
type FixedResponseConfig ¶
type FixedResponseConfig struct {
MessageBody string `json:"messageBody,omitempty"`
StatusCode string `json:"statusCode"`
ContentType string `json:"contentType,omitempty"`
}
FixedResponseConfig holds configuration for fixed-response actions.
type ForwardConfig ¶
type ForwardConfig struct {
TargetGroups []TargetGroupTuple `json:"targetGroups,omitempty"`
}
ForwardConfig holds configuration for forward actions with multiple target groups.
type Handler ¶
type Handler struct {
Backend StorageBackend
// contains filtered or unexported fields
}
Handler is the Echo HTTP handler for ELBv2 operations.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new ELBv2 handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the ELBv2 action from the request.
func (*Handler) ExtractResource ¶
ExtractResource extracts the primary resource identifier from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported ELBv2 operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for ELBv2 operations.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches ELBv2 requests. ELBv2 requests are form-encoded POSTs with Version=2015-12-01.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new in-memory ELBv2 backend.
func (*InMemoryBackend) AddListenerCertificates ¶
func (b *InMemoryBackend) AddListenerCertificates(listenerArn string, certs []Certificate) error
AddListenerCertificates adds certificates to a listener.
func (*InMemoryBackend) AddTags ¶
func (b *InMemoryBackend) AddTags(resourceArns []string, kvs []tags.KV) error
AddTags adds or updates tags on ELBv2 resources.
func (*InMemoryBackend) AddTrustStoreRevocations ¶
func (b *InMemoryBackend) AddTrustStoreRevocations( trustStoreArn string, contents []RevocationContentInput, ) ([]TrustStoreRevocation, error)
AddTrustStoreRevocations appends revocation entries to a trust store, assigning each a monotonically increasing RevocationId (real AWS assigns this server-side; see RevocationContentInput doc comment). Returns the newly created revocations so the caller can echo them in the AddTrustStoreRevocationsResult response.
func (*InMemoryBackend) Close ¶
func (b *InMemoryBackend) Close()
Close stops the background health reconciler.
func (*InMemoryBackend) CreateListener ¶
func (b *InMemoryBackend) CreateListener(input CreateListenerInput) (*Listener, error)
CreateListener creates a new listener on a load balancer.
func (*InMemoryBackend) CreateLoadBalancer ¶
func (b *InMemoryBackend) CreateLoadBalancer(input CreateLoadBalancerInput) (*LoadBalancer, error)
CreateLoadBalancer creates a new load balancer.
func (*InMemoryBackend) CreateRule ¶
func (b *InMemoryBackend) CreateRule(input CreateRuleInput) (*Rule, error)
CreateRule creates a new rule on a listener.
func (*InMemoryBackend) CreateTargetGroup ¶
func (b *InMemoryBackend) CreateTargetGroup(input CreateTargetGroupInput) (*TargetGroup, error)
CreateTargetGroup creates a new target group.
func (*InMemoryBackend) CreateTrustStore ¶
func (b *InMemoryBackend) CreateTrustStore(name string, kvs []tags.KV) (*TrustStore, error)
CreateTrustStore creates a new trust store.
func (*InMemoryBackend) DeleteListener ¶
func (b *InMemoryBackend) DeleteListener(listenerArn string) error
DeleteListener deletes a listener by ARN.
func (*InMemoryBackend) DeleteLoadBalancer ¶
func (b *InMemoryBackend) DeleteLoadBalancer(lbArn string) error
DeleteLoadBalancer deletes a load balancer by ARN.
func (*InMemoryBackend) DeleteRule ¶
func (b *InMemoryBackend) DeleteRule(ruleArn string) error
DeleteRule deletes a rule by ARN.
func (*InMemoryBackend) DeleteSharedTrustStoreAssociation ¶
func (b *InMemoryBackend) DeleteSharedTrustStoreAssociation(trustStoreArn, resourceArn string) error
DeleteSharedTrustStoreAssociation removes the association between a trust store and a resource (listener). The association exists when the listener's MutualAuthentication references the trust store; deleting it clears that reference.
func (*InMemoryBackend) DeleteTargetGroup ¶
func (b *InMemoryBackend) DeleteTargetGroup(tgArn string) error
DeleteTargetGroup deletes a target group by ARN.
func (*InMemoryBackend) DeleteTrustStore ¶
func (b *InMemoryBackend) DeleteTrustStore(trustStoreArn string) error
DeleteTrustStore deletes a trust store by ARN.
func (*InMemoryBackend) DeregisterTargets ¶
func (b *InMemoryBackend) DeregisterTargets(tgArn string, targets []Target) error
DeregisterTargets transitions targets to draining state. They are removed after the deregistration_delay.timeout_seconds attribute expires.
func (*InMemoryBackend) DescribeCapacityReservation ¶
func (b *InMemoryBackend) DescribeCapacityReservation(lbArn string) (*CapacityReservation, error)
DescribeCapacityReservation returns the capacity reservation state for a load balancer.
func (*InMemoryBackend) DescribeListenerAttributes ¶
func (b *InMemoryBackend) DescribeListenerAttributes( listenerArn string, ) (map[string]string, error)
DescribeListenerAttributes returns attributes for a listener.
func (*InMemoryBackend) DescribeListenerCertificates ¶
func (b *InMemoryBackend) DescribeListenerCertificates(listenerArn string) ([]Certificate, error)
DescribeListenerCertificates returns certificates on a listener.
func (*InMemoryBackend) DescribeListeners ¶
func (b *InMemoryBackend) DescribeListeners( lbArn string, listenerArns []string, ) ([]Listener, error)
DescribeListeners returns listeners filtered by load balancer ARN and/or listener ARNs. The returned Listener values contain a Tags pointer that is backend-owned; callers must treat it as read-only.
Fast path: when only listener ARNs are supplied (no lbArn filter), look them up directly in the ARN-keyed map instead of scanning every listener.
func (*InMemoryBackend) DescribeLoadBalancers ¶
func (b *InMemoryBackend) DescribeLoadBalancers( arns []string, names []string, ) ([]LoadBalancer, error)
DescribeLoadBalancers returns load balancers filtered by ARNs and/or names. The returned LoadBalancer values contain a Tags pointer that is backend-owned; callers must treat it as read-only.
Fast path: when only ARNs are supplied (no names), look them up directly in the ARN-keyed map instead of scanning every load balancer in the backend.
func (*InMemoryBackend) DescribeRules ¶
func (b *InMemoryBackend) DescribeRules(listenerArn string, ruleArns []string) ([]Rule, error)
DescribeRules returns rules filtered by listener ARN and/or rule ARNs.
Fast path: when only rule ARNs are supplied (no listenerArn filter), look them up directly in the ARN-keyed map instead of scanning every rule.
func (*InMemoryBackend) DescribeTags ¶
DescribeTags returns tags for the specified resource ARNs.
func (*InMemoryBackend) DescribeTargetGroupAttributes ¶
func (b *InMemoryBackend) DescribeTargetGroupAttributes(tgArn string) (map[string]string, error)
DescribeTargetGroupAttributes returns attributes for a target group.
func (*InMemoryBackend) DescribeTargetGroups ¶
func (b *InMemoryBackend) DescribeTargetGroups( arns []string, names []string, lbArn string, ) ([]TargetGroup, error)
DescribeTargetGroups returns target groups filtered by ARNs, names, or load balancer ARN. The returned TargetGroup values contain a Tags pointer that is backend-owned; callers must treat it as read-only.
Fast path: when only ARNs are supplied (no names, no lbArn), look them up directly in the ARN-keyed map instead of scanning every target group.
func (*InMemoryBackend) DescribeTargetHealth ¶
func (b *InMemoryBackend) DescribeTargetHealth(tgArn string) ([]TargetHealthDescription, error)
DescribeTargetHealth returns health descriptions for targets registered with the target group.
func (*InMemoryBackend) DescribeTrustStoreAssociations ¶
func (b *InMemoryBackend) DescribeTrustStoreAssociations(trustStoreArn string) ([]string, error)
DescribeTrustStoreAssociations returns listener ARNs whose trust store is set to this ARN.
func (*InMemoryBackend) DescribeTrustStoreRevocations ¶
func (b *InMemoryBackend) DescribeTrustStoreRevocations( trustStoreArn string, ) ([]TrustStoreRevocation, error)
DescribeTrustStoreRevocations returns revocation entries for a trust store.
func (*InMemoryBackend) DescribeTrustStores ¶
func (b *InMemoryBackend) DescribeTrustStores(arns []string, names []string) ([]TrustStore, error)
DescribeTrustStores returns trust stores filtered by ARNs and/or names.
func (*InMemoryBackend) GetResourcePolicy ¶
func (b *InMemoryBackend) GetResourcePolicy(resourceArn string) (string, error)
GetResourcePolicy returns the stored resource policy for a resource ARN.
func (*InMemoryBackend) ModifyCapacityReservation ¶
func (b *InMemoryBackend) ModifyCapacityReservation( lbArn string, minimumCapacityUnits *int32, reset bool, ) (*CapacityReservation, error)
ModifyCapacityReservation persists capacity reservation state on a load balancer.
func (*InMemoryBackend) ModifyIPPools ¶
func (b *InMemoryBackend) ModifyIPPools( lbArn string, ipv4PoolID *string, removeIPv4 bool, ) (*LoadBalancer, error)
ModifyIPPools updates the IPAM pool configuration on a load balancer.
func (*InMemoryBackend) ModifyListener ¶
func (b *InMemoryBackend) ModifyListener(input ModifyListenerInput) (*Listener, error)
ModifyListener updates the properties of an existing listener.
func (*InMemoryBackend) ModifyListenerAttributes ¶
func (b *InMemoryBackend) ModifyListenerAttributes( listenerArn string, attrs map[string]string, ) (*Listener, error)
ModifyListenerAttributes updates attributes on a listener.
func (*InMemoryBackend) ModifyLoadBalancerAttributes ¶
func (b *InMemoryBackend) ModifyLoadBalancerAttributes( lbArn string, attrs map[string]string, ) (*LoadBalancer, error)
ModifyLoadBalancerAttributes updates attributes on a load balancer.
func (*InMemoryBackend) ModifyRule ¶
func (b *InMemoryBackend) ModifyRule( ruleArn string, actions []Action, conditions []Condition, ) (*Rule, error)
ModifyRule updates the actions and/or conditions of an existing rule.
func (*InMemoryBackend) ModifyTargetGroup ¶
func (b *InMemoryBackend) ModifyTargetGroup(input ModifyTargetGroupInput) (*TargetGroup, error)
ModifyTargetGroup updates health-check settings on a target group.
func (*InMemoryBackend) ModifyTargetGroupAttributes ¶
func (b *InMemoryBackend) ModifyTargetGroupAttributes( tgArn string, attrs map[string]string, ) (*TargetGroup, error)
ModifyTargetGroupAttributes updates attributes on a target group.
func (*InMemoryBackend) ModifyTrustStore ¶
func (b *InMemoryBackend) ModifyTrustStore(trustStoreArn, name string) (*TrustStore, error)
ModifyTrustStore updates a trust store's name.
func (*InMemoryBackend) PutResourcePolicy ¶
func (b *InMemoryBackend) PutResourcePolicy(resourceArn, policy string) error
PutResourcePolicy stores a resource policy keyed by resource ARN.
func (*InMemoryBackend) RegisterTargets ¶
func (b *InMemoryBackend) RegisterTargets(tgArn string, targets []Target) error
RegisterTargets registers targets with a target group.
func (*InMemoryBackend) RemoveListenerCertificates ¶
func (b *InMemoryBackend) RemoveListenerCertificates(listenerArn string, certArns []string) error
RemoveListenerCertificates removes certificate ARNs from a listener.
func (*InMemoryBackend) RemoveTags ¶
func (b *InMemoryBackend) RemoveTags(resourceArns []string, keys []string) error
RemoveTags removes tags from ELBv2 resources.
func (*InMemoryBackend) RemoveTrustStoreRevocations ¶
func (b *InMemoryBackend) RemoveTrustStoreRevocations( trustStoreArn string, revocationIDs []int64, ) error
RemoveTrustStoreRevocations removes revocation entries from a trust store by RevocationID.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.
func (*InMemoryBackend) SetIPAddressType ¶
func (b *InMemoryBackend) SetIPAddressType(lbArn string, ipType string) (*LoadBalancer, error)
SetIPAddressType updates the IP address type of a load balancer.
func (*InMemoryBackend) SetRulePriorities ¶
func (b *InMemoryBackend) SetRulePriorities(priorities []RulePriority) ([]Rule, error)
SetRulePriorities updates the priorities of one or more rules.
func (*InMemoryBackend) SetSecurityGroups ¶
func (b *InMemoryBackend) SetSecurityGroups(lbArn string, sgs []string) (*LoadBalancer, error)
SetSecurityGroups updates the security groups associated with a load balancer.
func (*InMemoryBackend) SetSubnets ¶
func (b *InMemoryBackend) SetSubnets( lbArn string, mappings []SubnetMapping, ) (*LoadBalancer, error)
SetSubnets updates the availability zones / subnets associated with a load balancer.
func (*InMemoryBackend) SetTargetHealthState ¶
func (b *InMemoryBackend) SetTargetHealthState( tgArn, targetID string, port int32, state, reason string, ) error
SetTargetHealthState overrides the health state for a specific target in a target group. Used in tests to simulate health state transitions.
type Listener ¶
type Listener struct {
Tags *tags.Tags `json:"tags,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
MutualAuthentication *MutualAuthentication `json:"mutualAuthentication,omitempty"`
ListenerArn string `json:"listenerArn"`
LoadBalancerArn string `json:"loadBalancerArn"`
Protocol string `json:"protocol"`
SSLPolicy string `json:"sslPolicy,omitempty"`
// AlpnPolicy is a list on the wire (AlpnPolicy.member.N / <AlpnPolicy><member>…),
// not a bare string — verified against aws-sdk-go-v2 types.Listener.AlpnPolicy ([]string).
AlpnPolicy []string `json:"alpnPolicy,omitempty"`
DefaultActions []Action `json:"defaultActions"`
Certificates []Certificate `json:"certificates,omitempty"`
Port int32 `json:"port"`
}
Listener represents an ELBv2 listener.
type LoadBalancer ¶
type LoadBalancer struct {
CreatedTime time.Time `json:"createdTime"`
State LoadBalancerState `json:"state"`
Tags *tags.Tags `json:"tags,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
CapacityReservation *CapacityReservation `json:"capacityReservation,omitempty"`
LoadBalancerArn string `json:"loadBalancerArn"`
LoadBalancerName string `json:"loadBalancerName"`
DNSName string `json:"dnsName"`
CanonicalHostedZoneID string `json:"canonicalHostedZoneId"`
VpcID string `json:"vpcId"`
Scheme string `json:"scheme"`
Type string `json:"type"`
IPAddressType string `json:"ipAddressType"`
IPv4IPAMPoolID string `json:"ipv4IpamPoolId,omitempty"`
AvailabilityZones []AvailabilityZone `json:"availabilityZones"`
SecurityGroups []string `json:"securityGroups"`
}
LoadBalancer represents an ELBv2 load balancer.
type LoadBalancerState ¶
LoadBalancerState represents the state of a load balancer.
type Matcher ¶
type Matcher struct {
HTTPCode string `json:"httpCode,omitempty"`
GrpcCode string `json:"grpcCode,omitempty"`
}
Matcher holds health-check matcher codes for a target group.
type ModifyListenerInput ¶
type ModifyListenerInput struct {
MutualAuthentication *MutualAuthentication
ListenerArn string
Protocol string
SSLPolicy string
AlpnPolicy []string
DefaultActions []Action
Certificates []Certificate
Port int32
}
ModifyListenerInput holds the parameters for modifying a listener.
type ModifyTargetGroupInput ¶
type ModifyTargetGroupInput struct {
HealthCheckEnabled *bool
Matcher Matcher
TargetGroupArn string
HealthCheckProtocol string
HealthCheckPort string
HealthCheckPath string
HealthCheckIntervalSeconds int32
HealthCheckTimeoutSeconds int32
HealthyThresholdCount int32
UnhealthyThresholdCount int32
}
ModifyTargetGroupInput holds the parameters for modifying a target group. HealthCheckEnabled is a pointer so that an absent parameter does not overwrite the stored value.
type MutualAuthentication ¶
type MutualAuthentication struct {
TrustStoreArn string `json:"trustStoreArn,omitempty"`
Mode string `json:"mode"`
IgnoreClientCertificateExpiration bool `json:"ignoreClientCertificateExpiration,omitempty"`
}
MutualAuthentication holds mTLS configuration for a listener.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the ELBv2 service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the ELBv2 backend and handler.
type QueryStringPair ¶
QueryStringPair is a key/value pair used in query-string rule conditions.
type RedirectConfig ¶
type RedirectConfig struct {
Protocol string `json:"protocol,omitempty"`
Port string `json:"port,omitempty"`
Host string `json:"host,omitempty"`
Path string `json:"path,omitempty"`
Query string `json:"query,omitempty"`
StatusCode string `json:"statusCode"`
}
RedirectConfig holds configuration for redirect actions.
type RevocationContentInput ¶ added in v1.2.0
type RevocationContentInput struct {
S3Bucket string `json:"s3Bucket,omitempty"`
S3Key string `json:"s3Key,omitempty"`
S3ObjectVersion string `json:"s3ObjectVersion,omitempty"`
RevocationType string `json:"revocationType,omitempty"`
}
RevocationContentInput represents a single revocation-file reference submitted to AddTrustStoreRevocations. Mirrors aws-sdk-go-v2 types.RevocationContent exactly -- S3Bucket/S3Key/S3ObjectVersion/RevocationType is the only real wire shape; there is no plain/inline revocation-content field on the real API.
type Rule ¶
type Rule struct {
Tags *tags.Tags `json:"tags,omitempty"`
RuleArn string `json:"ruleArn"`
ListenerArn string `json:"listenerArn"`
Priority string `json:"priority"`
Actions []Action `json:"actions"`
Conditions []Condition `json:"conditions,omitempty"`
IsDefault bool `json:"isDefault"`
}
Rule represents an ELBv2 listener rule.
type RulePriority ¶
RulePriority holds an ARN-to-priority mapping used by SetRulePriorities.
type StorageBackend ¶
type StorageBackend interface {
CreateLoadBalancer(input CreateLoadBalancerInput) (*LoadBalancer, error)
DescribeLoadBalancers(arns []string, names []string) ([]LoadBalancer, error)
DeleteLoadBalancer(lbArn string) error
ModifyLoadBalancerAttributes(lbArn string, attrs map[string]string) (*LoadBalancer, error)
SetSecurityGroups(lbArn string, sgs []string) (*LoadBalancer, error)
SetSubnets(lbArn string, mappings []SubnetMapping) (*LoadBalancer, error)
SetIPAddressType(lbArn string, ipType string) (*LoadBalancer, error)
CreateTargetGroup(input CreateTargetGroupInput) (*TargetGroup, error)
DescribeTargetGroups(arns []string, names []string, lbArn string) ([]TargetGroup, error)
DeleteTargetGroup(tgArn string) error
ModifyTargetGroup(input ModifyTargetGroupInput) (*TargetGroup, error)
ModifyTargetGroupAttributes(tgArn string, attrs map[string]string) (*TargetGroup, error)
DescribeTargetGroupAttributes(tgArn string) (map[string]string, error)
RegisterTargets(tgArn string, targets []Target) error
DeregisterTargets(tgArn string, targets []Target) error
DescribeTargetHealth(tgArn string) ([]TargetHealthDescription, error)
CreateListener(input CreateListenerInput) (*Listener, error)
DescribeListeners(lbArn string, listenerArns []string) ([]Listener, error)
DeleteListener(listenerArn string) error
ModifyListener(input ModifyListenerInput) (*Listener, error)
ModifyListenerAttributes(listenerArn string, attrs map[string]string) (*Listener, error)
DescribeListenerAttributes(listenerArn string) (map[string]string, error)
CreateRule(input CreateRuleInput) (*Rule, error)
DescribeRules(listenerArn string, ruleArns []string) ([]Rule, error)
DeleteRule(ruleArn string) error
ModifyRule(ruleArn string, actions []Action, conditions []Condition) (*Rule, error)
AddTags(resourceArns []string, kvs []tags.KV) error
RemoveTags(resourceArns []string, keys []string) error
DescribeTags(resourceArns []string) (map[string][]tags.KV, error)
// TrustStore operations.
CreateTrustStore(name string, kvs []tags.KV) (*TrustStore, error)
DescribeTrustStores(arns []string, names []string) ([]TrustStore, error)
DeleteTrustStore(trustStoreArn string) error
ModifyTrustStore(trustStoreArn, name string) (*TrustStore, error)
AddTrustStoreRevocations(
trustStoreArn string,
contents []RevocationContentInput,
) ([]TrustStoreRevocation, error)
RemoveTrustStoreRevocations(trustStoreArn string, revocationIDs []int64) error
DescribeTrustStoreRevocations(trustStoreArn string) ([]TrustStoreRevocation, error)
DescribeTrustStoreAssociations(trustStoreArn string) ([]string, error)
// Capacity reservation operations.
ModifyCapacityReservation(lbArn string, minimumCapacityUnits *int32, reset bool) (*CapacityReservation, error)
DescribeCapacityReservation(lbArn string) (*CapacityReservation, error)
// IP pool operations.
ModifyIPPools(lbArn string, ipv4PoolID *string, removeIPv4 bool) (*LoadBalancer, error)
// Resource policy operations.
GetResourcePolicy(resourceArn string) (string, error)
PutResourcePolicy(resourceArn, policy string) error
// Rule priority operations.
SetRulePriorities(priorities []RulePriority) ([]Rule, error)
// Listener certificate operations.
AddListenerCertificates(listenerArn string, certs []Certificate) error
DescribeListenerCertificates(listenerArn string) ([]Certificate, error)
RemoveListenerCertificates(listenerArn string, certArns []string) error
}
StorageBackend is the interface for ELBv2 storage operations.
type SubnetMapping ¶
type SubnetMapping struct {
SubnetID string
AllocationID string
PrivateIPv4Address string
IPv6Address string
}
SubnetMapping holds subnet configuration for CreateLoadBalancer and SetSubnets.
type Target ¶
type Target struct {
ID string `json:"id"`
HealthState string `json:"healthState,omitempty"`
HealthReason string `json:"healthReason,omitempty"`
Port int32 `json:"port"`
}
Target represents a registered target in a target group.
type TargetGroup ¶
type TargetGroup struct {
Tags *tags.Tags `json:"tags,omitempty"`
TargetGroupAttributes map[string]string `json:"targetGroupAttributes,omitempty"`
TargetGroupArn string `json:"targetGroupArn"`
TargetGroupName string `json:"targetGroupName"`
Protocol string `json:"protocol"`
ProtocolVersion string `json:"protocolVersion,omitempty"`
VpcID string `json:"vpcId"`
TargetType string `json:"targetType"`
HealthCheckProtocol string `json:"healthCheckProtocol"`
HealthCheckPort string `json:"healthCheckPort"`
HealthCheckPath string `json:"healthCheckPath"`
Matcher Matcher `json:"matcher"`
Targets []Target `json:"targets"`
LoadBalancerArns []string `json:"loadBalancerArns,omitempty"`
Port int32 `json:"port"`
HealthCheckIntervalSeconds int32 `json:"healthCheckIntervalSeconds"`
HealthCheckTimeoutSeconds int32 `json:"healthCheckTimeoutSeconds"`
HealthyThresholdCount int32 `json:"healthyThresholdCount"`
UnhealthyThresholdCount int32 `json:"unhealthyThresholdCount"`
HealthCheckEnabled bool `json:"healthCheckEnabled"`
CrossZoneLoadBalancing bool `json:"crossZoneLoadBalancing"`
}
TargetGroup represents an ELBv2 target group.
type TargetGroupTuple ¶
type TargetGroupTuple struct {
TargetGroupArn string `json:"targetGroupArn"`
Weight int32 `json:"weight,omitempty"`
}
TargetGroupTuple is a target group reference used in ForwardConfig.
type TargetHealthDescription ¶
type TargetHealthDescription struct {
HealthState string `json:"healthState"`
HealthReason string `json:"healthReason,omitempty"`
Target Target `json:"target"`
}
TargetHealthDescription describes the health state of a registered target.
type TrustStore ¶
type TrustStore struct {
Tags *tags.Tags `json:"tags,omitempty"`
TrustStoreArn string `json:"trustStoreArn"`
Name string `json:"name"`
Status string `json:"status"`
Revocations []TrustStoreRevocation `json:"revocations,omitempty"`
TotalRevokedEntries int64 `json:"totalRevokedEntries"`
}
TrustStore represents an ELBv2 trust store.
type TrustStoreRevocation ¶
type TrustStoreRevocation struct {
RevocationType string `json:"revocationType"`
RevocationID int64 `json:"revocationId"`
NumberOfRevokedEntries int64 `json:"numberOfRevokedEntries"`
}
TrustStoreRevocation represents a single revocation entry stored in a trust store. RevocationID is int64 -- verified against aws-sdk-go-v2 types.TrustStoreRevocation / types.DescribeTrustStoreRevocation (RevocationId *int64). AWS assigns this ID itself when it parses the uploaded revocation file; it is never client-supplied.
Source Files
¶
- capacity.go
- errors.go
- handler.go
- handler_account_limits.go
- handler_capacity.go
- handler_listener_certificates.go
- handler_listener_rules.go
- handler_listeners.go
- handler_load_balancers.go
- handler_ssl_policies.go
- handler_tags.go
- handler_target_groups.go
- handler_targets.go
- handler_trust_stores.go
- interfaces.go
- listener_certificates.go
- listener_rules.go
- listeners.go
- load_balancers.go
- models.go
- persistence.go
- provider.go
- store.go
- store_setup.go
- tags.go
- target_groups.go
- targets.go
- trust_stores.go