route53recoverycontrolconfig

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 23 Imported by: 0

README

Route 53 Recovery Control Config

Parity grade: A · SDK aws-sdk-go-v2/service/route53recoverycontrolconfig@v1.40.4 · last audited 2026-10-14 (80b7bb8b3)

Coverage

Metric Value
PARITY entries audited 25 (25 ok)
Feature families 2 (2 ok)
Known gaps none
Structural gaps (can't be emulated) 1
Deferred items 0
Resource leaks clean
Structural gaps

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • GetResourcePolicy cannot return a policy: ARC policies come from RAM sharing, but services/ram has no ARC shareable resource types or managed permissions, and the SDK does not publish the policy AWS attaches

More

Documentation

Overview

Package route53recoverycontrolconfig emulates the Route 53 Application Recovery Controller control plane.

Index

Constants

This section is empty.

Variables

View Source
var ErrNilAppContext = errors.New("route53recoverycontrolconfig: AppContext must not be nil")

ErrNilAppContext is returned by Init when no AppContext is supplied.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	CreatedAt   time.Time         `json:"createdAt"`
	DeletedAt   *time.Time        `json:"deletedAt,omitempty"`
	Tags        map[string]string `json:"tags,omitempty"`
	ARN         string            `json:"arn"`
	Name        string            `json:"name"`
	NetworkType string            `json:"networkType"`
}

Cluster is a Route 53 ARC cluster.

type ConflictError

type ConflictError struct {
	RuleARN string
	Message string
}

ConflictError is a data-plane rejection naming the safety rule that blocked an update.

func (*ConflictError) Error

func (e *ConflictError) Error() string

type ControlPanel

type ControlPanel struct {
	CreatedAt  time.Time         `json:"createdAt"`
	DeletedAt  *time.Time        `json:"deletedAt,omitempty"`
	Tags       map[string]string `json:"tags,omitempty"`
	ARN        string            `json:"arn"`
	ClusterARN string            `json:"clusterArn"`
	Name       string            `json:"name"`
	Default    bool              `json:"default,omitempty"`
}

ControlPanel groups routing controls and safety rules inside a cluster.

type Handler

type Handler struct {
	Backend *InMemoryBackend

	DefaultRegion string
	// contains filtered or unexported fields
}

Handler serves the Route 53 Recovery Control Config control plane.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates the handler.

func (*Handler) ChaosOperations

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

ChaosOperations returns the fault-injectable operations.

func (*Handler) ChaosRegions

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

ChaosRegions returns the regions served.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase service name for fault rules.

func (*Handler) ExtractOperation

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

ExtractOperation returns the operation name for metrics.

func (*Handler) ExtractResource

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

ExtractResource returns the primary ARN label for metrics.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations lists every implemented operation.

func (*Handler) Handler

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

Handler returns the Echo handler.

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 all state.

func (*Handler) Restore

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

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

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

RouteMatcher matches by SigV4 signing name (or SDK user agent) plus a known path shape.

func (*Handler) RoutingControlIsOn

func (h *Handler) RoutingControlIsOn(arn string) (bool, bool)

RoutingControlIsOn reports (on, found) for a routing control, for sibling services.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable.

type InMemoryBackend

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

InMemoryBackend holds the Route 53 ARC control plane: clusters, control panels, routing controls, safety rules.

func NewInMemoryBackend

func NewInMemoryBackend(accountID string) *InMemoryBackend

NewInMemoryBackend creates an empty backend for accountID.

func (*InMemoryBackend) AssociatedHealthCheckIDs

func (b *InMemoryBackend) AssociatedHealthCheckIDs(routingControlArn string) ([]string, error)

AssociatedHealthCheckIDs lists the Route 53 RECOVERY_CONTROL health checks bound to a routing control.

func (*InMemoryBackend) CreateCluster

func (b *InMemoryBackend) CreateCluster(
	ctx context.Context,
	name, networkType, token string,
	tags map[string]string,
) (wireCluster, error)

CreateCluster creates a cluster together with its default control panel.

func (*InMemoryBackend) CreateControlPanel

