outposts

package
v1.3.1 Latest Latest
Warning

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

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

README

Outposts

Parity grade: A · SDK aws-sdk-go-v2/service/outposts@v1.66.1 · last audited 2026-08-07 (67762068b)

Coverage

Metric Value
Operations audited 43 (35 ok, 8 partial)
Feature families 2 (2 ok)
Known gaps 3
Structural gaps (can't be emulated) 6
Deferred items 0
Resource leaks clean
Known gaps
  • ListBlockingInstancesForCapacityTask always returns an empty result after validating the capacity task exists, and WAITING_FOR_EVACUATION (CapacityTaskStatus) never occurs. Real EC2-on-Outposts instance data now exists (capacity_ledger.go's runningInstances, populated by services/ec2's RunInstances -- see ListAssetInstances), but this op only has meaning for a capacity REDUCTION a running instance would block, and StartCapacityTask's model here is additive-only (mergeInstanceTypeCapacity never shrinks InstanceTypeCapacities). Buildable if a real capacity-reduction path is ever added; empty/never-WAITING_FOR_EVACUATION remain the honest answers today, not a stub -- this is a separate, still-open gap from the single-hop lifecycle problem this pass closed.
  • MAXIMUM_ALLOWED_ORDERS_CHECK_ERROR: reclassified to structural_gaps this pass after confirming (docs.aws.amazon.com/outposts/latest/userguide/outposts-limits.html, fetched directly) AWS publishes only two Outposts quotas -- Outpost sites per Region, Outposts per site -- and no orders-related quota at all, matching this document's existing ServiceQuotaExceededException/CreateOrder note. Not merely 'not attempted': actively checked and found no data source, so it moved out of gaps -- see structural_gaps.
  • UNSUPPORTED and OUTPOST_STATE_CHANGED_ERROR (OrderingRequirementType) are not produced. UNSUPPORTED is SDK's own literal string with no _CHECK_ERROR suffix like every other member -- a generic catch-all with no documented trigger condition anywhere (SDK, docs) to derive from. OUTPOST_STATE_CHANGED_ERROR would need a 'changed relative to what reference point' concept the SDK never specifies, and OUTPOST_ACTIVE_CHECK_ERROR already covers 'is the Outpost currently active' -- inventing an unspecified snapshot-comparison mechanism for this one is exactly the kind of fabricated behavior parity-principles warns against, not a genuine data-source gap, so both stay in gaps rather than structural_gaps.
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.

  • LifeCycleStatus (types.Outpost.LifeCycleStatus is a bare *string) has NO SDK enum type anywhere in this module (confirmed by direct grep of types/enums.go -- zero LifeCycleStatus-named type exists) and the AWS API docs (API_Outpost.html) publish only a generic non-empty-string Pattern, no value set. Unlike the other gaps above, there is no more SDK/doc source to converge on even in principle: ACTIVE on CreateOutpost and PENDING_DECOMMISSION on StartOutpostDecommission success (consts.go) are this implementation's own defensible choice, and will remain so regardless of future effort unless AWS itself publishes an enum.
  • ListCatalogItems/GetCatalogItem/ListOrderableInstanceTypes are served from a small static seed table (seed_data.go: 3 catalog items, 5 orderable instance types) standing in for AWS's own published, centrally-maintained hardware catalog and pricing model. This is proprietary AWS operational/billing data (which rack/server SKUs are currently orderable, real subscription pricing) with no public machine-readable source anywhere -- not in the SDK, not in Terraform, not in AWS's docs. No amount of implementation effort in this emulator can produce the real values; this is the exact 'no billing/settlement system' case structural_gaps exists for. pricing.go's deterministic formula is the same case: real Outposts subscription pricing is not published data.
  • Connection/StartConnection key material (ServerPublicKey, tunnel addresses, UnderlayIpAddress -- connections.go) is synthetic and non-cryptographic. Real values require an actual WireGuard cryptographic handshake with real AWS infrastructure during physical Outpost server installation (per both ops' own doc comments) -- there is no data source an emulator could read or compute this from; it is not a knowledge gap, it is a physical-hardware-install-time cryptographic exchange, the same class of thing structural_gaps' 'no physical hardware' clause covers.
  • ServiceQuotaExceededException has no trigger path on CreateOrder specifically (CreateSite/CreateOutpost now enforce the two real published quotas -- see ops table), and OrderingRequirementType's MAXIMUM_ALLOWED_ORDERS_CHECK_ERROR (quotes.go's buildOrderingRequirements) is the same underlying gap surfaced a second way. No AWS-published default per-account or per-Outpost Order quota exists anywhere (confirmed directly against docs.aws.amazon.com/outposts/latest/userguide/outposts-limits.html this pass, which publishes only the Site and Outpost-per-site quotas) to enforce without fabricating a number, matching services/grafana's identical treatment of AccessDeniedException.
  • OUTPOST_GENERATION_MISMATCH_ERROR (OrderingRequirementType) is not produced: types.Outpost (confirmed via types/types.go) carries NO generation field at all -- AvailabilityZone(Id)/Description/LifeCycleStatus/Name/OutpostArn/OutpostId/OwnerId/SiteArn/SiteId/SupportedHardwareType/Tags are the entire struct. OutpostGeneration only exists on OrderableInstanceType and ListOrderableInstanceTypesInput's own filter -- there is no field on the Outpost resource itself this backend (or any emulator) could read to know 'this Outpost's generation' to compare against, unlike SupportedHardwareType which does exist and backs RACK_PHYSICAL_PROPERTIES_CHECK_ERROR.
  • ENTERPRISE_SUPPORT_ERROR (OrderingRequirementType) is not produced: it requires an AWS Support-plan model (which plan the account subscribes to) this backend has no state for, matching services/grafana's identical treatment of AccessDeniedException and this document's own existing ServiceQuotaExceededException precedent.

More

Documentation

Overview

Package outposts emulates the AWS Outposts control-plane API (aws-sdk-go-v2/service/outposts, protocol restjson1).

Index

Constants

View Source
const (
	LifeCycleStatusActive              = "ACTIVE"
	LifeCycleStatusPendingDecommission = "PENDING_DECOMMISSION"
)

LifeCycleStatus values. types.Outpost.LifeCycleStatus is a bare *string with NO enum type anywhere in this SDK module (confirmed: no LifeCycleStatus type exists in types/enums.go) -- these values are a documented, unconfirmed choice (general AWS documentation commonly references ACTIVE/CREATED/ PENDING/DEGRADED, but that is not something this SDK checkout can back with a file:line). See PARITY.md's "Outpost lifecycle" note.

View Source
const (
	ResourceTypeOutpost = "OUTPOST"
	ResourceTypeOrder   = "ORDER"
)

ResourceType wire values (types.ResourceType) -- the ONLY two values this closed enum supports. ConflictException.ResourceType can therefore never legitimately carry "SITE" or "QUOTE"; conflicts on those resources omit ResourceType/ResourceId rather than fabricate an enum value the SDK does not declare. See errors.go.

View Source
const (
	OrderStatusPreparing  = "PREPARING"
	OrderStatusInProgress = "IN_PROGRESS"
	OrderStatusDelivered  = "DELIVERED"
	OrderStatusCompleted  = "COMPLETED"
	OrderStatusCancelled  = "CANCELLED"
)

OrderStatus wire values (types.OrderStatus) this backend produces: PREPARING -> IN_PROGRESS -> DELIVERED -> COMPLETED (async, see scheduleOrderCompletion), or CANCELLED. The deprecated values (RECEIVED/PENDING/PROCESSING/INSTALLING/FULFILLED) and ERROR are real, wire-accurate constants this emulator declares no transition path to -- deprecated because AWS itself no longer produces them, ERROR because this backend has no failure trigger to base one on. See PARITY.md.

View Source
const (
	LineItemStatusPreparing = "PREPARING"
	LineItemStatusBuilding  = "BUILDING"
	LineItemStatusDelivered = "DELIVERED"
	LineItemStatusInstalled = "INSTALLED"
	LineItemStatusCancelled = "CANCELLED"
)

LineItemStatus wire values (types.LineItemStatus) this backend produces, in lockstep with the owning Order's status transition (see scheduleOrderCompletion) -- an invented but documented rollup rule, since the SDK does not encode one (PARITY.md's hardest-things #1).

View Source
const (
	QuoteStatusCreated        = "CREATED"
	QuoteStatusOrderSubmitted = "ORDER_SUBMITTED"
	QuoteStatusExpired        = "EXPIRED"
)

QuoteStatus wire values (types.QuoteStatus).

View Source
const (
	OrderingRequirementTypeOutpostIDMissing                    = "OUTPOST_ID_MISSING_ON_QUOTE_ERROR"
	OrderingRequirementTypeOutpostActive                       = "OUTPOST_ACTIVE_CHECK_ERROR"
	OrderingRequirementTypeOutpostNotFound                     = "OUTPOST_NOT_FOUND_ERROR"
	OrderingRequirementTypeOutpostRenewalRequired              = "OUTPOST_RENEWAL_REQUIRED_ERROR"
	OrderingRequirementTypeOperatingAddressExistence           = "OPERATING_ADDRESS_EXISTENCE_CHECK_ERROR"
	OrderingRequirementTypeShippingAddressExistence            = "SHIPPING_ADDRESS_EXISTENCE_CHECK_ERROR"
	OrderingRequirementTypeCountryCodeMismatch                 = "COUNTRY_CODE_MISMATCH_CHECK_ERROR"
	OrderingRequirementTypeValidZipCode                        = "VALID_ZIP_CODE_CHECK_ERROR"
	OrderingRequirementTypeRackPhysicalProperties              = "RACK_PHYSICAL_PROPERTIES_CHECK_ERROR"
	OrderingRequirementTypeShippingAddressMissingContactName   = "SHIPPING_ADDRESS_MISSING_CONTACT_NAME_ERROR"
	OrderingRequirementTypeShippingAddressMissingContactNumber = "SHIPPING_ADDRESS_MISSING_CONTACT_NUMBER_ERROR"
	OrderingRequirementTypeShippingAddressMissingContactInfo   = "SHIPPING_ADDRESS_MISSING_CONTACT_INFO_ERROR"

	OrderingRequirementStatusPass   = "PASS"
	OrderingRequirementStatusFail   = "FAIL"
	OrderingRequirementStatusExempt = "EXEMPT"
)

OrderingRequirementType subset this backend evaluates from real state -- see quotes.go's buildOrderingRequirements for the full 17-check bucketing and PARITY.md for why the remaining 5 (MAXIMUM_ALLOWED_ORDERS_CHECK_ERROR, OUTPOST_GENERATION_MISMATCH_ERROR, UNSUPPORTED, ENTERPRISE_SUPPORT_ERROR, OUTPOST_STATE_CHANGED_ERROR) are not.

View Source
const (
	CapacityTaskStatusRequested              = "REQUESTED"
	CapacityTaskStatusInProgress             = "IN_PROGRESS"
	CapacityTaskStatusCompleted              = "COMPLETED"
	CapacityTaskStatusCancellationInProgress = "CANCELLATION_IN_PROGRESS"
	CapacityTaskStatusCancelled              = "CANCELLED"
)

CapacityTaskStatus wire values (types.CapacityTaskStatus) this backend produces: REQUESTED -> IN_PROGRESS -> COMPLETED (async, see scheduleCapacityTaskCompletion), or REQUESTED/IN_PROGRESS -> CANCELLATION_IN_PROGRESS -> CANCELLED (see CancelCapacityTask). WAITING_FOR_EVACUATION never occurs: StartCapacityTask's model here is additive-only (mergeInstanceTypeCapacity never shrinks InstanceTypeCapacities), so no running instance can ever legitimately block a task -- see PARITY.md. FAILED never occurs: this backend has no failure trigger to base one on.

View Source
const (
	DecommissionStatusRequested = "REQUESTED"
	DecommissionStatusSkipped   = "SKIPPED"
	DecommissionStatusBlocked   = "BLOCKED"
)

DecommissionRequestStatus wire values (types.DecommissionRequestStatus).

View Source
const (
	SubscriptionStatusActive = "ACTIVE"
	SubscriptionTypeOriginal = "ORIGINAL"
	SubscriptionTypeRenewal  = "RENEWAL"
)

SubscriptionStatus/SubscriptionType wire values.

View Source
const (
	HardwareTypeRack   = "RACK"
	HardwareTypeServer = "SERVER"
)

SupportedHardwareType wire values (types.SupportedHardwareType), also reused as CatalogItemClass values (types.CatalogItemClass shares the same two RACK/SERVER strings) and OrderableInstanceType.FormFactor.

View Source
const (
	PaymentOptionAllUpfront     = "ALL_UPFRONT"
	PaymentOptionPartialUpfront = "PARTIAL_UPFRONT"
	PaymentOptionNoUpfront      = "NO_UPFRONT"
)

PaymentOption wire values (types.PaymentOption).

View Source
const (
	PaymentTermOneYear    = "ONE_YEAR"
	PaymentTermThreeYears = "THREE_YEARS"
	PaymentTermFiveYears  = "FIVE_YEARS"
)

PaymentTerm wire values (types.PaymentTerm).

View Source
const (
	QuoteCapacityTypeEC2 = "EC2"
	QuoteCapacityTypeEBS = "EBS"
	QuoteCapacityTypeS3  = "S3"
)

QuoteCapacityType wire values (types.QuoteCapacityType).

View Source
const (
	AddressTypeShipping  = "SHIPPING_ADDRESS"
	AddressTypeOperating = "OPERATING_ADDRESS"
)

AddressType wire values (types.AddressType).

View Source
const (
	PricingResultPriced        = "PRICED"
	PricingResultUnableToPrice = "UNABLE_TO_PRICE"
)

PricingResult wire values (types.PricingResult).

View Source
const (
	AssetStateActive = "ACTIVE"
)

ComputeAssetState / AssetState wire values this backend produces for the single seeded asset per Outpost.

View Source
const (
	AssetTypeCompute = "COMPUTE"
)

AssetType wire values (types.AssetType) this backend produces.

Variables

View Source
var (
	ErrOutpostNotFound             = errors.New("outpost does not exist")
	ErrInsufficientOutpostCapacity = errors.New("insufficient configured capacity for instance type")
)

ErrOutpostNotFound and ErrInsufficientOutpostCapacity back the cross-service ConsumeCapacity/ReleaseCapacity contract services/ec2 calls into (via its own cross_service.go) from RunInstances/TerminateInstances. Exported (unlike this package's wire-shaping errNotFoundSentinel/ errQuotaExceeded in errors.go) because a sibling package needs errors.Is-able values, not this package's own HTTP error rendering -- services/ec2 translates these into its own EC2-wire-shaped sentinel errors rather than surfacing outposts' restjson1 exception shapes.

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 Address

type Address struct {
	AddressLine1       string
	AddressLine2       string
	AddressLine3       string
	City               string
	ContactName        string
	ContactPhoneNumber string
	CountryCode        string
	DistrictOrCounty   string
	Municipality       string
	PostalCode         string
	StateOrRegion      string
}

Address mirrors types.Address.

type Asset

type Asset struct {
	ComputeAttributes *ComputeAttributes
	ID                string
	OutpostID         string
	RackID            string
	AssetType         string
	RackElevation     float32
}

Asset is the internal state of one hardware asset on an Outpost. Real Outposts assets arrive via physical hardware installation, not a public CreateAsset API (there is none among these 43 operations) -- this backend seeds exactly one COMPUTE asset per created Outpost so capacity-task and asset-listing operations have real state to read and mutate. See PARITY.md's "Asset seeding" note.

type CapacityTask

type CapacityTask struct {
	CreationDate                  time.Time
	LastModifiedDate              time.Time
	CompletionDate                time.Time
	Failed                        *CapacityTaskFailure
	InstancesToExclude            *InstancesToExclude
	ID                            string
	OutpostID                     string
	AssetID                       string
	OrderID                       string
	Status                        string
	TaskActionOnBlockingInstances string
	RequestedInstancePools        []InstanceTypeCapacity
	DryRun                        bool
}

CapacityTask is the internal state of one capacity task.

type CapacityTaskFailure

type CapacityTaskFailure struct {
	Reason string
	Type   string
}

CapacityTaskFailure mirrors types.CapacityTaskFailure.

type CatalogItem

type CatalogItem struct {
	ID                  string
	ItemClass           string
	ItemStatus          string
	SupportedStorage    []string
	SupportedUplinkGbps []int32
	EC2Capacities       []EC2Capacity
	PowerKva            float32
	WeightLbs           int32
}

CatalogItem is a static reference-catalog entry (see seed_data.go). ItemClass is filterable (ListCatalogItemsInput.ItemClassFilter) but is not a field on the real types.CatalogItem output shape -- it is kept here for internal filtering only and is never serialized on the wire.

type ComputeAttributes

type ComputeAttributes struct {
	HostID                 string
	State                  string
	InstanceFamilies       []string
	InstanceTypeCapacities []InstanceTypeCapacity
	MaxVcpus               int32
}

ComputeAttributes mirrors types.ComputeAttributes.

type Connection

type Connection struct {
	ID                  string
	AssetID             string
	ClientPublicKey     string
	ServerPublicKey     string
	ClientTunnelAddress string
	ServerTunnelAddress string
	ServerEndpoint      string
	UnderlayIPAddress   string
	AllowedIps          []string
}

Connection is the internal state of one WireGuard-style installation tunnel (StartConnection/GetConnection). Every cryptographic-looking field is a synthetic placeholder, not real key material -- see PARITY.md.

type CreateRenewalResult

type CreateRenewalResult struct {
	Currency              string
	OutpostID             string
	PaymentOption         string
	PaymentTerm           string
	MonthlyRecurringPrice float32
	UpfrontPrice          float32
}

CreateRenewalResult is CreateRenewal's flat response shape (also the idempotency-cache value type -- see store.go's renewalIdempotency). It is exported (unlike CreateRenewal's unexported request type) to match this package's convention: CreateOutpost, CreateQuote, CreateSite, and StartConnection all return an exported result type while taking an unexported request DTO.

type EC2Capacity

type EC2Capacity struct {
	Family   string
	MaxSize  string
	Quantity string
}

EC2Capacity mirrors types.EC2Capacity. Quantity and MaxSize are strings on the real wire type (not numeric), despite looking like they should be int32 -- confirmed from the SDK's types.go, preserved here deliberately.

type Handler

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

Handler is the HTTP handler for the AWS Outposts API.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new Outposts 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.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns every operation this handler routes -- all 43 operations on the aws-sdk-go-v2/service/outposts 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 Outposts 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 function that matches Outposts API requests.

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 Outposts.

A single coarse lock guards every collection below: operations routinely cross resource boundaries (CreateOutpost seeds an Asset; StartCapacityTask reads an Asset and writes a CapacityTask; CreateOrder reads a Quote and writes an Order; TagResource resolves an ARN into either the Outposts or Sites table), 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 Outposts backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID for this backend.

func (*InMemoryBackend) CancelCapacityTask

func (b *InMemoryBackend) CancelCapacityTask(outpostIdentifier, capacityTaskID string) error

CancelCapacityTask cancels the capacity task identified by (outpostIdentifier, capacityTaskID). Rejected (ConflictException) once the task has reached CANCELLATION_IN_PROGRESS or a terminal state. A REQUESTED or IN_PROGRESS task moves to the transient CANCELLATION_IN_PROGRESS state and asynchronously resolves to CANCELLED (see scheduleCapacityTaskCancellation) -- unlike the prior single-hop simplification, this now models the real transient state the SDK declares.

func (*InMemoryBackend) CancelOrder

func (b *InMemoryBackend) CancelOrder(id string) error

CancelOrder cancels the order with the given ID. Rejected (ConflictException) once the order has reached DELIVERED or a terminal state -- an order still PREPARING or IN_PROGRESS remains cancellable (a documented generalization of the original PREPARING-only rule, now that this backend actually transitions through IN_PROGRESS -- see scheduleOrderCompletion).

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) ConsumeCapacity added in v1.3.1

func (b *InMemoryBackend) ConsumeCapacity(outpostArn, instanceType, accountID string, instanceIDs []string) error

ConsumeCapacity is real AWS's behavior of depleting an Outpost's configured instance-type capacity as EC2 instances launch onto it (see GetOutpostInstanceTypes's doc comment and PARITY.md's capacity-ledger note). Draws entirely from outpostArn's single seeded Asset (assets.go's seedAssetForOutpostLocked -- there is no public CreateAsset operation among these 43, so every Outpost has exactly one), atomically: either every one of instanceIDs is admitted and debited, or none are and no capacity is decremented. Called by services/ec2's RunInstances via cross_service.go, once per launch batch (instanceIDs are the batch's freshly-minted instance IDs, generated before capacity is checked so a rejected batch never creates an ec2.Instance at all).

