apprunner

package
v1.1.4 Latest Latest
Warning

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

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

README

App Runner

Parity grade: A · SDK aws-sdk-go-v2/service/apprunner@v1.40.2 · last audited 2026-07-13 (911ff167)

Coverage

Metric Value
Operations audited 37 (34 ok, 3 partial)
Feature families 1 (1 ok)
Known gaps 4
Deferred items 1
Resource leaks clean
Known gaps
  • Service response is missing the required AutoScalingConfigurationSummary and NetworkConfiguration fields (real API always populates both); CreateServiceInput doesn't accept AutoScalingConfigurationArn so no ASG association is ever tracked, and ListServicesForAutoScalingConfiguration / AutoScalingConfigurationSummary.HasAssociatedService are consequently always empty/false. Feature-sized gap, not a disguised no-op (CreateService/DescribeService work correctly for what they do model). File a bd issue for full ASG-association wiring if CreateService's AutoScalingConfigurationArn input becomes a priority.
  • OperationSummary is missing the real API's UpdatedAt field (StartedAt/EndedAt/Id/Type/Status/TargetArn all present and correct).
  • ListAutoScalingConfigurations summary omits HasAssociatedService (tied to the same CreateService gap above).
  • CreateVpcIngressConnection doesn't validate that ServiceArn refers to an existing service, allowing a dangling reference. Left as-is because CreateVpcIngressConnection's documented error set has no ResourceNotFoundException -- adding validation would need a new InvalidRequestException-mapped check, not a NotFound one, to stay wire-correct; low traffic op, deferred.
Deferred
  • Deep field-by-field audit of HealthCheckConfiguration / EncryptionConfiguration / NetworkConfiguration / CodeRepository sub-shapes (service doesn't implement these request fields at all yet; they're silently accepted-and-ignored on input rather than rejected -- same category as the ASG-association gap above, not a wire-breaking bug).

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a resource does not exist.
	ErrNotFound = awserr.New(resourceNotFoundType, awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a service/connection/vpc-ingress-connection
	// name (or custom domain) is already in use. App Runner has no dedicated
	// "already exists" exception; unlike ResourceNotFoundException,
	// ServiceQuotaExceededException is only in the documented error set for
	// some Create* operations and not others (e.g. AssociateCustomDomain
	// doesn't accept it), so InvalidRequestException -- valid on every App
	// Runner operation -- is used to describe the conflict instead.
	ErrAlreadyExists = awserr.New(invalidRequestType, awserr.ErrAlreadyExists)
	// ErrInvalidParameter is returned for invalid input.
	ErrInvalidParameter = awserr.New(invalidRequestType, awserr.ErrInvalidParameter)
	// ErrInvalidState is returned when a service is in an invalid state for the operation.
	ErrInvalidState = awserr.New(invalidStateType, awserr.ErrConflict)
)
View Source
var ErrNilAppContext = errors.New("AppContext is required")

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

Functions

This section is empty.

Types

type AutoScalingConfiguration

type AutoScalingConfiguration struct {
	CreatedAt                        time.Time
	DeletedAt                        time.Time
	AutoScalingConfigurationArn      string
	AutoScalingConfigurationName     string
	Status                           string
	AutoScalingConfigurationRevision int32
	MaxConcurrency                   int32
	MaxSize                          int32
	MinSize                          int32
	IsDefault                        bool
	HasAssociatedService             bool
}

AutoScalingConfiguration represents an App Runner auto scaling configuration. CreatedAt is first to reduce GC pointer bytes.

type AutoScalingConfigurationSummary

type AutoScalingConfigurationSummary struct {
	CreatedAt                        time.Time
	AutoScalingConfigurationArn      string
	AutoScalingConfigurationName     string
	Status                           string
	AutoScalingConfigurationRevision int32
	IsDefault                        bool
}

AutoScalingConfigurationSummary is a summary entry for list responses.

type Connection

type Connection struct {
	CreatedAt      time.Time
	ConnectionArn  string
	ConnectionName string
	ProviderType   string
	Status         string
}

Connection represents an App Runner connection resource. CreatedAt is first to reduce GC pointer bytes.

type ConnectionSummary

type ConnectionSummary struct {
	CreatedAt      time.Time
	ConnectionArn  string
	ConnectionName string
	ProviderType   string
	Status         string
}

ConnectionSummary is a summary entry for list responses.

type CustomDomain

type CustomDomain struct {
	DomainName         string
	Status             string
	EnableWWWSubdomain bool
}

CustomDomain represents a custom domain associated with an App Runner service.