func (b *InMemoryBackend) CreateControlPanel(
	clusterArn, name, token string,
	tags map[string]string,
) (wireControlPanel, error)

CreateControlPanel creates a custom control panel in a cluster.

func (*InMemoryBackend) CreateRoutingControl

func (b *InMemoryBackend) CreateRoutingControl(clusterArn, panelArn, name, token string) (wireRoutingControl, error)

CreateRoutingControl creates a routing control (state Off) in the given or the cluster's default control panel.

func (*InMemoryBackend) CreateSafetyRule

func (b *InMemoryBackend) CreateSafetyRule(spec *NewRuleSpec, token string, tags map[string]string) (wireRule, error)

CreateSafetyRule creates an assertion or gating rule.

func (*InMemoryBackend) DeleteCluster

func (b *InMemoryBackend) DeleteCluster(arn string) error

DeleteCluster removes a cluster; it must not hold custom control panels, routing controls or safety rules.

func (*InMemoryBackend) DeleteControlPanel

func (b *InMemoryBackend) DeleteControlPanel(arn string) error

DeleteControlPanel deletes an empty, non-default control panel.

func (*InMemoryBackend) DeleteRoutingControl

func (b *InMemoryBackend) DeleteRoutingControl(arn string) error

DeleteRoutingControl deletes a routing control that no safety rule references.

func (*InMemoryBackend) DeleteSafetyRule

func (b *InMemoryBackend) DeleteSafetyRule(arn string) error

DeleteSafetyRule deletes a rule.

func (*InMemoryBackend) DescribeCluster

func (b *InMemoryBackend) DescribeCluster(ctx context.Context, arn string) (wireCluster, error)

DescribeCluster returns one cluster.

func (*InMemoryBackend) DescribeControlPanel

func (b *InMemoryBackend) DescribeControlPanel(arn string) (wireControlPanel, error)

DescribeControlPanel returns one control panel.

func (*InMemoryBackend) DescribeRoutingControl

func (b *InMemoryBackend) DescribeRoutingControl(arn string) (wireRoutingControl, error)

DescribeRoutingControl returns one routing control.

func (*InMemoryBackend) DescribeSafetyRule

func (b *InMemoryBackend) DescribeSafetyRule(arn string) (wireRule, error)

DescribeSafetyRule returns one rule.

func (*InMemoryBackend) ListClusters

func (b *InMemoryBackend) ListClusters(
	ctx context.Context,
	token string,
	maxResults int,
) ([]wireCluster, string, error)

ListClusters lists clusters.

func (*InMemoryBackend) ListControlPanels

func (b *InMemoryBackend) ListControlPanels(
	clusterArn, token string,
	maxResults int,
) ([]wireControlPanel, string, error)

ListControlPanels lists panels, optionally restricted to one cluster.

func (*InMemoryBackend) ListRoutingControlStates

func (b *InMemoryBackend) ListRoutingControlStates(
	panelArn, clusterID, token string,
	maxResults int,
) ([]StateView, string, error)

ListRoutingControlStates lists routing control states, optionally by control panel and/or cluster.

func (*InMemoryBackend) ListRoutingControls

func (b *InMemoryBackend) ListRoutingControls(
	panelArn, token string,
	maxResults int,
) ([]wireRoutingControl, string, error)

ListRoutingControls lists the routing controls of a control panel.

func (*InMemoryBackend) ListSafetyRules

func (b *InMemoryBackend) ListSafetyRules(panelArn, token string, maxResults int) ([]wireRule, string, error)

ListSafetyRules lists the rules of a control panel.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(arn string) (map[string]string, error)

ListTagsForResource returns a resource's tags.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

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

Restore loads a snapshot; an incompatible version starts empty. It implements persistence.Persistable.

func (*InMemoryBackend) RoutingControlIsOn

func (b *InMemoryBackend) RoutingControlIsOn(arn string) (bool, bool)

RoutingControlIsOn reports (on, found) for a routing control, for sibling services (Route 53 health checks).

func (*InMemoryBackend) RoutingControlState

func (b *InMemoryBackend) RoutingControlState(arn, clusterID string) (StateView, error)

RoutingControlState returns one routing control's state; clusterID, when set, scopes it to that cluster.