func (*InMemoryBackend) CreateOrder

func (b *InMemoryBackend) CreateOrder(req *createOrderRequest) (*Order, error)

CreateOrder creates a new order against an existing Outpost, optionally consuming a Quote, and schedules its async single-hop completion (see scheduleOrderCompletion) -- OrderType is always "OUTPOST": CreateOrderInput has no OrderType member, so "REPLACEMENT" can never be produced by this API surface (see models.go's Order doc comment).

func (*InMemoryBackend) CreateOutpost

func (b *InMemoryBackend) CreateOutpost(req *createOutpostRequest) (*Outpost, error)

CreateOutpost creates a new Outpost belonging to an existing Site, and seeds it with one COMPUTE asset (see assets.go's seedAssetForOutpostLocked).

func (*InMemoryBackend) CreateQuote

func (b *InMemoryBackend) CreateQuote(req *createQuoteRequest) (*Quote, error)

CreateQuote creates a new quote, optionally associated with an existing Outpost.

func (*InMemoryBackend) CreateRenewal

func (b *InMemoryBackend) CreateRenewal(idOrARN string, req *createRenewalRequest) (*CreateRenewalResult, error)

CreateRenewal computes and records a renewal subscription for the Outpost identified by idOrARN. A non-empty ClientToken is honored as an idempotency key (see PARITY.md trap #8): a retried request with the same (Outpost, ClientToken) pair replays the original response without recomputing or re-recording a new subscription.

func (*InMemoryBackend) CreateSite

func (b *InMemoryBackend) CreateSite(req *createSiteRequest) (*Site, error)

CreateSite creates a new Outposts Site.

func (*InMemoryBackend) DeleteOutpost

func (b *InMemoryBackend) DeleteOutpost(idOrARN string) error

DeleteOutpost deletes the Outpost identified by idOrARN, along with its seeded assets. Rejected (ConflictException) while a capacity task is still REQUESTED against it -- a real FK-integrity check, not a stub.

func (*InMemoryBackend) DeleteQuote

func (b *InMemoryBackend) DeleteQuote(idOrARN string) error

DeleteQuote deletes the quote identified by idOrARN.

func (*InMemoryBackend) DeleteSite

func (b *InMemoryBackend) DeleteSite(idOrARN string) error

DeleteSite deletes the Site identified by idOrARN. Rejected (ConflictException) while any Outpost still references it -- a real FK-integrity check.

func (*InMemoryBackend) GetCapacityTask

func (b *InMemoryBackend) GetCapacityTask(outpostIdentifier, capacityTaskID string) (*CapacityTask, error)

GetCapacityTask returns a copy of the capacity task identified by (outpostIdentifier, capacityTaskID).

func (*InMemoryBackend) GetCatalogItem

func (b *InMemoryBackend) GetCatalogItem(id string) (CatalogItem, error)

GetCatalogItem returns the seeded catalog item with the given ID (a static reference catalog -- see seed_data.go).

func (*InMemoryBackend) GetConnection

func (b *InMemoryBackend) GetConnection(id string) (*Connection, error)

GetConnection returns a copy of the connection with the given ID.

func (*InMemoryBackend) GetOrder

func (b *InMemoryBackend) GetOrder(id string) (*Order, error)

GetOrder returns a copy of the order with the given ID (Orders have no ARN form -- GetOrderInput.OrderId is "The ID of the order", not "ID or ARN").

func (*InMemoryBackend) GetOutpost

func (b *InMemoryBackend) GetOutpost(idOrARN string) (*Outpost, error)

GetOutpost returns a copy of the Outpost identified by idOrARN.

func (*InMemoryBackend) GetOutpostBillingInformation

func (b *InMemoryBackend) GetOutpostBillingInformation(idOrARN string) (*Outpost, error)

GetOutpostBillingInformation returns a copy of the Outpost identified by idOrARN, for the handler to read PaymentOption/PaymentTerm/ ContractEndDate/Subscriptions off of.

func (*InMemoryBackend) GetOutpostInstanceTypes

func (b *InMemoryBackend) GetOutpostInstanceTypes(idOrARN string) (*Outpost, []InstanceTypeCapacity, error)

GetOutpostInstanceTypes returns the Outpost (for OutpostArn/OutpostId in the response) and the instance-type capacities CURRENTLY CONFIGURED on it -- the aggregate of every seeded Asset's ComputeAttributes.InstanceTypeCapacities, which StartCapacityTask mutates on completion and capacity_ledger.go's ConsumeCapacity/ReleaseCapacity deplete/restore as services/ec2 launches/terminates instances onto it. An instance type whose available Count has been fully consumed is omitted -- matching real AWS depleting an Outpost's currently-configured capacity as instances launch onto it. This is deliberately distinct from GetOutpostSupportedInstanceTypes (below), which answers a different question -- see PARITY.md's trap #5.

func (*InMemoryBackend) GetOutpostSupportedInstanceTypes

func (b *InMemoryBackend) GetOutpostSupportedInstanceTypes(
	idOrARN, assetID, orderID string,
) ([]OrderableInstanceType, error)

GetOutpostSupportedInstanceTypes returns everything the Outpost's hardware type could support -- a superset that "generally include[s] instance types that are not currently configured" per the SDK's own doc comment. assetID/orderID, if given, must reference real resources but do not further filter the (already small, static) result set -- a documented simplification, see PARITY.md.

func (*InMemoryBackend) GetQuote

func (b *InMemoryBackend) GetQuote(idOrARN string) (*Quote, error)

GetQuote returns a copy of the quote identified by idOrARN (a Quote ID, or an "arn:...:quote/<id>"-shaped identifier -- see resolveQuoteLocked).

func (*InMemoryBackend) GetRenewalPricing

func (b *InMemoryBackend) GetRenewalPricing(idOrARN string) (string, []PricingOption, error)

GetRenewalPricing returns the renewal pricing options for the Outpost identified by idOrARN. Only an ACTIVE Outpost can be priced -- an Outpost pending decommission returns UNABLE_TO_PRICE with no options, a chosen, documented interpretation of an otherwise-unspecified case (see PARITY.md).

func (*InMemoryBackend) GetSite

func (b *InMemoryBackend) GetSite(idOrARN string) (*Site, error)

GetSite returns a copy of the Site identified by idOrARN.

func (*InMemoryBackend) GetSiteAddress

func (b *InMemoryBackend) GetSiteAddress(idOrARN, addressType string) (*Address, error)

GetSiteAddress returns the address of the given type for the Site identified by idOrARN.

func (*InMemoryBackend) ListAssetInstances

func (b *InMemoryBackend) ListAssetInstances(
	outpostIdentifier string, f assetInstanceFilter,
) ([]*runningInstance, error)

ListAssetInstances returns the EC2 instances placed on outpostIdentifier's assets -- real data recorded by services/ec2's RunInstances via ConsumeCapacity (capacity_ledger.go), not a fabricated result. An Outpost with no instances launched onto it (or before any ec2 RunInstances call has ever consumed its capacity) legitimately returns empty.

func (*InMemoryBackend) ListAssets

func (b *InMemoryBackend) ListAssets(outpostIdentifier string, f assetFilter) ([]*Asset, error)

ListAssets returns the assets belonging to outpostID, filtered by f, or a NotFoundException if the Outpost does not exist.

func (*InMemoryBackend) ListBlockingInstancesForCapacityTask

func (b *InMemoryBackend) ListBlockingInstancesForCapacityTask(outpostIdentifier, capacityTaskID string) error

ListBlockingInstancesForCapacityTask validates that (outpostIdentifier, capacityTaskID) resolves to a real capacity task, then always returns an empty result -- this backend has no cross-service EC2-on-Outposts placement data (see PARITY.md's "EC2 capacity coupling" gap), so a correctly-empty result after real validation is not a stub (see parity-principles.md).

func (*InMemoryBackend) ListCapacityTasks

func (b *InMemoryBackend) ListCapacityTasks(f capacityTaskFilter, token string, limit int) page.Page[*CapacityTask]

ListCapacityTasks returns a page of capacity task summaries matching f.

func (*InMemoryBackend) ListCatalogItems

func (b *InMemoryBackend) ListCatalogItems(f catalogItemFilter, token string, limit int) page.Page[CatalogItem]

ListCatalogItems returns a page of the static seeded catalog matching f.

func (*InMemoryBackend) ListOrderableInstanceTypes

func (b *InMemoryBackend) ListOrderableInstanceTypes(
	generationFilter, token string, limit int,
) page.Page[OrderableInstanceType]

ListOrderableInstanceTypes returns a page of the static seeded orderable instance types, optionally filtered by OutpostGeneration.

func (*InMemoryBackend) ListOrders

func (b *InMemoryBackend) ListOrders(outpostIdentifierFilter, token string, limit int) page.Page[*Order]

ListOrders returns a page of order summaries, optionally filtered by outpostIdentifierFilter (an Outpost ID or ARN).

func (*InMemoryBackend) ListOutposts

func (b *InMemoryBackend) ListOutposts(f listOutpostsFilter, token string, limit int) page.Page[*Outpost]

ListOutposts returns a page of Outposts matching f.

func (*InMemoryBackend) ListQuotes

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

ListQuotes returns a page of quotes. ListQuotesInput has no filters at all besides pagination (verified -- see PARITY.md).

func (*InMemoryBackend) ListSites

func (b *InMemoryBackend) ListSites(f listSitesFilter, token string, limit int) page.Page[*Site]

ListSites returns a page of Sites matching f.

func (*InMemoryBackend) ListTagsForResource

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

ListTagsForResource returns the tags for the Outpost or Site identified by resourceArn.

func (*InMemoryBackend) OutpostARN

func (b *InMemoryBackend) OutpostARN(id string) string

OutpostARN builds the ARN for an Outpost ID. Confirmed shape (in-repo test fixture precedent from services/ec2 and services/route53resolver -- see PARITY.md's ARN section): "arn:{partition}:outposts:{region}:{account}:outpost/{id}".

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) ReleaseCapacity added in v1.3.1

func (b *InMemoryBackend) ReleaseCapacity(instanceID string)

ReleaseCapacity credits capacity back onto the Asset instanceID was originally drawn from, mirroring real AWS returning Outpost capacity when the EC2 instance that consumed it terminates. Silently no-ops if instanceID has no ConsumeCapacity record (it never launched on an Outpost, its Outpost/Asset was since deleted, or it was already released) -- called unconditionally by services/ec2's TerminateInstances via cross_service.go.

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) SiteARN

func (b *InMemoryBackend) SiteARN(id string) string

SiteARN builds the ARN for a Site ID. UNCONFIRMED shape -- no primary source (SDK trait, real Terraform provider, or AWS docs) could confirm the Site ARN resource-path segment; "site/{id}" is a defensible analogy to the confirmed "outpost/{id}" shape, not a verified fact. See PARITY.md.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) StartCapacityTask

func (b *InMemoryBackend) StartCapacityTask(
	outpostIdentifier string, req *startCapacityTaskRequest,
) (*CapacityTask, error)

StartCapacityTask starts a new capacity task against outpostIdentifier's Outpost. A non-dry-run task is REQUESTED and completes asynchronously (see scheduleCapacityTaskCompletion); a dry run never mutates state and completes synchronously, matching StartCapacityTaskInput.DryRun's doc comment ("does not make any changes to your plan").

func (*InMemoryBackend) StartConnection

func (b *InMemoryBackend) StartConnection(req *startConnectionRequest) (*Connection, error)

StartConnection starts a new installation tunnel against an existing Asset (the Outpost server being installed).

func (*InMemoryBackend) StartOutpostDecommission

func (b *InMemoryBackend) StartOutpostDecommission(idOrARN string, validateOnly bool) (string, error)

StartOutpostDecommission requests decommissioning of the Outpost identified by idOrARN. See PARITY.md's "Outpost lifecycle" note for the SKIPPED/BLOCKED/REQUESTED state machine this implements: SKIPPED when a decommission is already pending (idempotent replay), REQUESTED otherwise (BLOCKED never occurs -- this backend has no cross-service blocking-resource data, so BlockingResourceTypes is always empty). ValidateOnly performs every check but never mutates state.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(_ context.Context, resourceArn string, newTags map[string]string) error

TagResource adds or updates tags on the Outpost or Site identified by resourceArn.

func (*InMemoryBackend) TaggedResources

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

TaggedResources returns every tagged Outpost and Site, for the resourcegroupstaggingapi integration.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(_ context.Context, resourceArn string, tagKeys []string) error

UntagResource removes tags from the Outpost or Site identified by resourceArn.

func (*InMemoryBackend) UpdateOutpost

func (b *InMemoryBackend) UpdateOutpost(idOrARN string, req *updateOutpostRequest) (*Outpost, error)

UpdateOutpost applies a partial update to the Outpost identified by idOrARN.

func (*InMemoryBackend) UpdateQuote

func (b *InMemoryBackend) UpdateQuote(idOrARN string, req *updateQuoteRequest) (*Quote, error)

UpdateQuote applies a partial update to the quote with the given ID. UpdateQuoteInput's own wire error set has no ConflictException (verified via serializers/deserializers -- see PARITY.md), so this never rejects based on the quote's current status, even ORDER_SUBMITTED/EXPIRED -- there is no wire-accurate error to signal that with.

func (*InMemoryBackend) UpdateSite

func (b *InMemoryBackend) UpdateSite(idOrARN string, req *updateSiteRequest) (*Site, error)

UpdateSite applies a partial update to the Site identified by idOrARN.

func (*InMemoryBackend) UpdateSiteAddress

func (b *InMemoryBackend) UpdateSiteAddress(idOrARN, addressType string, addr *Address) (*Address, error)

UpdateSiteAddress replaces the address of the given type for the Site identified by idOrARN with addr (a full replacement, not a merge -- the only PUT in this service, per its own doc comment).

func (*InMemoryBackend) UpdateSiteRackPhysicalProperties

func (b *InMemoryBackend) UpdateSiteRackPhysicalProperties(
	idOrARN string,
	patch *RackPhysicalProperties,
) (*Site, error)

UpdateSiteRackPhysicalProperties merges patch's non-empty fields into the Site identified by idOrARN's RackPhysicalProperties.

type InstanceTypeCapacity

type InstanceTypeCapacity struct {
	InstanceType string
	Count        int32
}

InstanceTypeCapacity mirrors both types.InstanceTypeCapacity and types.AssetInstanceTypeCapacity, which are identically shaped (Count int32, InstanceType string) -- one internal type serves both wire shapes.

type InstancesToExclude

type InstancesToExclude struct {
	AccountIDs []string
	Instances  []string
	Services   []string
}

InstancesToExclude mirrors types.InstancesToExclude.

type LineItem

type LineItem struct {
	LineItemID         string
	CatalogItemID      string
	Status             string
	PreviousLineItemID string
	PreviousOrderID    string
	Quantity           int32
}

LineItem mirrors types.LineItem. AssetInformationList and ShipmentInformation are always empty/nil in this backend -- see PARITY.md's "Order lifecycle" note for why (no real shipment/asset-install data source exists to populate them from).

type Order

type Order struct {
	OrderSubmissionDate   time.Time
	OrderFulfilledDate    time.Time
	ID                    string
	OutpostID             string
	OrderType             string
	Status                string
	PaymentOption         string
	PaymentTerm           string
	QuoteIdentifier       string
	QuoteOptionIdentifier string
	LineItems             []LineItem
}

Order is the internal state of one order. OrderType is always "OUTPOST": CreateOrderInput has no OrderType member, so a "REPLACEMENT" order (the only other enum value) can never be produced by this API surface -- see PARITY.md.

type OrderableInstanceType

type OrderableInstanceType struct {
	InstanceType       string
	NetworkPerformance string
	FormFactor         string
	OutpostGeneration  string
	VCPUs              int32
	MemoryInMib        int32
}

OrderableInstanceType is a static reference-catalog entry (see seed_data.go) backing ListOrderableInstanceTypes and the VCPUs lookup used by GetOutpostInstanceTypes/GetOutpostSupportedInstanceTypes.

type OrderingRequirement

type OrderingRequirement struct {
	OrderingRequirementType string
	Status                  string
	StatusMessage           string
}

OrderingRequirement mirrors types.OrderingRequirement.

type Outpost

type Outpost struct {
	ContractEndDate       time.Time
	Tags                  *tags.Tags
	AvailabilityZoneID    string
	LifeCycleStatus       string
	SiteARN               string
	Name                  string
	Description           string
	AvailabilityZone      string
	ARN                   string
	SiteID                string
	OwnerID               string
	SupportedHardwareType string
	PaymentOption         string
	PaymentTerm           string
	ID                    string
	Subscriptions         []Subscription
}

Outpost is the internal state of one Outpost, a superset of types.Outpost plus the billing/subscription sub-state that GetOutpostBillingInformation exposes but the Outpost type itself does not carry any fields for -- see PARITY.md's "Billing model" note for how this backend accumulates Subscriptions (order fulfillment and CreateRenewal), since types.Outpost has no CreatedDate/ModifiedDate members to hang bookkeeping off of.

type PricingOption

type PricingOption struct {
	Currency              string
	PaymentOption         string
	PaymentTerm           string
	MonthlyRecurringPrice float32
	UpfrontPrice          float32
}

PricingOption mirrors a flattened types.PricingOption + types.SubscriptionPricingDetails (the only PricingType this SDK declares is SUBSCRIPTION, so the union is collapsed to one shape here).

type Provider

type Provider struct{}

Provider implements service.Provider for AWS Outposts.

func (*Provider) Init

Init initializes the Outposts service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type Quote

type Quote struct {
	CreatedDate      time.Time
	ExpirationDate   time.Time
	ID               string
	AccountID        string
	CountryCode      string
	Description      string
	OutpostID        string
	OutpostARN       string
	Status           string
	StatusMessage    string
	SubmittedOrderID string
	QuoteOptionID    string

	RequestedCapacities     []QuoteCapacity
	RequestedConstraints    []QuoteConstraint
	RequestedPaymentOptions []string
	RequestedPaymentTerms   []string
	OrderingRequirements    []OrderingRequirement
	PricingOptions          []PricingOption
}

Quote is the internal state of one quote. This backend synthesizes a single QuoteOption per quote (QuoteOptionID/PricingOptions below) rather than the full N-option combinatorial shape real AWS could in principle return -- see PARITY.md's "Quote pricing model" note.

type QuoteCapacity

type QuoteCapacity struct {
	QuoteCapacityType string
	Unit              string
	Quantity          float32
}

QuoteCapacity mirrors types.QuoteCapacity.

type QuoteConstraint

type QuoteConstraint struct {
	QuoteConstraintType string
	Value               string
}

QuoteConstraint mirrors types.QuoteConstraint.

type RackPhysicalProperties

type RackPhysicalProperties struct {
	FiberOpticCableType       string
	MaximumSupportedWeightLbs string
	OpticalStandard           string
	PowerConnector            string
	PowerDrawKva              string
	PowerFeedDrop             string
	PowerPhase                string
	UplinkCount               string
	UplinkGbps                string
}

RackPhysicalProperties mirrors types.RackPhysicalProperties. Every member is a small closed enum on the real type; they are stored here as plain strings (the wire value) rather than re-declaring nine near-identical Go enum types.

type Site

type Site struct {
	OperatingAddress       *Address
	ShippingAddress        *Address
	RackPhysicalProperties *RackPhysicalProperties
	Tags                   *tags.Tags
	ID                     string
	ARN                    string
	AccountID              string
	Name                   string
	Description            string
	Notes                  string
}

Site is the internal state of one Outposts Site. ShippingAddress is write-only from the wire's perspective: types.Site (the GetSite/ListSites response shape) only exposes OperatingAddress, flattened to three fields (City/CountryCode/StateOrRegion) -- ShippingAddress only ever surfaces via GetSiteAddress(AddressType=SHIPPING_ADDRESS). See PARITY.md's ARN note for why SiteARN's resource-path segment is a documented, unconfirmed choice.

type Subscription

type Subscription struct {
	BeginDate             time.Time
	EndDate               time.Time
	Currency              string
	SubscriptionID        string
	SubscriptionStatus    string
	SubscriptionType      string
	OrderIDs              []string
	MonthlyRecurringPrice float64
	UpfrontPrice          float64
}

Subscription mirrors types.Subscription, one entry in an Outpost's billing/subscription history (see Outpost.Subscriptions).

type TaggedEntry

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

TaggedEntry is one tagged resource, used by TaggedResources for the resourcegroupstaggingapi integration (cli.go's wireTaggingOutposts).

Jump to

Keyboard shortcuts

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