networkmanager

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 28 Imported by: 0

README

Networkmanager

Parity grade: A · SDK aws-sdk-go-v2/service/networkmanager@v1.44.4 · last audited 2026-08-06 (3b90d4523)

Coverage

Metric Value
Operations audited 95 (92 ok, 3 partial)
Feature families 29 (27 ok, 2 partial)
Known gaps 5
Structural gaps (can't be emulated) 2
Deferred items 0
Resource leaks clean
Known gaps
  • AttachmentState's PENDING_NETWORK_UPDATE/PENDING_TAG_ACCEPTANCE/UPDATING/FAILED values are real but never entered by this backend -- no segment-reassignment or tag-acceptance workflow is modeled; every attachment's real path is PENDING_ATTACHMENT_ACCEPTANCE -> (Accept ->) CREATING -> AVAILABLE or -> (Reject ->) REJECTED. Buildable with more effort (a real cross-account-acceptance/tag-acceptance state machine); not attempted this pass.
  • StartRouteAnalysis's real walk is single-hop (anchor attachment's own TGW route table only) -- it does not chain across TGW-to-TGW peering attachments, so CYCLIC_PATH_DETECTED/MAX_HOPS_EXCEEDED/the real 64-hop limit are never exercised. Buildable with more effort (multi-hop traversal + cycle detection over services/ec2's modeled TransitGatewayPeeringAttachment state); not attempted this pass.
  • GetCoreNetworkChangeSet/GetCoreNetworkChangeEvents's diff engine is document-level (segments/network-function-groups/segment-actions/attachment-policies/core-network-configuration sections), not correlated against live attachment membership -- 5 of the real 14 ChangeType values are covered (ATTACHMENT_MAPPING/ATTACHMENT_ROUTE_PROPAGATION/ATTACHMENT_ROUTE_STATIC/ROUTING_POLICY_* remain unproduced). Buildable with more effort (resolving which attachments belong to which segment); not attempted this pass.
  • No AWS::NetworkManager::* CloudFormation resource type exists in this repo (grep -rli networkmanager services/cloudformation/*.go returns zero hits) -- confirmed absent this pass, not silently skipped.
  • CLOSED 2026-08-13 (gopherstack-jqh2 pass 2, was stale): bd gopherstack-sokq (services/bedrockagent's RouteMatcher swallowing other services' /tags/, /agents, /flows, /prompts, /resourcepolicy requests due to a missing SigV4-service-scope guard, including this package's own TagResource/UntagResource/ListTagsForResource) is CLOSED, fixed directly in bedrockagent by ef896bcf1 -- bedrockagent's prefix fallback now declines when the SigV4 scope names a different service. This package's own MatchPriority workaround (raised to 88 via handler.go's since-removed networkManagerMatchPriority constant) was reverted in the same commit; handler.go now returns the plain service.PriorityPathVersioned again.
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.

  • GetNetworkTelemetry: Connection/ConnectPeer health status reflects real AWS device/BGP/IPsec session telemetry (SNMP-style polling of actual on-prem hardware, actual BGP/IPsec session liveness) -- no such data source (no simulated device, no simulated BGP/IPsec session) exists anywhere in this repo, for any service. A deterministic 'UP once the underlying resource reaches AVAILABLE' default is the honest ceiling; inventing flapping/degraded values to look like real monitoring data would be exactly the fabrication parity-principles.md forbids. No amount of further implementation effort within this repo's existing modeling approach can produce real telemetry without inventing it, so this stays structural rather than in gaps: (bd gopherstack-xhi2).
  • ListCoreNetworkRoutingInformation/GetNetworkRoutes: both require real BGP route-attribute data (AS path, communities, local preference, MED) per route. Unlike StartRouteAnalysis (which this pass built a real walk for, over services/ec2's modeled STATIC TransitGatewayRoute entries), no BGP session state -- dynamic route advertisement, AS-path computation, community tagging -- is modeled anywhere in this repo; there is no real computation to derive these attributes from, only values that would have to be invented outright. This stays structural rather than in gaps: (bd gopherstack-xhi2).

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilAppContext = errors.New("AppContext is required")

ErrNilAppContext is returned by Provider.Init when appCtx is nil.

Functions

This section is empty.

Types

type AWSLocation

type AWSLocation struct {
	SubnetArn string
	Zone      string
}

AWSLocation mirrors types.AWSLocation.

type Attachment

type Attachment struct {
	CreatedAt                   time.Time
	UpdatedAt                   time.Time
	Tags                        *tags.Tags
	VpcOptions                  *VpcOptions
	ConnectOptions              *ConnectAttachmentOptions
	OwnerAccountID              string
	RoutingPolicyLabel          string
	AttachmentType              string
	CoreNetworkArn              string
	CoreNetworkID               string
	EdgeLocation                string
	NetworkFunctionGroupName    string
	TransitGatewayRouteTableArn string
	ResourceArn                 string
	SegmentName                 string
	State                       string
	AttachmentID                string
	PeeringID                   string
	DirectConnectGatewayArn     string
	VpcArn                      string
	VpnConnectionArn            string
	TransportAttachmentID       string
	SubnetArns                  []string
	EdgeLocations               []string
	LastModificationErrors      []AttachmentError
	AttachmentPolicyRuleNumber  int32
}

Attachment is this backend's single flat representation of the shared base Attachment shape (types.Attachment) plus every subtype-specific field (VpcAttachment/ConnectAttachment/SiteToSiteVpnAttachment/ DirectConnectGatewayAttachment/TransitGatewayRouteTableAttachment), keyed by AttachmentId. A discriminator (Kind) selects which subtype-specific fields are populated -- simpler than 5 separate tables given every op in family Q operates generically across all 5 kinds by AttachmentId alone.

type AttachmentError

type AttachmentError struct {
	Code        string
	Message     string
	RequestID   string
	ResourceArn string
}

AttachmentError mirrors types.AttachmentError -- this backend never populates a live Attachment's LastModificationErrors (no failure-injection engine models a real per-attachment error), but the type is declared so the wire shape stays complete.

type AttachmentKind

type AttachmentKind string

AttachmentKind discriminates the 5 subtypes sharing the base Attachment shape (types.AttachmentType).

type AttachmentRoutingPolicyLabel

type AttachmentRoutingPolicyLabel struct {
	AttachmentID       string
	CoreNetworkID      string
	RoutingPolicyLabel string
}

AttachmentRoutingPolicyLabel mirrors types.AttachmentRoutingPolicyAssociationSummary's stored shape (one label per attachment, family P).

type Bandwidth

type Bandwidth struct {
	DownloadSpeed int32
	UploadSpeed   int32
}

Bandwidth mirrors types.Bandwidth.

type BgpOptions

type BgpOptions struct {
	PeerAsn int64
}

BgpOptions mirrors types.BgpOptions.

type ConnectAttachmentOptions

type ConnectAttachmentOptions struct {
	Protocol string
}

ConnectAttachmentOptions mirrors types.ConnectAttachmentOptions.

type ConnectPeer

type ConnectPeer struct {
	CreatedAt              time.Time
	Tags                   *tags.Tags
	Configuration          *ConnectPeerConfiguration
	ConnectAttachmentID    string
	ConnectPeerID          string
	CoreNetworkID          string
	EdgeLocation           string
	State                  string
	SubnetArn              string
	LastModificationErrors []ConnectPeerError
}

ConnectPeer mirrors types.ConnectPeer.

type ConnectPeerAssociation

type ConnectPeerAssociation struct {
	ConnectPeerID   string
	DeviceID        string
	GlobalNetworkID string
	LinkID          string
	State           string
}

ConnectPeerAssociation mirrors types.ConnectPeerAssociation -- the concrete Global-Networks/Cloud-WAN bridge (PARITY.md family J).

type ConnectPeerBgpConfiguration

type ConnectPeerBgpConfiguration struct {
	CoreNetworkAddress string
	PeerAddress        string
	CoreNetworkAsn     int64
	PeerAsn            int64
}

ConnectPeerBgpConfiguration mirrors types.ConnectPeerBgpConfiguration.

type ConnectPeerConfiguration

type ConnectPeerConfiguration struct {
	CoreNetworkAddress string
	PeerAddress        string
	Protocol           string
	BgpConfigurations  []ConnectPeerBgpConfiguration
	InsideCidrBlocks   []string
}

ConnectPeerConfiguration mirrors types.ConnectPeerConfiguration.

type ConnectPeerError added in v1.3.1

type ConnectPeerError struct {
	Code        string
	Message     string
	RequestID   string
	ResourceArn string
}

ConnectPeerError mirrors types.ConnectPeerError -- this backend never populates a live ConnectPeer's LastModificationErrors (no failure- injection engine models a real per-connect-peer error, same as AttachmentError/PeeringError), but the type is declared complete so the wire shape stays correct if that ever changes.

type Connection

type Connection struct {
	CreatedAt         time.Time
	Tags              *tags.Tags
	ConnectionID      string
	ConnectionArn     string
	ConnectedDeviceID string
	ConnectedLinkID   string
	DeviceID          string
	GlobalNetworkID   string
	LinkID            string
	Description       string
	State             string
}

Connection mirrors types.Connection.

type CoreNetwork

type CoreNetwork struct {
	CreatedAt       time.Time
	Tags            *tags.Tags
	CoreNetworkArn  string
	CoreNetworkID   string
	GlobalNetworkID string
	Description     string
	State           string
}

CoreNetwork mirrors types.CoreNetwork. Edges/Segments/NetworkFunctionGroups stay empty in this pass -- no policy-execution engine computes them (see corenetworks.go's doc comment on the scoped-down change-set diff).

type CoreNetworkChange added in v1.3.1

type CoreNetworkChange struct {
	NewValues      *CoreNetworkChangeValues
	PreviousValues *CoreNetworkChangeValues
	Action         string
	Identifier     string
	IdentifierPath string
	Type           string
}

CoreNetworkChange mirrors types.CoreNetworkChange -- one entry in the real structural ADD/MODIFY/REMOVE diff GetCoreNetworkChangeSet computes between the LIVE and submitted policy JSON documents (corenetworkpolicydiff.go).

type CoreNetworkChangeEvent added in v1.3.1

type CoreNetworkChangeEvent struct {
	EventTime      time.Time
	Values         *CoreNetworkChangeValues
	Action         string
	IdentifierPath string
	Status         string
	Type           string
}

CoreNetworkChangeEvent mirrors types.CoreNetworkChangeEvent -- one change's EXECUTION progress, derived from the same diff as CoreNetworkChange plus the owning ChangeSetState (corenetworkpolicydiff.go).

type CoreNetworkChangeValues added in v1.3.1

type CoreNetworkChangeValues struct {
	SegmentName              string
	NetworkFunctionGroupName string
	RawJSON                  string
}

CoreNetworkChangeValues mirrors types.CoreNetworkChangeValues -- only the fields this document-level diff engine actually populates (SegmentName/NetworkFunctionGroupName plus the section's own raw content via RawJSON, which is NOT an SDK field but this backend's own honest way to expose a section-level ADD/MODIFY/REMOVE without inventing per-field SDK values -- see corenetworkpolicydiff.go's doc comment) rather than all ~15 SDK fields, most of which (Asn/Cidr/DestinationIdentifier/...) describe per-attachment route semantics this document-level diff does not correlate against live attachment state.

type CoreNetworkPolicyError

type CoreNetworkPolicyError struct {
	ErrorCode string
	Message   string
	Path      string
}

CoreNetworkPolicyError mirrors types.CoreNetworkPolicyError.

type CoreNetworkPolicyHistory

type CoreNetworkPolicyHistory struct {
	Versions map[int32]*CoreNetworkPolicyVersion

	LiveID   int32 // 0 means "no LIVE version yet"
	LatestID int32
	NextID   int32
	// contains filtered or unexported fields
}

CoreNetworkPolicyHistory is the per-core-network policy state machine: every submitted version plus which version is LIVE (deployed by ExecuteCoreNetworkChangeSet) versus LATEST (most recently Put/Restored) -- see PARITY.md family M's doc comment on why these two pointers are NOT the same until execution happens.

type CoreNetworkPolicyVersion

type CoreNetworkPolicyVersion struct {
	CreatedAt       time.Time
	CoreNetworkID   string
	Description     string
	PolicyDocument  string
	ChangeSetState  string
	PolicyVersionID int32
}

CoreNetworkPolicyVersion is this backend's stored history entry for one PutCoreNetworkPolicy/RestoreCoreNetworkPolicyVersion call -- the versioned half of types.CoreNetworkPolicy plus types.CoreNetworkPolicyVersion.

type CoreNetworkPrefixListAssociation

type CoreNetworkPrefixListAssociation struct {
	CoreNetworkID   string
	PrefixListAlias string
	PrefixListArn   string
}

CoreNetworkPrefixListAssociation mirrors types.PrefixListAssociation.

type CustomerGatewayAssociation

type CustomerGatewayAssociation struct {
	CustomerGatewayArn string
	DeviceID           string
	GlobalNetworkID    string
	LinkID             string
	State              string
}

CustomerGatewayAssociation mirrors types.CustomerGatewayAssociation.

type Device

type Device struct {
	CreatedAt       time.Time
	Tags            *tags.Tags
	AWSLocation     *AWSLocation
	Location        *Location
	DeviceID        string
	DeviceArn       string
	GlobalNetworkID string
	Description     string
	Model           string
	SerialNumber    string
	SiteID          string
	Type            string
	Vendor          string
	State           string
}

Device mirrors types.Device.

type DirectConnectResolver added in v1.3.1

type DirectConnectResolver interface {
	ResolveDirectConnectGateway(directConnectGatewayArn string) bool
}

DirectConnectResolver lets this backend validate DirectConnectGatewayArn against the real services/directconnect backend. Wired in by cli.go's wireNetworkManagerDirectConnect. A nil resolver (the default) accepts every DirectConnectGatewayArn unvalidated.

type EC2Resolver added in v1.3.1

type EC2Resolver interface {
	ResolveVpc(vpcArn string) bool
	ResolveSubnet(subnetArn string) bool
	ResolveCustomerGateway(customerGatewayArn string) bool
	ResolveTransitGateway(transitGatewayArn string) bool
	ResolveVpnConnection(vpnConnectionArn string) bool
	ResolveTransitGatewayConnectPeer(transitGatewayConnectPeerArn string) bool
	ResolveTransitGatewayRouteTable(transitGatewayRouteTableArn string) bool

	// TransitGatewayRouteTableForAttachment resolves a real EC2
	// TransitGatewayAttachmentArn to the TransitGatewayRouteTable ID
	// associated with it, for StartRouteAnalysis's real route-table walk
	// (routeanalysis.go). ok is false when the attachment does not exist,
	// is not available, or has no associated route table.
	TransitGatewayRouteTableForAttachment(transitGatewayAttachmentArn string) (routeTableID string, ok bool)
	// TransitGatewayRoutes returns every route in the named TGW route
	// table, for the same real walk.
	TransitGatewayRoutes(routeTableID string) []EC2TransitGatewayRoute
}

EC2Resolver lets this backend validate ARNs that reference EC2 resources (VPC/Subnet/CustomerGateway/TransitGateway/VpnConnection/ TransitGatewayConnectPeer/TransitGatewayRouteTable) against the real services/ec2 backend, mirroring services/directconnect's EC2GatewayResolver (services/directconnect/store.go). Wired in by cli.go's wireNetworkManagerEC2. A nil resolver (the default) accepts every EC2 ARN unvalidated -- e.g. isolated unit tests with no EC2 backend wired, matching this package's prior documented scope decision.

type EC2TransitGatewayRoute added in v1.3.1

type EC2TransitGatewayRoute struct {
	DestinationCIDRBlock string
	State                string
	AttachmentID         string
}

EC2TransitGatewayRoute is the subset of services/ec2's TransitGatewayRoute this package's route-analysis walk needs, decoupled from ec2's own type so this package does not import services/ec2 directly -- cli.go's adapter bridges the two, matching services/directconnect's EC2GatewayResolver pattern.

type GlobalNetwork

type GlobalNetwork struct {
	CreatedAt        time.Time
	Tags             *tags.Tags
	GlobalNetworkID  string
	GlobalNetworkArn string
	Description      string
	State            string
}

GlobalNetwork mirrors types.GlobalNetwork.

type Handler

type Handler struct {
	Backend   *InMemoryBackend
	AccountID string
	Region    string
}

Handler is the HTTP handler for the AWS Network Manager API.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new Network Manager 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 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 operation name from the request.

func (*Handler) ExtractResource

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

ExtractResource extracts the primary resource identifier from the request -- the ARN in the /tags/{resourceArn} or /resource-policy/{resourceArn} path, or empty for every other (mostly ID-addressed) operation.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns every operation this handler routes -- all 95 operations on the aws-sdk-go-v2/service/networkmanager client, per sdk_completeness_test.go's empty exception list.

func (*Handler) Handler

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

Handler returns the Echo handler function for Network Manager requests.

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 stored state in the backend.

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 matcher that reports true iff the request resolves to a known route via matchRoute.

func (*Handler) Shutdown

func (h *Handler) Shutdown(_ context.Context)

Shutdown stops the backend's scheduled state-transition timers so no timer goroutine outlives the service.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

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

InMemoryBackend is the in-memory store for AWS Network Manager.

A single coarse lock guards every collection below: this service spans two related product halves (Global Networks and Cloud WAN) with one real structural bridge between them (ConnectPeerAssociation binds a Cloud WAN ConnectPeer to a Global-Networks Device/Link), plus a versioned core network policy state machine and async attachment/peering/route-analysis transitions -- all cross-map transactions, so the invariant boundary is the whole backend (see .claude/memories/pkgs-catalog.md's locking rule).

func NewInMemoryBackend

func NewInMemoryBackend(ctx context.Context, accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory AWS Network Manager backend.

func (*InMemoryBackend) AcceptAttachment

func (b *InMemoryBackend) AcceptAttachment(id string) (*Attachment, error)

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID for this backend.

func (*InMemoryBackend) AssociateConnectPeer

func (b *InMemoryBackend) AssociateConnectPeer(
	globalNetworkID, connectPeerID, deviceID, linkID string,
) (*ConnectPeerAssociation, error)

func (*InMemoryBackend) AssociateCustomerGateway

func (b *InMemoryBackend) AssociateCustomerGateway(
	globalNetworkID, customerGatewayArn, deviceID, linkID string,
) (*CustomerGatewayAssociation, error)
func (b *InMemoryBackend) AssociateLink(globalNetworkID, deviceID, linkID string) (*LinkAssociation, error)

func (*InMemoryBackend) AssociateTransitGatewayConnectPeer

func (b *InMemoryBackend) AssociateTransitGatewayConnectPeer(
	globalNetworkID, deviceID, transitGatewayConnectPeerArn, linkID string,
) (*TransitGatewayConnectPeerAssociation, error)

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close()

Close stops all scheduled state-transition timers so none outlives the backend. Safe to call multiple times.

func (*InMemoryBackend) CreateConnectAttachment

func (b *InMemoryBackend) CreateConnectAttachment(
	coreNetworkID, edgeLocation, transportAttachmentID, protocol, routingPolicyLabel string, tagMap map[string]string,
) (*Attachment, error)

func (*InMemoryBackend) CreateConnectPeer

func (b *InMemoryBackend) CreateConnectPeer(
	connectAttachmentID, peerAddress string,
	bgp *BgpOptions,
	coreNetworkAddress, subnetArn string,
	insideCidrs []string,
	tagMap map[string]string,
) (*ConnectPeer, error)

CreateConnectPeer creates a new Connect peer terminating connectAttachmentID (which must already exist and be a CONNECT attachment). State starts CREATING (ConnectPeerState has no PENDING value, unlike every other resource in this service), transitioning to AVAILABLE.

func (*InMemoryBackend) CreateConnection

func (b *InMemoryBackend) CreateConnection(
	globalNetworkID, connectedDeviceID, deviceID, connectedLinkID, description, linkID string, tagMap map[string]string,
) (*Connection, error)

func (*InMemoryBackend) CreateCoreNetwork

func (b *InMemoryBackend) CreateCoreNetwork(
	globalNetworkID, description, policyDocument string, tagMap map[string]string,
) (*CoreNetwork, error)

func (*InMemoryBackend) CreateCoreNetworkPrefixListAssociation

func (b *InMemoryBackend) CreateCoreNetworkPrefixListAssociation(
	coreNetworkID, prefixListAlias, prefixListArn string,
) (*CoreNetworkPrefixListAssociation, error)

func (*InMemoryBackend) CreateDevice

func (b *InMemoryBackend) CreateDevice(
	globalNetworkID string, awsLoc *AWSLocation, loc *Location,
	description, model, serialNumber, siteID, devType, vendor string, tagMap map[string]string,
) (*Device, error)

func (*InMemoryBackend) CreateDirectConnectGatewayAttachment

func (b *InMemoryBackend) CreateDirectConnectGatewayAttachment(
	coreNetworkID, directConnectGatewayArn string,
	edgeLocations []string,
	routingPolicyLabel string,
	tagMap map[string]string,
) (*Attachment, error)

func (*InMemoryBackend) CreateGlobalNetwork

func (b *InMemoryBackend) CreateGlobalNetwork(description string, tagMap map[string]string) *GlobalNetwork

CreateGlobalNetwork creates a new global network in PENDING state, transitioning to AVAILABLE after asyncTransitionDelay.

func (b *InMemoryBackend) CreateLink(
	globalNetworkID, siteID string, bw *Bandwidth, description, provider, linkType string, tagMap map[string]string,
) (*Link, error)

func (*InMemoryBackend) CreateSite

func (b *InMemoryBackend) CreateSite(
	globalNetworkID, description string, loc *Location, tagMap map[string]string,
) (*Site, error)

CreateSite creates a new site under globalNetworkID.

func (*InMemoryBackend) CreateSiteToSiteVpnAttachment

func (b *InMemoryBackend) CreateSiteToSiteVpnAttachment(
	coreNetworkID, vpnConnectionArn, routingPolicyLabel string, tagMap map[string]string,
) (*Attachment, error)

func (*InMemoryBackend) CreateTransitGatewayPeering

func (b *InMemoryBackend) CreateTransitGatewayPeering(
	coreNetworkID, transitGatewayArn string, tagMap map[string]string,
) (*Peering, error)

func (*InMemoryBackend) CreateTransitGatewayRouteTableAttachment

func (b *InMemoryBackend) CreateTransitGatewayRouteTableAttachment(
	peeringID, transitGatewayRouteTableArn, routingPolicyLabel string, tagMap map[string]string,
) (*Attachment, error)

func (*InMemoryBackend) CreateVpcAttachment

func (b *InMemoryBackend) CreateVpcAttachment(
	coreNetworkID, vpcArn string,
	subnetArns []string,
	opts *VpcOptions,
	routingPolicyLabel string,
	tagMap map[string]string,
) (*Attachment, error)

func (*InMemoryBackend) DeleteAttachment

func (b *InMemoryBackend) DeleteAttachment(id string) (*Attachment, error)

func (*InMemoryBackend) DeleteConnectPeer

func (b *InMemoryBackend) DeleteConnectPeer(id string) (*ConnectPeer, error)

func (*InMemoryBackend) DeleteConnection

func (b *InMemoryBackend) DeleteConnection(globalNetworkID, id string) (*Connection, error)

func (*InMemoryBackend) DeleteCoreNetwork

func (b *InMemoryBackend) DeleteCoreNetwork(id string) (*CoreNetwork, error)

func (*InMemoryBackend) DeleteCoreNetworkPolicyVersion

func (b *InMemoryBackend) DeleteCoreNetworkPolicyVersion(
	coreNetworkID string, policyVersionID int32,
) (*CoreNetworkPolicyVersion, string, error)

func (*InMemoryBackend) DeleteCoreNetworkPrefixListAssociation

func (b *InMemoryBackend) DeleteCoreNetworkPrefixListAssociation(
	coreNetworkID, prefixListArn string,
) (*CoreNetworkPrefixListAssociation, error)

func (*InMemoryBackend) DeleteDevice

func (b *InMemoryBackend) DeleteDevice(globalNetworkID, id string) (*Device, error)

func (*InMemoryBackend) DeleteGlobalNetwork

func (b *InMemoryBackend) DeleteGlobalNetwork(id string) (*GlobalNetwork, error)

DeleteGlobalNetwork marks id DELETING, removing it after asyncTransitionDelay.

func (b *InMemoryBackend) DeleteLink(globalNetworkID, id string) (*Link, error)

func (*InMemoryBackend) DeletePeering

func (b *InMemoryBackend) DeletePeering(id string) (*Peering, error)

func (*InMemoryBackend) DeleteResourcePolicy

func (b *InMemoryBackend) DeleteResourcePolicy(resourceArn string) error

func (*InMemoryBackend) DeleteSite

func (b *InMemoryBackend) DeleteSite(globalNetworkID, id string) (*Site, error)

func (*InMemoryBackend) DeregisterTransitGateway

func (b *InMemoryBackend) DeregisterTransitGateway(
	globalNetworkID, transitGatewayArn string,
) (*TransitGatewayRegistration, error)

func (*InMemoryBackend) DescribeGlobalNetworks

func (b *InMemoryBackend) DescribeGlobalNetworks(
	ids []string,
	token string,
	limit int,
) (page.Page[*GlobalNetwork], error)

DescribeGlobalNetworks returns a page of global networks, optionally filtered by ids.

func (*InMemoryBackend) DisassociateConnectPeer

func (b *InMemoryBackend) DisassociateConnectPeer(
	globalNetworkID, connectPeerID string,
) (*ConnectPeerAssociation, error)

func (*InMemoryBackend) DisassociateCustomerGateway

func (b *InMemoryBackend) DisassociateCustomerGateway(
	globalNetworkID, customerGatewayArn string,
) (*CustomerGatewayAssociation, error)
func (b *InMemoryBackend) DisassociateLink(globalNetworkID, deviceID, linkID string) (*LinkAssociation, error)

func (*InMemoryBackend) DisassociateTransitGatewayConnectPeer

func (b *InMemoryBackend) DisassociateTransitGatewayConnectPeer(
	globalNetworkID, transitGatewayConnectPeerArn string,
) (*TransitGatewayConnectPeerAssociation, error)

func (*InMemoryBackend) ExecuteCoreNetworkChangeSet

func (b *InMemoryBackend) ExecuteCoreNetworkChangeSet(coreNetworkID string, policyVersionID int32) error

func (*InMemoryBackend) GetConnectAttachment

func (b *InMemoryBackend) GetConnectAttachment(id string) (*Attachment, error)

func (*InMemoryBackend) GetConnectPeer

func (b *InMemoryBackend) GetConnectPeer(id string) (*ConnectPeer, error)

func (*InMemoryBackend) GetConnectPeerAssociations

func (b *InMemoryBackend) GetConnectPeerAssociations(
	globalNetworkID string, ids []string, token string, limit int,
) (page.Page[*ConnectPeerAssociation], error)

func (*InMemoryBackend) GetConnections

func (b *InMemoryBackend) GetConnections(
	globalNetworkID string, ids []string, deviceID, token string, limit int,
) (page.Page[*Connection], error)

func (*InMemoryBackend) GetCoreNetwork

func (b *InMemoryBackend) GetCoreNetwork(id string) (*CoreNetwork, error)

func (*InMemoryBackend) GetCoreNetworkChangeEvents

func (b *InMemoryBackend) GetCoreNetworkChangeEvents(
	coreNetworkID string, policyVersionID int32,
) ([]CoreNetworkChangeEvent, error)

GetCoreNetworkChangeEvents validates coreNetworkID/policyVersionID and derives per-change EXECUTION progress from the same diff GetCoreNetworkChangeSet computes, plus policyVersionID's own ChangeSetState -- see corenetworkpolicydiff.go's changesToEvents doc comment for the coarseness this implies (one status per changeset, not per IdentifierPath).

func (*InMemoryBackend) GetCoreNetworkChangeSet

func (b *InMemoryBackend) GetCoreNetworkChangeSet(
	coreNetworkID string, policyVersionID int32,
) ([]CoreNetworkChange, error)

GetCoreNetworkChangeSet validates coreNetworkID/policyVersionID and returns the real structural diff between the LIVE policy and policyVersionID's own document -- see corenetworkpolicydiff.go.

func (*InMemoryBackend) GetCoreNetworkPolicy

func (b *InMemoryBackend) GetCoreNetworkPolicy(
	coreNetworkID, alias string, policyVersionID int32,
) (*CoreNetworkPolicyVersion, string, error)

func (*InMemoryBackend) GetCustomerGatewayAssociations

func (b *InMemoryBackend) GetCustomerGatewayAssociations(
	globalNetworkID string, arns []string, token string, limit int,
) (page.Page[*CustomerGatewayAssociation], error)

func (*InMemoryBackend) GetDevices

func (b *InMemoryBackend) GetDevices(
	globalNetworkID string, ids []string, siteID, token string, limit int,
) (page.Page[*Device], error)

func (*InMemoryBackend) GetDirectConnectGatewayAttachment

func (b *InMemoryBackend) GetDirectConnectGatewayAttachment(id string) (*Attachment, error)

func (*InMemoryBackend) GetLinkAssociations

func (b *InMemoryBackend) GetLinkAssociations(
	globalNetworkID, deviceID, linkID, token string, limit int,
) (page.Page[*LinkAssociation], error)
func (b *InMemoryBackend) GetLinks(
	globalNetworkID string, ids []string, provider, siteID, linkType, token string, limit int,
) (page.Page[*Link], error)

func (*InMemoryBackend) GetNetworkResourceCounts

func (b *InMemoryBackend) GetNetworkResourceCounts(
	globalNetworkID, resourceType string,
) map[string]int32

GetNetworkResourceCounts deliberately does NOT validate globalNetworkID existence -- PARITY.md confirms this is the one Get* op in this family with no ResourceNotFoundException in its real error set, unlike its three siblings; an unknown GlobalNetworkID here honestly returns zero counts rather than an error the real SDK client has no typed case for.

func (*InMemoryBackend) GetNetworkResourceRelationships

func (b *InMemoryBackend) GetNetworkResourceRelationships(
	globalNetworkID string, filter networkResourceFilter, token string, limit int,
) (page.Page[networkRelationship], error)

func (*InMemoryBackend) GetNetworkResources

func (b *InMemoryBackend) GetNetworkResources(
	globalNetworkID string, filter networkResourceFilter, token string, limit int,
) (page.Page[networkResourceItem], error)

func (*InMemoryBackend) GetNetworkRoutes

func (b *InMemoryBackend) GetNetworkRoutes(
	globalNetworkID, transitGatewayRouteTableArn string, hasCoreNetworkSegmentEdge bool,
) (string, string, error)

GetNetworkRoutes returns an honest empty route list -- see this file's doc comment. It still echoes back the resolved RouteTableType/ RouteTableArn derived from whichever RouteTableIdentifier field the caller supplied, and validates GlobalNetworkID.

func (*InMemoryBackend) GetNetworkTelemetry

func (b *InMemoryBackend) GetNetworkTelemetry(
	globalNetworkID string, filter networkResourceFilter, token string, limit int,
) (page.Page[networkTelemetryWire], error)

GetNetworkTelemetry emits a deterministic Health.Status: UP entry for every Connection/ConnectPeer already AVAILABLE and in scope -- see this file's doc comment for why nothing else is ever reported.

func (*InMemoryBackend) GetResourcePolicy

func (b *InMemoryBackend) GetResourcePolicy(resourceArn string) string

GetResourcePolicy returns the stored policy document, or an empty string if resourceArn has none -- real AWS's GetResourcePolicy carries NO ResourceNotFoundException in its error set (PARITY.md family W: "[base4] only"), so an absent policy is reported as empty content, not an error.

func (*InMemoryBackend) GetRouteAnalysis

func (b *InMemoryBackend) GetRouteAnalysis(globalNetworkID, id string) (*RouteAnalysis, error)

func (*InMemoryBackend) GetSiteToSiteVpnAttachment

func (b *InMemoryBackend) GetSiteToSiteVpnAttachment(id string) (*Attachment, error)

func (*InMemoryBackend) GetSites

func (b *InMemoryBackend) GetSites(
	globalNetworkID string,
	ids []string,
	token string,
	limit int,
) (page.Page[*Site], error)

func (*InMemoryBackend) GetTransitGatewayConnectPeerAssociations

func (b *InMemoryBackend) GetTransitGatewayConnectPeerAssociations(
	globalNetworkID string, arns []string, token string, limit int,
) (page.Page[*TransitGatewayConnectPeerAssociation], error)

func (*InMemoryBackend) GetTransitGatewayPeering

func (b *InMemoryBackend) GetTransitGatewayPeering(id string) (*Peering, error)

func (*InMemoryBackend) GetTransitGatewayRegistrations

func (b *InMemoryBackend) GetTransitGatewayRegistrations(
	globalNetworkID string, arns []string, token string, limit int,
) (page.Page[*TransitGatewayRegistration], error)

func (*InMemoryBackend) GetTransitGatewayRouteTableAttachment

func (b *InMemoryBackend) GetTransitGatewayRouteTableAttachment(id string) (*Attachment, error)

func (*InMemoryBackend) GetVpcAttachment

func (b *InMemoryBackend) GetVpcAttachment(id string) (*Attachment, error)

func (*InMemoryBackend) ListAttachmentRoutingPolicyAssociations

func (b *InMemoryBackend) ListAttachmentRoutingPolicyAssociations(
	coreNetworkID, attachmentID, token string, limit int,
) (page.Page[*AttachmentRoutingPolicyLabel], error)

func (*InMemoryBackend) ListAttachments

func (b *InMemoryBackend) ListAttachments(
	attachmentType, coreNetworkID, edgeLocation, state, token string, limit int,
) page.Page[*Attachment]

func (*InMemoryBackend) ListConnectPeers

func (b *InMemoryBackend) ListConnectPeers(
	connectAttachmentID, coreNetworkID, token string, limit int,
) (page.Page[*ConnectPeer], error)

func (*InMemoryBackend) ListCoreNetworkPolicyVersions

func (b *InMemoryBackend) ListCoreNetworkPolicyVersions(
	coreNetworkID, token string, limit int,
) (page.Page[*CoreNetworkPolicyVersion], map[int32]string, error)

func (*InMemoryBackend) ListCoreNetworkPrefixListAssociations

func (b *InMemoryBackend) ListCoreNetworkPrefixListAssociations(
	coreNetworkID, prefixListArn, token string, limit int,
) (page.Page[*CoreNetworkPrefixListAssociation], error)

func (*InMemoryBackend) ListCoreNetworkRoutingInformation

func (b *InMemoryBackend) ListCoreNetworkRoutingInformation(coreNetworkID, edgeLocation, segmentName string) error

ListCoreNetworkRoutingInformation is a real BGP route-table read filtered by BGP path attributes (AS path, communities, local preference, MED) -- honestly derivable ONLY if this emulator tracked real BGP-attribute- tagged routes per segment/edge, which it does not (no route-propagation engine exists here). This validates its required inputs and returns an honest empty list, per PARITY.md's own framing (matching directconnect's BGP-peering honesty precedent) rather than inventing plausible AS-path/ community values.

func (*InMemoryBackend) ListCoreNetworks

func (b *InMemoryBackend) ListCoreNetworks(token string, limit int) page.Page[*CoreNetwork]

func (*InMemoryBackend) ListOrganizationServiceAccessStatus

func (b *InMemoryBackend) ListOrganizationServiceAccessStatus() *organizationStatus

ListOrganizationServiceAccessStatus returns the current organization status -- the only op in this 95-op surface with zero typed exception cases (PARITY.md), so its handler never returns an apiError.

func (*InMemoryBackend) ListPeerings

func (b *InMemoryBackend) ListPeerings(
	coreNetworkID, edgeLocation, peeringType, state, token string, limit int,
) page.Page[*Peering]

func (*InMemoryBackend) ListTagsForResource

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

ListTagsForResource returns the tags currently on resourceArn.

func (*InMemoryBackend) PutAttachmentRoutingPolicyLabel

func (b *InMemoryBackend) PutAttachmentRoutingPolicyLabel(
	coreNetworkID, attachmentID, label string,
) (*AttachmentRoutingPolicyLabel, error)

func (*InMemoryBackend) PutCoreNetworkPolicy

func (b *InMemoryBackend) PutCoreNetworkPolicy(
	coreNetworkID, policyDocument, description string, latestVersionID int32,
) (*CoreNetworkPolicyHistory, *CoreNetworkPolicyVersion, error)

func (*InMemoryBackend) PutResourcePolicy

func (b *InMemoryBackend) PutResourcePolicy(resourceArn, policyDocument string) error

PutResourcePolicy stores policyDocument for resourceArn, creating the entry if absent (real AWS's PutResourcePolicy has no ResourceNotFound case, per PARITY.md, consistent with create-if-absent semantics).

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) RegisterTransitGateway

func (b *InMemoryBackend) RegisterTransitGateway(
	globalNetworkID, transitGatewayArn string,
) (*TransitGatewayRegistration, error)

func (*InMemoryBackend) RejectAttachment

func (b *InMemoryBackend) RejectAttachment(id string) (*Attachment, error)

func (*InMemoryBackend) RemoveAttachmentRoutingPolicyLabel

func (b *InMemoryBackend) RemoveAttachmentRoutingPolicyLabel(
	coreNetworkID, attachmentID string,
) (*AttachmentRoutingPolicyLabel, error)

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored state.

func (*InMemoryBackend) Restore

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

Restore loads backend state from a JSON snapshot.

func (*InMemoryBackend) RestoreCoreNetworkPolicyVersion

func (b *InMemoryBackend) RestoreCoreNetworkPolicyVersion(
	coreNetworkID string, policyVersionID int32,
) (*CoreNetworkPolicyVersion, error)

func (*InMemoryBackend) SetDirectConnectResolver added in v1.3.1

func (b *InMemoryBackend) SetDirectConnectResolver(r DirectConnectResolver)

SetDirectConnectResolver wires the backend to validate DirectConnectGatewayArn against the real services/directconnect backend -- see DirectConnectResolver's doc comment. Called from cli.go's wireNetworkManagerDirectConnect.

func (*InMemoryBackend) SetEC2Resolver added in v1.3.1

func (b *InMemoryBackend) SetEC2Resolver(r EC2Resolver)

SetEC2Resolver wires the backend to validate cross-service ARNs against the real services/ec2 backend -- see EC2Resolver's doc comment. Called from cli.go's wireNetworkManagerEC2.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) StartOrganizationServiceAccessUpdate

func (b *InMemoryBackend) StartOrganizationServiceAccessUpdate(action string) *organizationStatus

StartOrganizationServiceAccessUpdate flips the account's OrganizationAwsServiceAccessStatus per action ("ENABLE"/"DISABLE" -- PARITY.md notes this is a free-form *string on the wire, not a closed SDK enum).

func (*InMemoryBackend) StartRouteAnalysis

func (b *InMemoryBackend) StartRouteAnalysis(
	globalNetworkID string, source, destination *RouteAnalysisEndpoint, includeReturnPath, useMiddleboxes bool,
) (*RouteAnalysis, error)

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceArn string, tagMap map[string]string) error

TagResource adds/updates tags on resourceArn.

func (*InMemoryBackend) TaggedResources

func (b *InMemoryBackend) TaggedResources() []TaggedResource

TaggedResources enumerates every tagged resource across all 9 taggable kinds, for cli.go's ResourceGroupsTaggingAPI wiring (wireTaggingNetworkManager).

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error

UntagResource removes the given tag keys from resourceArn.

func (*InMemoryBackend) UpdateConnection

func (b *InMemoryBackend) UpdateConnection(
	globalNetworkID, id, connectedLinkID, description, linkID string,
) (*Connection, error)

func (*InMemoryBackend) UpdateCoreNetwork

func (b *InMemoryBackend) UpdateCoreNetwork(id, description string) (*CoreNetwork, error)

func (*InMemoryBackend) UpdateDevice

func (b *InMemoryBackend) UpdateDevice(
	globalNetworkID, id string, awsLoc *AWSLocation, loc *Location,
	description, model, serialNumber, siteID, devType, vendor string,
) (*Device, error)

func (*InMemoryBackend) UpdateDirectConnectGatewayAttachment

func (b *InMemoryBackend) UpdateDirectConnectGatewayAttachment(id string, edgeLocations []string) (*Attachment, error)

func (*InMemoryBackend) UpdateGlobalNetwork

func (b *InMemoryBackend) UpdateGlobalNetwork(id, description string) (*GlobalNetwork, error)

UpdateGlobalNetwork updates description, transitioning through UPDATING.

func (b *InMemoryBackend) UpdateLink(
	globalNetworkID, id string, bw *Bandwidth, description, provider, linkType string,
) (*Link, error)

func (*InMemoryBackend) UpdateNetworkResourceMetadata

func (b *InMemoryBackend) UpdateNetworkResourceMetadata(
	globalNetworkID, resourceArn string, metadata map[string]string,
) (map[string]string, error)

func (*InMemoryBackend) UpdateSite

func (b *InMemoryBackend) UpdateSite(globalNetworkID, id, description string, loc *Location) (*Site, error)

func (*InMemoryBackend) UpdateVpcAttachment

func (b *InMemoryBackend) UpdateVpcAttachment(
	id string, addSubnetArns, removeSubnetArns []string, opts *VpcOptions,
) (*Attachment, error)
type Link struct {
	CreatedAt       time.Time
	Tags            *tags.Tags
	Bandwidth       *Bandwidth
	LinkID          string
	LinkArn         string
	GlobalNetworkID string
	SiteID          string
	Description     string
	Provider        string
	Type            string
	State           string
}

Link mirrors types.Link.

type LinkAssociation

type LinkAssociation struct {
	DeviceID             string
	GlobalNetworkID      string
	LinkID               string
	LinkAssociationState string
}

LinkAssociation mirrors types.LinkAssociation.

type Location

type Location struct {
	Address   string
	Latitude  string
	Longitude string
}

Location mirrors types.Location.

type NetworkResourceSummary added in v1.3.1

type NetworkResourceSummary struct {
	Definition           string
	NameTag              string
	RegisteredGatewayArn string
	ResourceArn          string
	ResourceType         string
	IsMiddlebox          bool
}

NetworkResourceSummary mirrors types.NetworkResourceSummary.

type PathComponent added in v1.3.1

type PathComponent struct {
	Resource             *NetworkResourceSummary
	DestinationCidrBlock string
	Sequence             int32
}

PathComponent mirrors types.PathComponent.

type Peering

type Peering struct {
	CreatedAt                         time.Time
	Tags                              *tags.Tags
	OwnerAccountID                    string
	CoreNetworkArn                    string
	CoreNetworkID                     string
	EdgeLocation                      string
	PeeringID                         string
	PeeringType                       string
	ResourceArn                       string
	State                             string
	TransitGatewayArn                 string
	TransitGatewayPeeringAttachmentID string
	LastModificationErrors            []PeeringError
}

Peering is this backend's flat representation of the base Peering shape (types.Peering) plus TransitGatewayPeering's subtype fields -- the only peering subtype today (PeeringType has exactly 1 value).

type PeeringError

type PeeringError struct {
	Code        string
	Message     string
	RequestID   string
	ResourceArn string
}

PeeringError mirrors types.PeeringError -- this backend never populates a live Peering's LastModificationErrors (no failure-injection engine models a real per-peering error, same as AttachmentError), but the type is declared complete so the wire shape stays correct if that ever changes.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS Network Manager.

func (*Provider) Init

Init initializes the Network Manager service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RouteAnalysis

type RouteAnalysis struct {
	StartTimestamp    time.Time
	Destination       *RouteAnalysisEndpoint
	Source            *RouteAnalysisEndpoint
	ForwardPath       *RouteAnalysisPath
	ReturnPath        *RouteAnalysisPath
	GlobalNetworkID   string
	OwnerAccountID    string
	RouteAnalysisID   string
	Status            string
	IncludeReturnPath bool
	UseMiddleboxes    bool
}

RouteAnalysis mirrors types.RouteAnalysis.

type RouteAnalysisCompletion

type RouteAnalysisCompletion struct {
	ReasonCode string
	ResultCode string
}

RouteAnalysisCompletion mirrors types.RouteAnalysisCompletion.

type RouteAnalysisEndpoint

type RouteAnalysisEndpoint struct {
	IPAddress                   string
	TransitGatewayArn           string
	TransitGatewayAttachmentArn string
}

RouteAnalysisEndpoint mirrors types.RouteAnalysisEndpointOptions (the resolved echo) built from the caller's RouteAnalysisEndpointOptionsSpecification input.

type RouteAnalysisPath

type RouteAnalysisPath struct {
	CompletionStatus *RouteAnalysisCompletion
	Path             []PathComponent
}

RouteAnalysisPath mirrors types.RouteAnalysisPath. Path is populated only when an EC2Resolver is wired in and the walk actually resolves a route -- see routeanalysis.go's doc comment: never a fabricated PathComponent sequence.

type Site

type Site struct {
	CreatedAt       time.Time
	Tags            *tags.Tags
	Location        *Location
	SiteID          string
	SiteArn         string
	GlobalNetworkID string
	Description     string
	State           string
}

Site mirrors types.Site.

type TaggedResource

type TaggedResource struct {
	Tags map[string]string
	ARN  string
}

TaggedResource is one entry in TaggedResources' cross-service tagging rollup.

type TransitGatewayConnectPeerAssociation

type TransitGatewayConnectPeerAssociation struct {
	DeviceID                     string
	GlobalNetworkID              string
	LinkID                       string
	State                        string
	TransitGatewayConnectPeerArn string
}

TransitGatewayConnectPeerAssociation mirrors types.TransitGatewayConnectPeerAssociation.

type TransitGatewayRegistration

type TransitGatewayRegistration struct {
	State             *TransitGatewayRegistrationStateReason
	GlobalNetworkID   string
	TransitGatewayArn string
}

TransitGatewayRegistration mirrors types.TransitGatewayRegistration.

type TransitGatewayRegistrationStateReason

type TransitGatewayRegistrationStateReason struct {
	Code    string
	Message string
}

TransitGatewayRegistrationStateReason mirrors types.TransitGatewayRegistrationStateReason.

type VpcOptions

type VpcOptions struct {
	ApplianceModeSupport            bool
	DNSSupport                      bool
	Ipv6Support                     bool
	SecurityGroupReferencingSupport bool
}

VpcOptions mirrors types.VpcOptions.

Jump to

Keyboard shortcuts

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