func (*InMemoryBackend) SetActivationDelay

func (b *InMemoryBackend) SetActivationDelay(d time.Duration)

SetActivationDelay keeps new resources PENDING (and deleted ones PENDING_DELETION) for d; 0 makes both instant.

func (*InMemoryBackend) SetAppConfig

func (b *InMemoryBackend) SetAppConfig(cfg any)

SetAppConfig records service.AppContext.Config so siblings are resolved at call time, after every provider exists.

func (*InMemoryBackend) SetExternalEndpoint

func (b *InMemoryBackend) SetExternalEndpoint(base string)

SetExternalEndpoint pins the base URL of cluster endpoints, overriding the caller's host.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state. It implements persistence.Persistable.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(arn string, tags map[string]string) error

TagResource adds or overwrites tags.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(arn string, keys []string) error

UntagResource removes tags by key.

func (*InMemoryBackend) UpdateCluster

func (b *InMemoryBackend) UpdateCluster(ctx context.Context, arn, networkType string) (wireCluster, error)

UpdateCluster changes the network type.

func (*InMemoryBackend) UpdateControlPanel

func (b *InMemoryBackend) UpdateControlPanel(arn, name string) (wireControlPanel, error)

UpdateControlPanel renames a control panel.

func (*InMemoryBackend) UpdateRoutingControl

func (b *InMemoryBackend) UpdateRoutingControl(arn, name string) (wireRoutingControl, error)

UpdateRoutingControl renames a routing control.

func (*InMemoryBackend) UpdateRoutingControlStates

func (b *InMemoryBackend) UpdateRoutingControlStates(
	updates []StateUpdate,
	overrides []string,
	clusterID string,
) error

UpdateRoutingControlStates applies all updates atomically after evaluating every affected safety rule.

func (*InMemoryBackend) UpdateSafetyRule

func (b *InMemoryBackend) UpdateSafetyRule(kind, arn, name string, waitPeriodMs int32) (wireRule, error)

UpdateSafetyRule changes a rule's name and wait period; kind must match the stored rule.

type NewRuleSpec

type NewRuleSpec struct {
	Name         string
	PanelARN     string
	Kind         string
	RuleType     string
	Controls     []string
	Targets      []string
	Threshold    int32
	WaitPeriodMs int32
	Inverted     bool
}

NewRuleSpec is the validated input of CreateSafetyRule.

type Provider

type Provider struct{}

Provider implements service.Provider.

func (*Provider) Init

Init builds the backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RoutingControl

type RoutingControl struct {
	CreatedAt  time.Time  `json:"createdAt"`
	DeletedAt  *time.Time `json:"deletedAt,omitempty"`
	ARN        string     `json:"arn"`
	PanelARN   string     `json:"panelArn"`
	ClusterARN string     `json:"clusterArn"`
	Name       string     `json:"name"`
	State      string     `json:"state"`
}

RoutingControl is an On/Off switch inside a control panel.

type SafetyRule

type SafetyRule struct {
	CreatedAt    time.Time         `json:"createdAt"`
	LastChangeAt time.Time         `json:"lastChangeAt"`
	DeletedAt    *time.Time        `json:"deletedAt,omitempty"`
	Tags         map[string]string `json:"tags,omitempty"`
	ARN          string            `json:"arn"`
	PanelARN     string            `json:"panelArn"`
	Name         string            `json:"name"`
	Kind         string            `json:"kind"`
	RuleType     string            `json:"ruleType"`
	Controls     []string          `json:"controls"`
	Targets      []string          `json:"targets,omitempty"`
	Threshold    int32             `json:"threshold"`
	WaitPeriodMs int32             `json:"waitPeriodMs"`
	Inverted     bool              `json:"inverted"`
}

SafetyRule is an ASSERTION or GATING rule guarding routing control updates.

type StateUpdate

type StateUpdate struct {
	ARN   string
	State string
}

StateUpdate is one requested routing control state change.

type StateView

type StateView struct {
	ARN       string
	Name      string
	PanelARN  string
	PanelName string
	Owner     string
	State     string
}

StateView is the data-plane view of a routing control.

Jump to

Keyboard shortcuts

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