type Handler

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

Handler handles App Runner HTTP requests.

func NewHandler

func NewHandler(b StorageBackend) *Handler

NewHandler constructs a new Handler.

func (*Handler) ExtractOperation

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

ExtractOperation extracts the operation name from the X-Amz-Target header.

func (*Handler) ExtractResource

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

ExtractResource extracts the resource identifier from the request body.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

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

Handler returns the Echo handler function for App Runner 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 resets the backend and rebuilds the dispatch table.

func (*Handler) Restore

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

Restore implements persistence.Persistable by delegating to the backend. See the Snapshot doc comment above for why this delegation is new.

func (*Handler) RouteMatcher

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

RouteMatcher returns a function that matches App Runner API requests.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

Prior to Phase 3.3, Handler had no Snapshot/Restore of its own even though InMemoryBackend implemented both (dead wiring: cli.go's setupPersistence type-asserts each registered service.Registerable -- here, *Handler -- against a persistable{Snapshot,Restore} interface, and only registers it with the persistence.Manager if that assertion succeeds; since Handler never declared these methods, App Runner was silently never registered and never persisted). This delegation is what actually wires App Runner into the persistence Manager.

type InMemoryBackend

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

InMemoryBackend implements StorageBackend using in-memory maps.

Every map[string]*T resource field is a *store.Table[T] registered on registry (see store_setup.go for the registration and the rationale for which fields became Table/Index-backed vs. stayed raw maps). asgByName and obsByName are left as raw, order-sensitive slice-maps: they track ASG / observability-config revisions in ascending-revision order (the last element is "latest"), and store.Index does not preserve insertion order across removals (it swap-removes), so converting them to an Index would silently break the "latest == last element" invariant ListAutoScaling/ ListObservabilityConfigurations relies on. customDomains is left raw for the same reason (order-preserving append/splice, no sort). tags is left raw because its values are map[string]string, not *T.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend constructs a new InMemoryBackend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID.

func (*InMemoryBackend) AssociateCustomDomain

func (b *InMemoryBackend) AssociateCustomDomain(
	serviceArn, domainName string,
	enableWWW bool,
) (*CustomDomain, error)

AssociateCustomDomain associates a custom domain with a service.

func (*InMemoryBackend) CreateAutoScalingConfiguration

func (b *InMemoryBackend) CreateAutoScalingConfiguration(
	name string,
	maxConcurrency, maxSize, minSize int32,
	tags map[string]string,
) (*AutoScalingConfiguration, error)

CreateAutoScalingConfiguration creates a new ASG config revision.

func (*InMemoryBackend) CreateConnection

func (b *InMemoryBackend) CreateConnection(name, providerType string, tags map[string]string) (*Connection, error)

CreateConnection creates a new App Runner connection.

func (*InMemoryBackend) CreateObservabilityConfiguration

func (b *InMemoryBackend) CreateObservabilityConfiguration(
	name, tracingVendor string,
	tags map[string]string,
) (*ObservabilityConfiguration, error)

CreateObservabilityConfiguration creates a new observability config revision.

func (*InMemoryBackend) CreateService

func (b *InMemoryBackend) CreateService(
	name, cpu, memory, imageURI string,
	tags map[string]string,
) (*Service, error)

CreateService creates a new App Runner service.

func (*InMemoryBackend) CreateVpcConnector

func (b *InMemoryBackend) CreateVpcConnector(
	name string,
	subnets, securityGroups []string,
	tags map[string]string,
) (*VpcConnector, error)

CreateVpcConnector creates a new VPC connector.

func (*InMemoryBackend) CreateVpcIngressConnection

func (b *InMemoryBackend) CreateVpcIngressConnection(
	name, serviceArn, vpcID, vpcEndpointID string,
	tags map[string]string,
) (*VpcIngressConnection, error)

CreateVpcIngressConnection creates a new VPC ingress connection.

func (*InMemoryBackend) DeleteAutoScalingConfiguration

func (b *InMemoryBackend) DeleteAutoScalingConfiguration(asgArn string) (*AutoScalingConfiguration, error)

DeleteAutoScalingConfiguration deletes an ASG config.

func (*InMemoryBackend) DeleteConnection

func (b *InMemoryBackend) DeleteConnection(connArn string) (*Connection, error)

DeleteConnection deletes a connection.

func (*InMemoryBackend) DeleteObservabilityConfiguration

func (b *InMemoryBackend) DeleteObservabilityConfiguration(obsArn string) (*ObservabilityConfiguration, error)

DeleteObservabilityConfiguration deletes an observability config.

func (*InMemoryBackend) DeleteService

func (b *InMemoryBackend) DeleteService(serviceArn string) (*Service, error)

DeleteService marks a service as deleted and removes it from active lookup.

func (*InMemoryBackend) DeleteVpcConnector

func (b *InMemoryBackend) DeleteVpcConnector(vcArn string) (*VpcConnector, error)

DeleteVpcConnector deletes a VPC connector.

func (*InMemoryBackend) DeleteVpcIngressConnection

func (b *InMemoryBackend) DeleteVpcIngressConnection(vicArn string) (*VpcIngressConnection, error)

DeleteVpcIngressConnection deletes a VPC ingress connection.

func (*InMemoryBackend) DescribeAutoScalingConfiguration

func (b *InMemoryBackend) DescribeAutoScalingConfiguration(asgArn string) (*AutoScalingConfiguration, error)

DescribeAutoScalingConfiguration returns an ASG config by ARN.

func (*InMemoryBackend) DescribeCustomDomains

func (b *InMemoryBackend) DescribeCustomDomains(
	serviceArn string,
	maxResults int32,
	nextToken string,
) ([]*CustomDomain, string, string, error)

DescribeCustomDomains returns custom domains for a service with pagination.

func (*InMemoryBackend) DescribeObservabilityConfiguration

func (b *InMemoryBackend) DescribeObservabilityConfiguration(obsArn string) (*ObservabilityConfiguration, error)

DescribeObservabilityConfiguration returns an observability config by ARN.

func (*InMemoryBackend) DescribeService

func (b *InMemoryBackend) DescribeService(serviceArn string) (*Service, error)

DescribeService returns full service details.

func (*InMemoryBackend) DescribeVpcConnector

func (b *InMemoryBackend) DescribeVpcConnector(vcArn string) (*VpcConnector, error)

DescribeVpcConnector returns a VPC connector by ARN.

func (*InMemoryBackend) DescribeVpcIngressConnection

func (b *InMemoryBackend) DescribeVpcIngressConnection(vicArn string) (*VpcIngressConnection, error)

DescribeVpcIngressConnection returns a VPC ingress connection by ARN.

func (*InMemoryBackend) DisassociateCustomDomain

func (b *InMemoryBackend) DisassociateCustomDomain(serviceArn, domainName string) (*CustomDomain, error)

DisassociateCustomDomain removes a custom domain from a service.

func (*InMemoryBackend) ListAutoScalingConfigurations

func (b *InMemoryBackend) ListAutoScalingConfigurations(
	nameFilter string,
	latestOnly bool,
	maxResults int32,
	nextToken string,
) ([]*AutoScalingConfigurationSummary, string, error)

ListAutoScalingConfigurations returns ASG configs with optional name filter.

func (*InMemoryBackend) ListConnections

func (b *InMemoryBackend) ListConnections(
	nameFilter string,
	maxResults int32,
	nextToken string,
) ([]*ConnectionSummary, string, error)

ListConnections returns connections with optional name filter.

func (*InMemoryBackend) ListObservabilityConfigurations

func (b *InMemoryBackend) ListObservabilityConfigurations(
	nameFilter string,
	latestOnly bool,
	maxResults int32,
	nextToken string,
) ([]*ObservabilityConfigurationSummary, string, error)

ListObservabilityConfigurations returns observability configs with optional name filter.

func (*InMemoryBackend) ListOperations

func (b *InMemoryBackend) ListOperations(
	serviceArn string,
	maxResults int32,
	nextToken string,
) ([]*OperationSummary, string, error)

ListOperations returns operations for a service with pagination.

func (*InMemoryBackend) ListServices

func (b *InMemoryBackend) ListServices(maxResults int32, nextToken string) ([]*ServiceSummary, string, error)

ListServices returns services sorted by ARN with pagination.

func (*InMemoryBackend) ListServicesForAutoScalingConfiguration

func (b *InMemoryBackend) ListServicesForAutoScalingConfiguration(
	asgArn string,
	maxResults int32,
	nextToken string,
) ([]string, string, error)

ListServicesForAutoScalingConfiguration returns service ARNs using the ASG config.

func (*InMemoryBackend) ListTagsForResource

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

ListTagsForResource returns all tags for a resource.

func (*InMemoryBackend) ListVpcConnectors

func (b *InMemoryBackend) ListVpcConnectors(maxResults int32, nextToken string) ([]*VpcConnector, string, error)

ListVpcConnectors returns VPC connectors with pagination.

func (*InMemoryBackend) ListVpcIngressConnections

func (b *InMemoryBackend) ListVpcIngressConnections(
	serviceArnFilter, connectionArnFilter string,
	maxResults int32,
	nextToken string,
) ([]*VpcIngressConnectionSummary, string, error)

ListVpcIngressConnections returns VPC ingress connections with optional filters.

func (*InMemoryBackend) PauseService

func (b *InMemoryBackend) PauseService(serviceArn string) (*Service, error)

PauseService pauses a running service.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the region.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

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

Restore deserializes state from JSON.

func (*InMemoryBackend) ResumeService

func (b *InMemoryBackend) ResumeService(serviceArn string) (*Service, error)

ResumeService resumes a paused service.

func (*InMemoryBackend) Snapshot

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

Snapshot serializes current state to JSON.

func (*InMemoryBackend) StartDeployment

func (b *InMemoryBackend) StartDeployment(serviceArn string) (string, error)

StartDeployment triggers a deployment for a service.

func (*InMemoryBackend) TagResource

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

TagResource adds or updates tags on a resource.

func (*InMemoryBackend) UntagResource

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

UntagResource removes tags from a resource.

func (*InMemoryBackend) UpdateDefaultAutoScalingConfiguration

func (b *InMemoryBackend) UpdateDefaultAutoScalingConfiguration(asgArn string) (*AutoScalingConfiguration, error)

UpdateDefaultAutoScalingConfiguration sets the default ASG config.

func (*InMemoryBackend) UpdateService

func (b *InMemoryBackend) UpdateService(serviceArn, cpu, memory, imageURI string) (*Service, error)

UpdateService updates a service's configuration.

func (*InMemoryBackend) UpdateVpcIngressConnection

func (b *InMemoryBackend) UpdateVpcIngressConnection(
	vicArn, vpcID, vpcEndpointID string,
) (*VpcIngressConnection, error)

UpdateVpcIngressConnection updates a VPC ingress connection's VPC config.

type ObservabilityConfiguration

type ObservabilityConfiguration struct {
	CreatedAt                          time.Time
	DeletedAt                          time.Time
	ObservabilityConfigurationArn      string
	ObservabilityConfigurationName     string
	Status                             string
	TracingVendor                      string
	ObservabilityConfigurationRevision int32
	Latest                             bool
}

ObservabilityConfiguration represents an App Runner observability configuration. CreatedAt is first to reduce GC pointer bytes.

type ObservabilityConfigurationSummary

type ObservabilityConfigurationSummary struct {
	CreatedAt                          time.Time
	ObservabilityConfigurationArn      string
	ObservabilityConfigurationName     string
	Status                             string
	ObservabilityConfigurationRevision int32
	Latest                             bool
}

ObservabilityConfigurationSummary is a summary entry for list responses.

type OperationSummary

type OperationSummary struct {
	StartedAt time.Time
	EndedAt   time.Time
	ID        string
	Type      string
	Status    string
	TargetArn string
}

OperationSummary is an operation entry in a list response. StartedAt is first so its non-pointer prefix (wall, ext) reduces GC pointer bytes.

type Provider

type Provider struct{}

Provider implements service.Provider for the App Runner service.

func (*Provider) Init

Init initializes the App Runner backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the logical name of the provider.

type Service

type Service struct {
	CreatedAt   time.Time
	UpdatedAt   time.Time
	ServiceArn  string
	ServiceID   string
	ServiceName string
	ServiceURL  string
	Status      string
	CPU         string
	Memory      string
	ImageURI    string
}

Service represents an App Runner service with full details. CreatedAt is first so its non-pointer prefix (wall, ext) reduces GC pointer bytes.

type ServiceSummary

type ServiceSummary struct {
	CreatedAt   time.Time
	ServiceArn  string
	ServiceID   string
	ServiceName string
	ServiceURL  string
	Status      string
}

ServiceSummary is a service entry in a list response. CreatedAt is first so its non-pointer prefix (wall, ext) reduces GC pointer bytes.

type StorageBackend

type StorageBackend interface {
	CreateService(name string, cpu, memory string, imageURI string, tags map[string]string) (*Service, error)
	DescribeService(serviceArn string) (*Service, error)
	UpdateService(serviceArn string, cpu, memory, imageURI string) (*Service, error)
	DeleteService(serviceArn string) (*Service, error)
	ListServices(maxResults int32, nextToken string) ([]*ServiceSummary, string, error)
	PauseService(serviceArn string) (*Service, error)
	ResumeService(serviceArn string) (*Service, error)
	ListOperations(serviceArn string, maxResults int32, nextToken string) ([]*OperationSummary, string, error)
	StartDeployment(serviceArn string) (string, error)

	CreateAutoScalingConfiguration(
		name string,
		maxConcurrency, maxSize, minSize int32,
		tags map[string]string,
	) (*AutoScalingConfiguration, error)
	DescribeAutoScalingConfiguration(arn string) (*AutoScalingConfiguration, error)
	DeleteAutoScalingConfiguration(arn string) (*AutoScalingConfiguration, error)
	ListAutoScalingConfigurations(
		nameFilter string,
		latestOnly bool,
		maxResults int32,
		nextToken string,
	) ([]*AutoScalingConfigurationSummary, string, error)
	UpdateDefaultAutoScalingConfiguration(arn string) (*AutoScalingConfiguration, error)
	ListServicesForAutoScalingConfiguration(arn string, maxResults int32, nextToken string) ([]string, string, error)

	CreateConnection(name, providerType string, tags map[string]string) (*Connection, error)
	DeleteConnection(arn string) (*Connection, error)
	ListConnections(nameFilter string, maxResults int32, nextToken string) ([]*ConnectionSummary, string, error)

	CreateObservabilityConfiguration(
		name, tracingVendor string,
		tags map[string]string,
	) (*ObservabilityConfiguration, error)
	DescribeObservabilityConfiguration(arn string) (*ObservabilityConfiguration, error)
	DeleteObservabilityConfiguration(arn string) (*ObservabilityConfiguration, error)
	ListObservabilityConfigurations(
		nameFilter string,
		latestOnly bool,
		maxResults int32,
		nextToken string,
	) ([]*ObservabilityConfigurationSummary, string, error)

	CreateVpcConnector(name string, subnets, securityGroups []string, tags map[string]string) (*VpcConnector, error)
	DescribeVpcConnector(arn string) (*VpcConnector, error)
	DeleteVpcConnector(arn string) (*VpcConnector, error)
	ListVpcConnectors(maxResults int32, nextToken string) ([]*VpcConnector, string, error)

	CreateVpcIngressConnection(
		name, serviceArn, vpcID, vpcEndpointID string,
		tags map[string]string,
	) (*VpcIngressConnection, error)
	DescribeVpcIngressConnection(arn string) (*VpcIngressConnection, error)
	DeleteVpcIngressConnection(arn string) (*VpcIngressConnection, error)
	ListVpcIngressConnections(
		serviceArnFilter, connectionArnFilter string,
		maxResults int32,
		nextToken string,
	) ([]*VpcIngressConnectionSummary, string, error)
	UpdateVpcIngressConnection(arn, vpcID, vpcEndpointID string) (*VpcIngressConnection, error)

	AssociateCustomDomain(serviceArn, domainName string, enableWWW bool) (*CustomDomain, error)
	DisassociateCustomDomain(serviceArn, domainName string) (*CustomDomain, error)
	DescribeCustomDomains(
		serviceArn string,
		maxResults int32,
		nextToken string,
	) ([]*CustomDomain, string, string, error)

	TagResource(resourceArn string, tags map[string]string) error
	UntagResource(resourceArn string, keys []string) error
	ListTagsForResource(resourceArn string) (map[string]string, error)

	AccountID() string
	Region() string
	Reset()
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend is the interface for App Runner storage operations.

type VpcConnector

type VpcConnector struct {
	CreatedAt            time.Time
	DeletedAt            time.Time
	VpcConnectorArn      string
	VpcConnectorName     string
	Status               string
	SecurityGroups       []string
	Subnets              []string
	VpcConnectorRevision int32
}

VpcConnector represents an App Runner VPC connector resource. CreatedAt is first to reduce GC pointer bytes.

type VpcIngressConnection

type VpcIngressConnection struct {
	CreatedAt                time.Time
	DeletedAt                time.Time
	VpcIngressConnectionArn  string
	VpcIngressConnectionName string
	ServiceArn               string
	AccountID                string
	DomainName               string
	VpcID                    string
	VpcEndpointID            string
	Status                   string
}

VpcIngressConnection represents an App Runner VPC ingress connection resource. CreatedAt is first to reduce GC pointer bytes.

type VpcIngressConnectionSummary

type VpcIngressConnectionSummary struct {
	VpcIngressConnectionArn string
	ServiceArn              string
}

VpcIngressConnectionSummary is a summary entry for list responses.

Jump to

Keyboard shortcuts

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