lambda

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 47 Imported by: 0

README

Lambda

Parity grade: A · SDK aws-sdk-go-v2/service/lambda@v1.97.0 · last audited 2026-07-25 (a007ec3e) · protocol REST-JSON

Coverage

Metric Value
Feature families 7 (7 ok)
Known gaps none
Deferred items 0
Resource leaks clean

More

Documentation

Overview

Package lambda provides a mock AWS Lambda service for Gopherstack. Supports Image-based (PackageType: Image) and Zip-based (PackageType: Zip) functions. Zip functions use runtime-to-base-image mapping to select an AWS ECR base image and bind-mount the extracted code at /var/task.

Index

Constants

View Source
const (
	SnapStartApplyOnNone              = "None"
	SnapStartApplyOnPublishedVersions = "PublishedVersions"
)
View Source
const PackageTypeImage = "Image"

PackageTypeImage is the Image-based Lambda package type (Docker image).

View Source
const PackageTypeZip = "Zip"

PackageTypeZip is the Zip-based Lambda package type (code archive).

Variables

View Source
var ErrAliasAlreadyExists = errors.New("ResourceConflictException")

ErrAliasAlreadyExists is returned when creating an alias that already exists.

View Source
var ErrAliasNotFound = errors.New("ResourceNotFoundException")

ErrAliasNotFound is returned when the specified alias does not exist.

View Source
var ErrCallbackNotFound = errors.New("ResourceNotFoundException")

ErrCallbackNotFound is returned when the specified durable execution callback ID does not exist.

View Source
var ErrCodeSigningConfigNotFound = errors.New("CodeSigningConfigNotFoundException")

ErrCodeSigningConfigNotFound is returned when a function has no code signing config associated.

View Source
var ErrDurableExecutionNotFound = errors.New("ResourceNotFoundException")

ErrDurableExecutionNotFound is returned when the specified durable execution does not exist.

View Source
var ErrESMNotFound = errors.New("ResourceNotFoundException")

ErrESMNotFound is returned when an event source mapping UUID is not found.

View Source
var ErrEventInvokeConfigNotFound = errors.New("ResourceNotFoundException")

ErrEventInvokeConfigNotFound is returned when no event invoke config exists for the function.

View Source
var ErrFISInvocationError = errors.New("FunctionError: FIS fault injection: invocation error")

ErrFISInvocationError is returned when a FIS invocation-error action is active for a function.

View Source
var ErrFunctionAlreadyExists = errors.New("ResourceConflictException")

ErrFunctionAlreadyExists is returned when creating a function that already exists.

View Source
var ErrFunctionConcurrencyNotFound = errors.New("ResourceNotFoundException")

ErrFunctionConcurrencyNotFound is returned when a function has no reserved concurrency configured.

View Source
var ErrFunctionNotFound = errors.New("ResourceNotFoundException")

ErrFunctionNotFound is returned when the specified Lambda function does not exist.

View Source
var ErrFunctionURLForbidden = errors.New("Forbidden")

ErrFunctionURLForbidden is returned when an AWS_IAM function URL request is missing or has an invalid SigV4 signature.

View Source
var ErrFunctionURLNotFound = errors.New("ResourceNotFoundException")

ErrFunctionURLNotFound is returned when no function URL config exists for the function.

View Source
var ErrInvalidParameterValue = errors.New("InvalidParameterValueException")

ErrInvalidParameterValue is returned when a request parameter has an invalid value.

View Source
var ErrInvocationTimeout = errors.New("lambda invocation timed out")

ErrInvocationTimeout is returned when a Lambda invocation exceeds its deadline.

View Source
var ErrLambdaUnavailable = errors.New("ServiceException")

ErrLambdaUnavailable is returned when Lambda cannot invoke (no Docker or no port range).

View Source
var ErrLayerNotFound = errors.New("ResourceNotFoundException")

ErrLayerNotFound is returned when the specified layer does not exist.

View Source
var ErrLayerVersionNotFound = errors.New("ResourceNotFoundException")

ErrLayerVersionNotFound is returned when the specified layer version does not exist.

View Source
var ErrNoPolicyFound = errors.New("ResourceNotFoundException")

ErrNoPolicyFound is returned when a function has no resource-based policy (no permissions).

View Source
var ErrPreconditionFailed = errors.New("PreconditionFailedException")

ErrPreconditionFailed is returned when a caller-supplied RevisionId does not match a resource's current revision (optimistic-concurrency check).

View Source
var ErrProvisionedConcurrencyConfigNotFound = errors.New("ResourceNotFoundException")

ErrProvisionedConcurrencyConfigNotFound is returned when no provisioned concurrency config exists for the qualifier.

View Source
var ErrTooManyRequests = errors.New("TooManyRequestsException")

ErrTooManyRequests is returned when a function's reserved concurrency limit is exhausted.

View Source
var ErrVersionNotFound = errors.New("ResourceNotFoundException")

ErrVersionNotFound is returned when the specified function version does not exist.

View Source
var ErrZipSlip = errors.New("zip entry escapes target directory")

ErrZipSlip is returned when a ZIP archive entry has a path that would escape the target directory.

Functions

This section is empty.

Types

type AccountLimit

type AccountLimit struct {
	CodeSizeUnzipped               int64 `json:"CodeSizeUnzipped"`
	CodeSizeZipped                 int64 `json:"CodeSizeZipped"`
	ConcurrentExecutions           int   `json:"ConcurrentExecutions"`
	TotalCodeSize                  int64 `json:"TotalCodeSize"`
	UnreservedConcurrentExecutions int   `json:"UnreservedConcurrentExecutions"`
}

AccountLimit holds the Lambda account-level limits.

type AccountSettingsOutput

type AccountSettingsOutput struct {
	AccountLimit *AccountLimit `json:"AccountLimit"`
	AccountUsage *AccountUsage `json:"AccountUsage"`
}

AccountSettingsOutput is the response for GetAccountSettings.

type AccountUsage

type AccountUsage struct {
	FunctionCount int   `json:"FunctionCount"`
	TotalCodeSize int64 `json:"TotalCodeSize"`
}

AccountUsage holds the Lambda account-level usage.

type AddLayerVersionPermissionInput

type AddLayerVersionPermissionInput struct {
	Action         string `json:"Action"`
	Principal      string `json:"Principal"`
	StatementID    string `json:"StatementId"`
	OrganizationID string `json:"OrganizationId,omitempty"`
	RevisionID     string `json:"-"`
}

AddLayerVersionPermissionInput is the request body for AddLayerVersionPermission. RevisionID is wire-bound as the "RevisionId" query parameter (not part of the JSON body — see the AWS smithy model), so it is populated from the query string by the handler rather than by json.Unmarshal.

type AddLayerVersionPermissionOutput

type AddLayerVersionPermissionOutput struct {
	Statement  string `json:"Statement"`
	RevisionID string `json:"RevisionId"`
}

AddLayerVersionPermissionOutput is the response for AddLayerVersionPermission.

type AddPermissionInput

type AddPermissionInput struct {
	Action                string `json:"Action"`
	Principal             string `json:"Principal"`
	StatementID           string `json:"StatementId"`
	SourceAccount         string `json:"SourceAccount,omitempty"`
	SourceArn             string `json:"SourceArn,omitempty"`
	EventSourceToken      string `json:"EventSourceToken,omitempty"`
	PrincipalOrgID        string `json:"PrincipalOrgID,omitempty"`
	FunctionURLAuthType   string `json:"FunctionUrlAuthType,omitempty"`
	InvokedViaFunctionURL *bool  `json:"InvokedViaFunctionUrl,omitempty"`
	RevisionID            string `json:"RevisionId,omitempty"`
}

AddPermissionInput is the request body for AddPermission. FunctionURLAuthType and InvokedViaFunctionURL keep the exact wire-cased "FunctionUrlAuthType" / "InvokedViaFunctionUrl" JSON tags (verified against the aws-sdk-go-v2 serializer) even though the Go field names use the repo's "URL" convention.

type AddPermissionOutput

type AddPermissionOutput struct {
	Statement *string `json:"Statement,omitempty"`
}

AddPermissionOutput is the response for AddPermission.

type AliasRoutingConfig

type AliasRoutingConfig struct {
	AdditionalVersionWeights map[string]float64 `json:"AdditionalVersionWeights,omitempty"`
}

AliasRoutingConfig holds weighted traffic routing for a Lambda alias.

type AllowedPublishers

type AllowedPublishers struct {
	SigningProfileVersionArns []string `json:"SigningProfileVersionArns"`
}

AllowedPublishers holds the signing profile version ARNs allowed for code signing.

type AmazonManagedKafkaEventSourceConfig

type AmazonManagedKafkaEventSourceConfig struct {
	ConsumerGroupID string `json:"ConsumerGroupId,omitempty"`
}

AmazonManagedKafkaEventSourceConfig holds configuration for Amazon MSK event sources.

type AsyncDestinationDelivery

type AsyncDestinationDelivery interface {
	// DeliverToTarget sends payload to the given target ARN. attributes are
	// surfaced as message attributes for SQS/SNS targets (e.g. the DLQ metadata
	// AWS attaches: RequestID, ErrorCode, ErrorMessage).
	DeliverToTarget(ctx context.Context, targetARN string, payload []byte, attributes map[string]string) error
}

AsyncDestinationDelivery delivers an async-invocation outcome to a configured target ARN (an SQS queue, SNS topic, EventBridge bus, or Lambda function). It is implemented by an adapter in the CLI wiring layer that routes by the target ARN's service. When no delivery implementation is wired, DeadLetterConfig and DestinationConfig are stored but not delivered (the pre-parity behaviour).

type CWLogsBackend

type CWLogsBackend interface {
	EnsureLogGroupAndStream(groupName, streamName string) error
	PutLogLines(groupName, streamName string, messages []string) error
}

CWLogsBackend is the minimum CloudWatch Logs interface needed by Lambda for log delivery.

type CapacityProvider

type CapacityProvider struct {
	TelemetryConfig           *CapacityProviderTelemetryConfig `json:"TelemetryConfig,omitempty"`
	CapacityProviderArn       string                           `json:"CapacityProviderArn"`
	LastModifiedTime          string                           `json:"LastModifiedTime"`
	Name                      string                           `json:"Name"`
	Status                    string                           `json:"Status,omitempty"`
	AssignedFunctionVersions  []string                         `json:"-"`
	TargetOnDemandConcurrency int                              `json:"TargetOnDemandConcurrency,omitempty"`
}

CapacityProvider holds a Lambda capacity provider configuration.

type CapacityProviderLoggingConfig added in v1.2.0

type CapacityProviderLoggingConfig struct {
	LogGroup       string `json:"LogGroup,omitempty"`
	SystemLogLevel string `json:"SystemLogLevel,omitempty"`
}

CapacityProviderLoggingConfig holds the CloudWatch Logs settings for a capacity provider's system logs.

type CapacityProviderTelemetryConfig added in v1.2.0

type CapacityProviderTelemetryConfig struct {
	LoggingConfig *CapacityProviderLoggingConfig `json:"LoggingConfig,omitempty"`
}

CapacityProviderTelemetryConfig holds the telemetry (logging) configuration for a capacity provider. Accept-and-echo only: this emulator does not send real system logs to CloudWatch for capacity-provider-managed instances.

type CheckpointDurableExecutionInput

type CheckpointDurableExecutionInput struct {
	CheckpointToken *string                  `json:"CheckpointToken,omitempty"`
	ClientToken     *string                  `json:"ClientToken,omitempty"`
	Updates         []DurableOperationUpdate `json:"Updates,omitempty"`
}

CheckpointDurableExecutionInput mirrors the CheckpointDurableExecution JSON body (DurableExecutionArn is a URI member, not part of the body, per the real serializer).

type CheckpointDurableExecutionOutput

type CheckpointDurableExecutionOutput struct {
	NewExecutionState *CheckpointUpdatedExecutionState `json:"NewExecutionState"`
	CheckpointToken   *string                          `json:"CheckpointToken,omitempty"`
}

CheckpointDurableExecutionOutput mirrors the real response shape.

type CheckpointUpdatedExecutionState added in v1.2.0

type CheckpointUpdatedExecutionState struct {
	NextMarker *string             `json:"NextMarker,omitempty"`
	Operations []*DurableOperation `json:"Operations,omitempty"`
}

CheckpointUpdatedExecutionState mirrors types.CheckpointUpdatedExecutionState.

type CodeSigningConfig

type CodeSigningConfig struct {
	AllowedPublishers    *AllowedPublishers   `json:"AllowedPublishers"`
	CodeSigningConfigArn string               `json:"CodeSigningConfigArn"`
	CodeSigningConfigID  string               `json:"CodeSigningConfigId"`
	CodeSigningPolicies  *CodeSigningPolicies `json:"CodeSigningPolicies,omitempty"`
	Description          string               `json:"Description,omitempty"`
	LastModified         string               `json:"LastModified"`
}

CodeSigningConfig holds a Lambda code signing configuration.

type CodeSigningPolicies

type CodeSigningPolicies struct {
	UntrustedArtifactOnDeployment string `json:"UntrustedArtifactOnDeployment,omitempty"`
}

CodeSigningPolicies holds the Lambda code signing policy.

type CreateAliasInput

type CreateAliasInput struct {
	RoutingConfig   *AliasRoutingConfig `json:"RoutingConfig,omitempty"`
	Description     string              `json:"Description,omitempty"`
	FunctionVersion string              `json:"FunctionVersion"`
	Name            string              `json:"Name"`
}

CreateAliasInput holds the request body for CreateAlias.

type CreateCapacityProviderInput

type CreateCapacityProviderInput struct {
	TelemetryConfig           *CapacityProviderTelemetryConfig `json:"TelemetryConfig,omitempty"`
	Name                      string                           `json:"Name"`
	TargetOnDemandConcurrency int                              `json:"TargetOnDemandConcurrency,omitempty"`
}

CreateCapacityProviderInput is the request body for CreateCapacityProvider.

type CreateCapacityProviderOutput

type CreateCapacityProviderOutput struct {
	CapacityProvider *CapacityProvider `json:"CapacityProvider"`
}

CreateCapacityProviderOutput is the response for CreateCapacityProvider.

type CreateCodeSigningConfigInput

type CreateCodeSigningConfigInput struct {
	AllowedPublishers   *AllowedPublishers   `json:"AllowedPublishers"`
	CodeSigningPolicies *CodeSigningPolicies `json:"CodeSigningPolicies,omitempty"`
	Description         string               `json:"Description,omitempty"`
}

CreateCodeSigningConfigInput is the request body for CreateCodeSigningConfig.

type CreateCodeSigningConfigOutput

type CreateCodeSigningConfigOutput struct {
	CodeSigningConfig *CodeSigningConfig `json:"CodeSigningConfig"`
}

CreateCodeSigningConfigOutput is the response for CreateCodeSigningConfig.

type CreateEventSourceMappingInput

type CreateEventSourceMappingInput struct {
	FilterCriteria                      *FilterCriteria
	DestinationConfig                   *ESMDestinationConfig
	AmazonManagedKafkaEventSourceConfig *AmazonManagedKafkaEventSourceConfig
	SelfManagedKafkaEventSourceConfig   *SelfManagedKafkaEventSourceConfig
	SelfManagedEventSource              *SelfManagedEventSource
	DocumentDBEventSourceConfig         *DocumentDBEventSourceConfig
	EventSourceARN                      string
	FunctionName                        string
	StartingPosition                    string
	SourceAccessConfigurations          []SourceAccessConfiguration
	Topics                              []string
	Queues                              []string
	FunctionResponseTypes               []string
	BatchSize                           int
	MaximumBatchingWindowInSeconds      int
	TumblingWindowInSeconds             int
	MaximumRecordAgeInSeconds           int
	MaximumRetryAttempts                int
	ParallelizationFactor               int
	BisectBatchOnFunctionError          bool
	Enabled                             bool
}

CreateEventSourceMappingInput is the input for CreateEventSourceMapping.

type CreateFunctionInput

type CreateFunctionInput struct {
	DurableConfig     *DurableConfig          `json:"DurableConfig,omitempty"`
	Environment       *EnvironmentConfig      `json:"Environment,omitempty"`
	ImageConfig       *ImageConfig            `json:"ImageConfig,omitempty"`
	VpcConfig         *VpcConfig              `json:"VpcConfig,omitempty"`
	TracingConfig     *TracingConfig          `json:"TracingConfig,omitempty"`
	DeadLetterConfig  *DeadLetterConfig       `json:"DeadLetterConfig,omitempty"`
	EphemeralStorage  *EphemeralStorageConfig `json:"EphemeralStorage,omitempty"`
	Code              *FunctionCode           `json:"Code"`
	SnapStart         *SnapStart              `json:"SnapStart,omitempty"`
	Tags              map[string]string       `json:"Tags,omitempty"`
	FunctionName      string                  `json:"FunctionName"`
	Description       string                  `json:"Description"`
	PackageType       string                  `json:"PackageType"`
	Runtime           string                  `json:"Runtime,omitempty"`
	Handler           string                  `json:"Handler,omitempty"`
	Role              string                  `json:"Role"`
	FileSystemConfigs []*FileSystemConfig     `json:"FileSystemConfigs,omitempty"`
	// Layers is a list of layer ARN strings supplied by the client.
	Layers        []string `json:"Layers,omitempty"`
	Architectures []string `json:"Architectures,omitempty"`
	MemorySize    int      `json:"MemorySize"`
	Timeout       int      `json:"Timeout"`
	// Publish, when true, creates the function and immediately publishes version 1.
	Publish bool `json:"Publish,omitempty"`
}

CreateFunctionInput holds the request body for CreateFunction.

type CreateFunctionURLConfigInput

type CreateFunctionURLConfigInput struct {
	Cors       *FunctionURLCors `json:"Cors,omitempty"`
	AuthType   string           `json:"AuthType"`
	InvokeMode string           `json:"InvokeMode,omitempty"`
}

CreateFunctionURLConfigInput is the request body for CreateFunctionUrlConfig.

type DNSRegistrar

type DNSRegistrar interface {
	Register(hostname string)
	Deregister(hostname string)
}

DNSRegistrar is an optional interface for registering synthetic DNS hostnames.

type DeadLetterConfig

type DeadLetterConfig struct {
	TargetArn string `json:"TargetArn,omitempty"`
}

DeadLetterConfig holds the dead-letter queue/topic configuration for a Lambda function.

type Destination

type Destination struct {
	Destination string `json:"Destination"`
}

Destination holds the ARN for an async invocation destination (SQS, SNS, Lambda, or EventBridge).

type DestinationConfig

type DestinationConfig struct {
	OnFailure *Destination `json:"OnFailure,omitempty"`
	OnSuccess *Destination `json:"OnSuccess,omitempty"`
}

DestinationConfig holds optional success and failure destinations for async invocations.

type DocumentDBEventSourceConfig

type DocumentDBEventSourceConfig struct {
	CollectionName string `json:"CollectionName,omitempty"`
	DatabaseName   string `json:"DatabaseName,omitempty"`
	FullDocument   string `json:"FullDocument,omitempty"`
}

DocumentDBEventSourceConfig holds configuration for Amazon DocumentDB event sources.

type DurableConfig added in v1.2.0

type DurableConfig struct {
	ExecutionTimeout      *int32 `json:"ExecutionTimeout,omitempty"`
	RetentionPeriodInDays *int32 `json:"RetentionPeriodInDays,omitempty"`
	KMSKeyArn             string `json:"KMSKeyArn,omitempty"`
}

DurableConfig holds a function's durable-execution settings: the maximum runtime for an entire durable execution, how long execution history is retained, and an optional customer-managed KMS key ARN used to encrypt durable execution payload data. This emulator does not perform real KMS encryption or history-retention pruning — the config is accepted and echoed back verbatim, matching real AWS wire shape for clients that just need CreateFunction/UpdateFunctionConfiguration/GetFunctionConfiguration to round-trip it.

type DurableExecution

type DurableExecution struct {
	EndTime       time.Time
	StartTime     time.Time
	DurableConfig *DurableConfig
	Error         *ErrorObject
	TraceHeader   *TraceHeader

	InputPayload    string
	Version         string
	FunctionARN     string
	Result          string
	CheckpointToken string
	Status          DurableExecutionStatus
	Name            string
	ARN             string
	Events          []DurableExecutionEvent
	Operations      []*DurableOperation
	// contains filtered or unexported fields
}

DurableExecution is gopherstack's internal record for a Lambda durable execution.

type DurableExecutionEvent

type DurableExecutionEvent struct {
	EventID                   *int32                     `json:"EventId,omitempty"`
	ID                        *string                    `json:"Id,omitempty"`
	Name                      *string                    `json:"Name,omitempty"`
	ParentID                  *string                    `json:"ParentId,omitempty"`
	SubType                   *string                    `json:"SubType,omitempty"`
	ExecutionStartedDetails   *ExecutionStartedDetails   `json:"ExecutionStartedDetails,omitempty"`
	ExecutionSucceededDetails *ExecutionSucceededDetails `json:"ExecutionSucceededDetails,omitempty"`
	ExecutionFailedDetails    *ExecutionFailedDetails    `json:"ExecutionFailedDetails,omitempty"`
	ExecutionStoppedDetails   *ExecutionStoppedDetails   `json:"ExecutionStoppedDetails,omitempty"`
	ExecutionTimedOutDetails  *ExecutionTimedOutDetails  `json:"ExecutionTimedOutDetails,omitempty"`
	EventType                 string                     `json:"EventType"`
	EventTimestamp            float64                    `json:"EventTimestamp"`
}

DurableExecutionEvent mirrors types.Event.

type DurableExecutionStatus

type DurableExecutionStatus string

DurableExecutionStatus mirrors types.ExecutionStatus (aws-sdk-go-v2/service/lambda@v1.97.0/types/enums.go).

const (
	DurableExecutionStatusRunning   DurableExecutionStatus = "RUNNING"
	DurableExecutionStatusSucceeded DurableExecutionStatus = "SUCCEEDED"
	DurableExecutionStatusFailed    DurableExecutionStatus = "FAILED"
	DurableExecutionStatusTimedOut  DurableExecutionStatus = "TIMED_OUT"
	DurableExecutionStatusStopped   DurableExecutionStatus = "STOPPED"
)

Enum values for DurableExecutionStatus — field-verified against types.ExecutionStatus. TIMED_OUT was previously missing entirely.

type DurableExecutionSummary added in v1.2.0

type DurableExecutionSummary struct {
	KMSKeyArn            *string                `json:"KMSKeyArn,omitempty"`
	EndTimestamp         *float64               `json:"EndTimestamp,omitempty"`
	DurableExecutionArn  string                 `json:"DurableExecutionArn"`
	DurableExecutionName string                 `json:"DurableExecutionName"`
	FunctionArn          string                 `json:"FunctionArn"`
	Status               DurableExecutionStatus `json:"Status"`
	StartTimestamp       float64                `json:"StartTimestamp"`
}

DurableExecutionSummary mirrors types.Execution — the (lighter) list-item shape ListDurableExecutionsByFunction returns, distinct from GetDurableExecutionOutput (no Error/InputPayload/Result/DurableConfig echo; just an optional KMSKeyArn).

type DurableOperation added in v1.2.0

type DurableOperation struct {
	Name             *string                           `json:"Name,omitempty"`
	ParentID         *string                           `json:"ParentId,omitempty"`
	SubType          *string                           `json:"SubType,omitempty"`
	ExecutionDetails *DurableOperationExecutionDetails `json:"ExecutionDetails,omitempty"`
	EndTimestamp     *float64                          `json:"EndTimestamp,omitempty"`
	ID               string                            `json:"Id"`
	Status           DurableOperationStatus            `json:"Status"`
	Type             DurableOperationType              `json:"Type"`
	StartTimestamp   float64                           `json:"StartTimestamp"`
}

DurableOperation mirrors types.Operation. This emulator only ever produces Type=EXECUTION (the implicit root, see durableExecutionStore's doc comment) and whatever CONTEXT/STEP/WAIT/CALLBACK/CHAINED_INVOKE operations the caller submits via CheckpointDurableExecution's Updates — the type-specific *Details fields on the real type (CallbackDetails, StepDetails, WaitDetails, ContextDetails, ChainedInvokeDetails) are therefore not declared, matching the Event Details scoping above.

type DurableOperationExecutionDetails added in v1.2.0

type DurableOperationExecutionDetails struct {
	InputPayload *string `json:"InputPayload,omitempty"`
}

DurableOperationExecutionDetails mirrors types.ExecutionDetails.

type DurableOperationStatus added in v1.2.0

type DurableOperationStatus string

DurableOperationStatus mirrors types.OperationStatus. Only the subset this emulator's checkpoint-driven state machine produces is declared as named constants (PENDING/READY are real enum values but nothing in this store emits them).

const (
	DurableOperationStatusStarted   DurableOperationStatus = "STARTED"
	DurableOperationStatusSucceeded DurableOperationStatus = "SUCCEEDED"
	DurableOperationStatusFailed    DurableOperationStatus = "FAILED"
	DurableOperationStatusCancelled DurableOperationStatus = "CANCELLED"
	DurableOperationStatusStopped   DurableOperationStatus = "STOPPED"
)

type DurableOperationType added in v1.2.0

type DurableOperationType string

DurableOperationType mirrors types.OperationType.

const (
	DurableOperationTypeExecution     DurableOperationType = "EXECUTION"
	DurableOperationTypeContext       DurableOperationType = "CONTEXT"
	DurableOperationTypeStep          DurableOperationType = "STEP"
	DurableOperationTypeWait          DurableOperationType = "WAIT"
	DurableOperationTypeCallback      DurableOperationType = "CALLBACK"
	DurableOperationTypeChainedInvoke DurableOperationType = "CHAINED_INVOKE"
)

type DurableOperationUpdate added in v1.2.0

type DurableOperationUpdate struct {
	Error    *ErrorObject `json:"Error,omitempty"`
	Name     *string      `json:"Name,omitempty"`
	ParentID *string      `json:"ParentId,omitempty"`
	Payload  *string      `json:"Payload,omitempty"`
	SubType  *string      `json:"SubType,omitempty"`
	Action   string       `json:"Action"`
	ID       string       `json:"Id"`
	Type     string       `json:"Type"`
}

DurableOperationUpdate is the accepted shape of one entry in CheckpointDurableExecutionInput.Updates (mirrors the generic fields of types.OperationUpdate). The type-specific *Options fields on the real type (CallbackOptions/ChainedInvokeOptions/ContextOptions/StepOptions/ WaitOptions — timeout/retry-policy configuration knobs) are accepted-and- discarded: this emulator's checkpoint state machine tracks operation status transitions, not timing/retry behavior, so declaring those fields would only add always-empty struct surface.

type DynamoDBStreamRecord

type DynamoDBStreamRecord struct {
	NewImage                    map[string]any
	OldImage                    map[string]any
	Keys                        map[string]any
	EventID                     string
	EventName                   string // INSERT, MODIFY, or REMOVE
	SequenceNumber              string
	StreamViewType              string
	ApproximateCreationDateTime float64 // Unix epoch seconds
	SizeBytes                   int64
}

DynamoDBStreamRecord is a single record from a DynamoDB stream. The image fields use DynamoDB JSON wire format (e.g. {"pk": {"S": "value"}}).

type DynamoDBStreamsReader

type DynamoDBStreamsReader interface {
	// DescribeStreamShards returns the ordered list of shard IDs for the stream.
	// streamARN is the full DynamoDB stream ARN.
	DescribeStreamShards(streamARN string) ([]string, error)
	// GetStreamShardIterator returns an iterator for a specific shard of the stream.
	// streamARN is the full DynamoDB stream ARN, shardID is the shard identifier,
	// and iteratorType is TRIM_HORIZON or LATEST.
	GetStreamShardIterator(streamARN, shardID, iteratorType string) (string, error)
	// GetStreamRecords reads up to limit records from the given iterator.
	GetStreamRecords(iteratorToken string, limit int) ([]DynamoDBStreamRecord, string, error)
}

DynamoDBStreamsReader reads records from a DynamoDB stream. It is implemented by the DynamoDB backend adapter in the CLI wiring layer.

type ESMDestination

type ESMDestination struct {
	Destination string `json:"Destination"`
}

ESMDestination holds the ARN for an event source mapping destination.

type ESMDestinationConfig

type ESMDestinationConfig struct {
	OnFailure *ESMDestination `json:"OnFailure,omitempty"`
}

ESMDestinationConfig holds on-failure destination for event source mappings.

type EnvironmentConfig

type EnvironmentConfig struct {
	Variables map[string]string `json:"Variables"`
}

EnvironmentConfig holds Lambda function environment variables.

type EphemeralStorageConfig

type EphemeralStorageConfig struct {
	Size int32 `json:"Size"`
}

EphemeralStorageConfig holds the ephemeral storage (/tmp) configuration for a Lambda function.

type Error

type Error struct {
	Type    string `json:"__type"`
	Message string `json:"message"`
}

Error represents an error response from Lambda.

type ErrorObject added in v1.2.0

type ErrorObject struct {
	ErrorData    *string  `json:"ErrorData,omitempty"`
	ErrorMessage *string  `json:"ErrorMessage,omitempty"`
	ErrorType    *string  `json:"ErrorType,omitempty"`
	StackTrace   []string `json:"StackTrace,omitempty"`
}

ErrorObject mirrors types.ErrorObject — the wire shape for durable execution / event / operation error details.

type EventError added in v1.2.0

type EventError struct {
	Payload   *ErrorObject `json:"Payload,omitempty"`
	Truncated *bool        `json:"Truncated,omitempty"`
}

EventError mirrors types.EventError.

type EventInput added in v1.2.0

type EventInput struct {
	Payload   *string `json:"Payload,omitempty"`
	Truncated *bool   `json:"Truncated,omitempty"`
}

EventInput mirrors types.EventInput.

type EventResult added in v1.2.0

type EventResult struct {
	Payload   *string `json:"Payload,omitempty"`
	Truncated *bool   `json:"Truncated,omitempty"`
}

EventResult mirrors types.EventResult.

type EventSourceMapping

type EventSourceMapping struct {
	LastModified                        time.Time                            `json:"lastModified"`
	FilterCriteria                      *FilterCriteria                      `json:"filterCriteria,omitempty"`
	DestinationConfig                   *ESMDestinationConfig                `json:"destinationConfig,omitempty"`
	AmazonManagedKafkaEventSourceConfig *AmazonManagedKafkaEventSourceConfig `json:"mskConfig,omitempty"`
	SelfManagedKafkaEventSourceConfig   *SelfManagedKafkaEventSourceConfig   `json:"selfManagedKafkaConfig,omitempty"`
	SelfManagedEventSource              *SelfManagedEventSource              `json:"selfManagedEventSource,omitempty"`
	DocumentDBEventSourceConfig         *DocumentDBEventSourceConfig         `json:"docdbConfig,omitempty"`
	EventSourceARN                      string                               `json:"eventSourceARN"`
	FunctionARN                         string                               `json:"functionARN"`
	UUID                                string                               `json:"uuid"`
	State                               EventSourceMappingState              `json:"state"`
	StartingPosition                    string                               `json:"startingPosition"`
	LastProcessingResult                string                               `json:"lastProcessingResult"`
	SourceAccessConfigurations          []SourceAccessConfiguration          `json:"sourceAccessConfigurations,omitempty"`
	Topics                              []string                             `json:"topics,omitempty"`
	Queues                              []string                             `json:"queues,omitempty"`
	FunctionResponseTypes               []string                             `json:"functionResponseTypes,omitempty"`
	BatchSize                           int                                  `json:"batchSize"`
	MaximumBatchingWindowInSeconds      int                                  `json:"maxBatchingWindowSecs,omitempty"`
	TumblingWindowInSeconds             int                                  `json:"tumblingWindowInSeconds,omitempty"`
	MaximumRecordAgeInSeconds           int                                  `json:"maximumRecordAgeInSeconds,omitempty"`
	MaximumRetryAttempts                int                                  `json:"maximumRetryAttempts,omitempty"`
	ParallelizationFactor               int                                  `json:"parallelizationFactor,omitempty"`
	BisectBatchOnFunctionError          bool                                 `json:"bisectBatchOnFunctionError,omitempty"`
}

EventSourceMapping represents a Lambda event source mapping.

type EventSourceMappingState

type EventSourceMappingState string

EventSourceMappingState represents the lifecycle state of an event source mapping.

const (
	// ESMStateEnabled means the mapping is active and will be invoked.
	ESMStateEnabled EventSourceMappingState = "Enabled"
	// ESMStateDisabled means the mapping is paused.
	ESMStateDisabled EventSourceMappingState = "Disabled"
	// ESMStateEnabling means the mapping is transitioning to Enabled.
	ESMStateEnabling EventSourceMappingState = "Enabling"
	// ESMStateDisabling means the mapping is transitioning to Disabled.
	ESMStateDisabling EventSourceMappingState = "Disabling"
	// ESMStateDeleting means the mapping is being deleted.
	ESMStateDeleting EventSourceMappingState = "Deleting"
)

type EventSourcePoller

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

EventSourcePoller polls Kinesis streams, SQS queues, and DynamoDB streams for new records and invokes Lambda functions for enabled event source mappings.

func NewEventSourcePoller

func NewEventSourcePoller(
	lambdaBackend *InMemoryBackend,
	kinesisReader KinesisReader,
) *EventSourcePoller

NewEventSourcePoller creates a new EventSourcePoller.

func (*EventSourcePoller) Notify

func (p *EventSourcePoller) Notify()

Notify triggers an immediate poll cycle without waiting for the next tick. It is safe to call concurrently. If a notification is already pending, this is a no-op.

func (*EventSourcePoller) RemoveMapping

func (p *EventSourcePoller) RemoveMapping(uuid string)

RemoveMapping removes any per-mapping poller state for the given ESM UUID.

func (*EventSourcePoller) SetDynamoDBStreamsReader

func (p *EventSourcePoller) SetDynamoDBStreamsReader(r DynamoDBStreamsReader)

SetDynamoDBStreamsReader sets the DynamoDB Streams reader used to poll DynamoDB streams for ESM delivery.

func (*EventSourcePoller) SetSQSReader

func (p *EventSourcePoller) SetSQSReader(r SQSReader)

SetSQSReader sets the SQS reader used to poll SQS queues for ESM delivery.

func (*EventSourcePoller) Start

func (p *EventSourcePoller) Start(ctx context.Context)

Start runs the event source poller as a background goroutine. It returns immediately; the goroutine stops when ctx is cancelled.

type ExecutionFailedDetails added in v1.2.0

type ExecutionFailedDetails struct {
	Error *EventError `json:"Error,omitempty"`
}

ExecutionFailedDetails mirrors types.ExecutionFailedDetails.

type ExecutionStartedDetails added in v1.2.0

type ExecutionStartedDetails struct {
	ExecutionTimeout *int32      `json:"ExecutionTimeout,omitempty"`
	Input            *EventInput `json:"Input,omitempty"`
}

ExecutionStartedDetails mirrors types.ExecutionStartedDetails. This, and the other four Execution*Details types below, are the ONLY Event subtype Details this emulator ever populates: it has no step-function-style replay engine, so the Context/Step/Wait/Callback/ChainedInvoke *Details fields declared on the real types.Event (~19 of them) are intentionally not declared here — leaving them permanently nil would not improve wire fidelity, only add dead surface. Generic Event fields (Id/Name/ParentId/SubType/EventType) ARE populated for every event, including STEP/WAIT/CALLBACK/CONTEXT/CHAINED_INVOKE ones driven by CheckpointDurableExecution's Updates.

type ExecutionStoppedDetails added in v1.2.0

type ExecutionStoppedDetails struct {
	Error *EventError `json:"Error,omitempty"`
}

ExecutionStoppedDetails mirrors types.ExecutionStoppedDetails.

type ExecutionSucceededDetails added in v1.2.0

type ExecutionSucceededDetails struct {
	Result *EventResult `json:"Result,omitempty"`
}

ExecutionSucceededDetails mirrors types.ExecutionSucceededDetails.

type ExecutionTimedOutDetails added in v1.2.0

type ExecutionTimedOutDetails struct {
	Error *EventError `json:"Error,omitempty"`
}

ExecutionTimedOutDetails mirrors types.ExecutionTimedOutDetails.

type FISInvocationFault

type FISInvocationFault struct {
	Expiry           time.Time
	ErrorProbability float64
	AddDelayMs       int
}

FISInvocationFault holds the fault configuration for a Lambda function invocation.

type FileSystemConfig

type FileSystemConfig struct {
	Arn            string `json:"Arn"`
	LocalMountPath string `json:"LocalMountPath"`
}

FileSystemConfig holds an EFS mount configuration for a Lambda function.

type Filter

type Filter struct {
	Pattern string `json:"Pattern,omitempty"`
}

Filter is a single filter pattern. Pattern is a serialized JSON document describing the expected event shape (AWS event-pattern matching syntax).

type FilterCriteria

type FilterCriteria struct {
	Filters []Filter `json:"Filters,omitempty"`
}

FilterCriteria mirrors the AWS Lambda EventSourceMapping FilterCriteria field. Each filter is a JSON pattern object; AWS allows up to 5 filters per mapping.

type FunctionAlias

type FunctionAlias struct {
	RoutingConfig   *AliasRoutingConfig `json:"RoutingConfig,omitempty"`
	AliasArn        string              `json:"AliasArn"`
	Description     string              `json:"Description,omitempty"`
	FunctionVersion string              `json:"FunctionVersion"`
	Name            string              `json:"Name"`
	RevisionID      string              `json:"RevisionId"`
}

FunctionAlias holds an alias mapping (alias name → version number).

type FunctionCode

type FunctionCode struct {
	ImageURI string `json:"ImageUri,omitempty"`
	S3Bucket string `json:"S3Bucket,omitempty"`
	S3Key    string `json:"S3Key,omitempty"`
	ZipFile  []byte `json:"ZipFile,omitempty"`
}

FunctionCode holds the code location for a Lambda function. For Image package type, only ImageUri is used. For Zip package type, either ZipFile (inline base64) or S3Bucket+S3Key is used.

type FunctionCodeLocation

type FunctionCodeLocation struct {
	ImageURI       string `json:"ImageUri,omitempty"`
	RepositoryType string `json:"RepositoryType,omitempty"`
	Location       string `json:"Location,omitempty"`
}

FunctionCodeLocation describes where the function code is stored.

type FunctionConcurrency

type FunctionConcurrency struct {
	ReservedConcurrentExecutions int `json:"ReservedConcurrentExecutions"`
}

FunctionConcurrency holds the reserved concurrency configuration for a Lambda function.

type FunctionConfiguration

type FunctionConfiguration struct {
	CreatedAt                    time.Time               `json:"-"`
	DurableConfig                *DurableConfig          `json:"DurableConfig,omitempty"`
	Environment                  *EnvironmentConfig      `json:"Environment,omitempty"`
	EphemeralStorage             *EphemeralStorageConfig `json:"EphemeralStorage,omitempty"`
	LoggingConfig                *LoggingConfig          `json:"LoggingConfig,omitempty"`
	ReservedConcurrentExecutions *int                    `json:"ReservedConcurrentExecutions,omitempty"`
	VpcConfig                    *VpcConfig              `json:"VpcConfig,omitempty"`
	TracingConfig                *TracingConfig          `json:"TracingConfig,omitempty"`
	DeadLetterConfig             *DeadLetterConfig       `json:"DeadLetterConfig,omitempty"`
	ImageConfig                  *ImageConfig            `json:"ImageConfig,omitempty"`
	Tags                         map[string]string       `json:"Tags,omitempty"`
	SnapStart                    *SnapStartResponse      `json:"SnapStart,omitempty"`
	ImageURI                     string                  `json:"ImageUri,omitempty"`
	LastUpdateStatus             LastUpdateStatus        `json:"LastUpdateStatus"`
	LastUpdateStatusReason       string                  `json:"LastUpdateStatusReason,omitempty"`
	// MasterArn is the ARN of the owner function for Lambda@Edge replicas.
	// When set, GetFunctionConfiguration returns this field to signal the function is an edge replica.
	MasterArn         string              `json:"MasterArn,omitempty"`
	PackageType       string              `json:"PackageType"`
	StateReason       string              `json:"StateReason,omitempty"`
	StateReasonCode   string              `json:"StateReasonCode,omitempty"`
	Role              string              `json:"Role"`
	LastModified      string              `json:"LastModified"`
	Runtime           string              `json:"Runtime,omitempty"`
	RevisionID        string              `json:"RevisionId"`
	Description       string              `json:"Description"`
	FunctionArn       string              `json:"FunctionArn"`
	State             FunctionState       `json:"State"`
	FunctionName      string              `json:"FunctionName"`
	CodeSha256        string              `json:"CodeSha256,omitempty"`
	S3BucketCode      string              `json:"-"`
	S3KeyCode         string              `json:"-"`
	Handler           string              `json:"Handler,omitempty"`
	Version           string              `json:"Version,omitempty"`
	FileSystemConfigs []*FileSystemConfig `json:"FileSystemConfigs,omitempty"`
	ZipData           []byte              `json:"-"`
	Layers            []*FunctionLayer    `json:"Layers,omitempty"`
	Architectures     []string            `json:"Architectures,omitempty"`
	MemorySize        int                 `json:"MemorySize"`
	Timeout           int                 `json:"Timeout"`
	CodeSize          int64               `json:"CodeSize"`
}

type FunctionEventInvokeConfig

type FunctionEventInvokeConfig struct {
	DestinationConfig        *DestinationConfig `json:"DestinationConfig,omitempty"`
	MaximumEventAgeInSeconds *int               `json:"MaximumEventAgeInSeconds,omitempty"`
	MaximumRetryAttempts     *int               `json:"MaximumRetryAttempts,omitempty"`
	FunctionArn              string             `json:"FunctionArn"`
	LastModified             float64            `json:"LastModified"`
}

FunctionEventInvokeConfig holds the async invocation configuration for a Lambda function.

LastModified is wire-bound as epoch-seconds (a JSON number), NOT an ISO8601 string — unlike FunctionConfiguration.LastModified, which real AWS DOES serialize as an ISO8601 string. Verified against the SDK deserializer: PutFunctionEventInvokeConfig's LastModified case parses a json.Number, while FunctionConfiguration's parses a JSON string. Use awstime.Epoch when setting this field.

type FunctionLayer

type FunctionLayer struct {
	Arn      string `json:"Arn,omitempty"`
	CodeSize int64  `json:"CodeSize,omitempty"`
}

FunctionLayer holds a layer reference attached to a Lambda function.

type FunctionPermission

type FunctionPermission struct {
	InvokedViaFunctionURL *bool  `json:"-"`
	Action                string `json:"Action"`
	Effect                string `json:"Effect"`
	FunctionName          string `json:"-"`
	Qualifier             string `json:"-"`
	Principal             string `json:"Principal"`
	SourceAccount         string `json:"SourceAccount,omitempty"`
	SourceArn             string `json:"SourceArn,omitempty"`
	EventSourceToken      string `json:"EventSourceToken,omitempty"`
	PrincipalOrgID        string `json:"PrincipalOrgID,omitempty"`
	StatementID           string `json:"Sid"`
	// FunctionURLAuthType's JSON tag is intentionally "-": it is echoed into
	// the policy statement's Condition block (see buildPermissionStatementJSON
	// in permissions.go), not surfaced as a top-level FunctionPermission field.
	FunctionURLAuthType string `json:"-"`
}

FunctionPermission is a single statement in a function resource-based policy. Qualifier records the version/alias this statement is scoped to (empty for the unqualified function-wide policy), matching real AWS per-qualifier policies.

type FunctionRecursionConfig

type FunctionRecursionConfig struct {
	RecursiveLoop string `json:"RecursiveLoop"`
}

FunctionRecursionConfig holds the recursion detection configuration for a Lambda function.

type FunctionScalingConfig

type FunctionScalingConfig struct {
	MaximumConcurrency *int   `json:"MaximumConcurrency,omitempty"`
	FunctionArn        string `json:"FunctionArn,omitempty"`
}

FunctionScalingConfig holds the scaling configuration for a Lambda function.

type FunctionState

type FunctionState string

FunctionState represents the lifecycle state of a Lambda function.

const (
	// FunctionStateActive means the function is ready to be invoked.
	FunctionStateActive FunctionState = "Active"
	// FunctionStatePending means the function is being created.
	FunctionStatePending FunctionState = "Pending"
	// FunctionStateFailed means the function failed to deploy.
	FunctionStateFailed FunctionState = "Failed"
	// FunctionStateInactive means the function has been idle and its execution environment has been reclaimed.
	FunctionStateInactive FunctionState = "Inactive"
)

type FunctionURLConfig

type FunctionURLConfig struct {
	Cors             *FunctionURLCors `json:"Cors,omitempty"`
	FunctionArn      string           `json:"FunctionArn"`
	FunctionURL      string           `json:"FunctionUrl"`
	AuthType         string           `json:"AuthType"`
	InvokeMode       string           `json:"InvokeMode,omitempty"`
	CreationTime     string           `json:"CreationTime"`
	LastModifiedTime string           `json:"LastModifiedTime"`
}

FunctionURLConfig holds the configuration for a Lambda function URL.

type FunctionURLCors

type FunctionURLCors struct {
	AllowOrigins     []string `json:"AllowOrigins,omitempty"`
	AllowMethods     []string `json:"AllowMethods,omitempty"`
	AllowHeaders     []string `json:"AllowHeaders,omitempty"`
	ExposeHeaders    []string `json:"ExposeHeaders,omitempty"`
	MaxAge           int      `json:"MaxAge,omitempty"`
	AllowCredentials bool     `json:"AllowCredentials,omitempty"`
}

FunctionURLCors holds CORS configuration for a Lambda function URL.

type FunctionVersion

type FunctionVersion struct {
	DurableConfig     *DurableConfig      `json:"DurableConfig,omitempty"`
	Environment       *EnvironmentConfig  `json:"Environment,omitempty"`
	VpcConfig         *VpcConfig          `json:"VpcConfig,omitempty"`
	TracingConfig     *TracingConfig      `json:"TracingConfig,omitempty"`
	FileSystemConfigs []*FileSystemConfig `json:"FileSystemConfigs,omitempty"`
	DeadLetterConfig  *DeadLetterConfig   `json:"DeadLetterConfig,omitempty"`
	ImageConfig       *ImageConfig        `json:"ImageConfig,omitempty"`
	SnapStart         *SnapStartResponse  `json:"SnapStart,omitempty"`
	FunctionArn       string              `json:"FunctionArn"`
	FunctionName      string              `json:"FunctionName"`
	RevisionID        string              `json:"RevisionId"`
	ImageURI          string              `json:"ImageUri,omitempty"`
	PackageType       string              `json:"PackageType"`
	Role              string              `json:"Role"`
	Runtime           string              `json:"Runtime,omitempty"`
	CreatedAt         string              `json:"LastModified"`
	Handler           string              `json:"Handler,omitempty"`
	State             FunctionState       `json:"State"`
	Description       string              `json:"Description"`
	Version           string              `json:"Version"`
	CodeSha256        string              `json:"CodeSha256,omitempty"`
	Layers            []*FunctionLayer    `json:"Layers,omitempty"`
	MemorySize        int                 `json:"MemorySize"`
	Timeout           int                 `json:"Timeout"`
	CodeSize          int64               `json:"CodeSize"`
}

FunctionVersion holds an immutable snapshot of a Lambda function configuration at publish time.

type GetDurableExecutionHistoryOutput added in v1.2.0

type GetDurableExecutionHistoryOutput struct {
	NextMarker *string                 `json:"NextMarker,omitempty"`
	Events     []DurableExecutionEvent `json:"Events"`
}

GetDurableExecutionHistoryOutput mirrors api_op_GetDurableExecutionHistory.go's output.

type GetDurableExecutionOutput added in v1.2.0

type GetDurableExecutionOutput struct {
	DurableConfig         *DurableConfig         `json:"DurableConfig,omitempty"`
	Error                 *ErrorObject           `json:"Error,omitempty"`
	ExecutionDataIncluded *bool                  `json:"ExecutionDataIncluded,omitempty"`
	InputPayload          *string                `json:"InputPayload,omitempty"`
	Result                *string                `json:"Result,omitempty"`
	TraceHeader           *TraceHeader           `json:"TraceHeader,omitempty"`
	Version               *string                `json:"Version,omitempty"`
	EndTimestamp          *float64               `json:"EndTimestamp,omitempty"`
	DurableExecutionArn   string                 `json:"DurableExecutionArn"`
	DurableExecutionName  string                 `json:"DurableExecutionName"`
	FunctionArn           string                 `json:"FunctionArn"`
	Status                DurableExecutionStatus `json:"Status"`
	StartTimestamp        float64                `json:"StartTimestamp"`
}

GetDurableExecutionOutput mirrors api_op_GetDurableExecution.go's GetDurableExecutionOutput field-for-field (verified against aws-sdk-go-v2/service/lambda@v1.97.0/deserializers.go). Previously gopherstack emitted a single merged "ExecutionArn" field and ISO8601 StartTime/StopTime strings; the real shape splits DurableExecutionArn from DurableExecutionName and uses Unix-epoch StartTimestamp/EndTimestamp.

type GetDurableExecutionStateOutput added in v1.2.0

type GetDurableExecutionStateOutput struct {
	NextMarker *string             `json:"NextMarker,omitempty"`
	Operations []*DurableOperation `json:"Operations"`
}

GetDurableExecutionStateOutput mirrors api_op_GetDurableExecutionState.go's output.

type GetFunctionCodeSigningConfigOutput

type GetFunctionCodeSigningConfigOutput struct {
	CodeSigningConfigArn string `json:"CodeSigningConfigArn"`
	FunctionName         string `json:"FunctionName"`
}

GetFunctionCodeSigningConfigOutput is the response for GetFunctionCodeSigningConfig.

type GetFunctionOutput

type GetFunctionOutput struct {
	Configuration *FunctionConfiguration `json:"Configuration"`
	Code          *FunctionCodeLocation  `json:"Code,omitempty"`
}

GetFunctionOutput is the response for GetFunction.

type GetLayerVersionOutput

type GetLayerVersionOutput struct {
	Content            *LayerVersionContent `json:"Content"`
	LayerVersionArn    string               `json:"LayerVersionArn"`
	LayerArn           string               `json:"LayerArn"`
	Description        string               `json:"Description,omitempty"`
	CreatedDate        string               `json:"CreatedDate"`
	LicenseInfo        string               `json:"LicenseInfo,omitempty"`
	CompatibleRuntimes []string             `json:"CompatibleRuntimes,omitempty"`
	Version            int64                `json:"Version"`
}

GetLayerVersionOutput is the response for GetLayerVersion.

type GetPolicyOutput

type GetPolicyOutput struct {
	Policy     *string `json:"Policy,omitempty"`
	RevisionID *string `json:"RevisionId,omitempty"`
}

GetPolicyOutput is the response for GetPolicy (returns the function resource policy JSON).

type Handler

type Handler struct {
	Backend StorageBackend

	DefaultRegion string
	AccountID     string
	// contains filtered or unexported fields
}

Handler is the Echo HTTP handler for Lambda operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Lambda handler with the given backend.

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 Lambda instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExecuteFISAction

func (h *Handler) ExecuteFISAction(ctx context.Context, action service.FISActionExecution) error

ExecuteFISAction executes a FIS action against resolved Lambda function targets.

func (*Handler) ExtractOperation

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

ExtractOperation returns the Lambda operation name derived from the request method and path.

func (*Handler) ExtractResource

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

ExtractResource returns the function name from the request path.

func (*Handler) FISActions

func (h *Handler) FISActions() []service.FISActionDefinition

FISActions returns the FIS action definitions that the Lambda service supports.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns the list of supported Lambda operations.

func (*Handler) Handler

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

Handler returns the Echo handler function for Lambda operations.

func (*Handler) IAMAction

func (h *Handler) IAMAction(r *http.Request) string

IAMAction returns the IAM action for a Lambda HTTP request. It implements iam.ActionExtractor, providing per-service action extraction for Lambda REST API paths that are not covered by the global action mapper.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority for the Lambda handler.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Purge

func (h *Handler) Purge(ctx context.Context, cutoff time.Time)

Purge removes all resources older than the given cutoff time.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state from the backend. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development.

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 identifies Lambda requests by path prefix.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker starts the Kinesis event source poller and the resource janitor. It implements service.BackgroundWorker.

func (*Handler) TagFunctionByARN

func (h *Handler) TagFunctionByARN(_ context.Context, fnARN string, newTags map[string]string) error

TagFunctionByARN applies tags to the Lambda function identified by its ARN.

func (*Handler) TaggedFunctions

func (h *Handler) TaggedFunctions(_ context.Context) []TaggedFunctionInfo

TaggedFunctions returns a snapshot of all Lambda functions with their ARNs and tags. Intended for use by the Resource Groups Tagging API provider.

func (*Handler) UntagFunctionByARN

func (h *Handler) UntagFunctionByARN(_ context.Context, fnARN string, tagKeys []string) error

UntagFunctionByARN removes the specified tag keys from the Lambda function identified by its ARN.

type ImageConfig

type ImageConfig struct {
	Command          []string `json:"Command,omitempty"`
	WorkingDirectory string   `json:"WorkingDirectory,omitempty"`
	EntryPoint       []string `json:"EntryPoint,omitempty"`
}

ImageConfig holds optional image command/entrypoint overrides.

type InMemoryBackend

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

InMemoryBackend is a concurrency-safe in-memory Lambda backend.

func NewInMemoryBackend

func NewInMemoryBackend(
	dockerClient container.Runtime,
	portAlloc *portalloc.Allocator,
	settings Settings,
	accountID, region string,
) *InMemoryBackend

NewInMemoryBackend creates a new Lambda in-memory backend with a background service context.

func NewInMemoryBackendWithContext

func NewInMemoryBackendWithContext(
	svcCtx context.Context,
	dockerClient container.Runtime,
	portAlloc *portalloc.Allocator,
	settings Settings,
	accountID, region string,
) *InMemoryBackend

NewInMemoryBackendWithContext creates a new Lambda in-memory backend whose background goroutines are bounded by svcCtx. If svcCtx is nil, context.Background is used.

func (*InMemoryBackend) AddLayerVersionPermission

func (b *InMemoryBackend) AddLayerVersionPermission(
	layerName string, version int64, input *AddLayerVersionPermissionInput,
) (*AddLayerVersionPermissionOutput, error)

AddLayerVersionPermission adds a permission statement to a layer version's resource policy. A duplicate StatementId is rejected with ErrFunctionAlreadyExists (ResourceConflictException), matching AddPermission's function-policy behavior. When input.RevisionID is non-empty it must match the policy's current revision or the call is rejected with ErrPreconditionFailed.

func (*InMemoryBackend) AddPermission

func (b *InMemoryBackend) AddPermission(
	functionName, qualifier string,
	input *AddPermissionInput,
) (*AddPermissionOutput, error)

AddPermission adds a permission statement to a function's resource-based policy. When qualifier is non-empty the statement is scoped to that version/alias, matching real Lambda: the invoker must then use the qualified ARN to invoke.

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close(ctx context.Context)

Close shuts down all active function URL servers and runtime API servers. It is safe to call concurrently and should be called when the backend is no longer needed.

func (*InMemoryBackend) CreateAlias

func (b *InMemoryBackend) CreateAlias(
	name string,
	input *CreateAliasInput,
) (*FunctionAlias, error)

CreateAlias creates a new alias for a Lambda function pointing to a version.

func (*InMemoryBackend) CreateCapacityProvider

func (b *InMemoryBackend) CreateCapacityProvider(
	input *CreateCapacityProviderInput,
) (*CapacityProvider, error)

CreateCapacityProvider creates a new Lambda capacity provider.

func (*InMemoryBackend) CreateCodeSigningConfig

func (b *InMemoryBackend) CreateCodeSigningConfig(
	input *CreateCodeSigningConfigInput,
) (*CodeSigningConfig, error)

CreateCodeSigningConfig creates a new Lambda code signing configuration.

func (*InMemoryBackend) CreateEventSourceMapping

func (b *InMemoryBackend) CreateEventSourceMapping(
	input *CreateEventSourceMappingInput,
) (*EventSourceMapping, error)

CreateEventSourceMapping creates a new event source mapping.

func (*InMemoryBackend) CreateFunction

func (b *InMemoryBackend) CreateFunction(fn *FunctionConfiguration) error

func (*InMemoryBackend) CreateFunctionURLConfig

func (b *InMemoryBackend) CreateFunctionURLConfig(
	ctx context.Context,
	functionName, authType string,
	cors *FunctionURLCors,
	invokeMode string,
) (*FunctionURLConfig, error)

CreateFunctionURLConfig creates a function URL endpoint for the given function. It allocates a port, starts an HTTP listener, registers DNS, and returns the config. The mutex is released before port allocation and listener startup (IO) to avoid holding the lock during potentially slow system calls.

func (*InMemoryBackend) DeleteAlias

func (b *InMemoryBackend) DeleteAlias(name, aliasName string) error

DeleteAlias removes a named alias from a function.

func (*InMemoryBackend) DeleteCapacityProvider

func (b *InMemoryBackend) DeleteCapacityProvider(name string) error

DeleteCapacityProvider removes a capacity provider by name.

func (*InMemoryBackend) DeleteCodeSigningConfig

func (b *InMemoryBackend) DeleteCodeSigningConfig(cscARN string) error

DeleteCodeSigningConfig removes a code signing config by ARN.

func (*InMemoryBackend) DeleteEventSourceMapping

func (b *InMemoryBackend) DeleteEventSourceMapping(id string) (*EventSourceMapping, error)

DeleteEventSourceMapping removes an event source mapping by UUID.

func (*InMemoryBackend) DeleteFunction

func (b *InMemoryBackend) DeleteFunction(name string) error

DeleteFunction removes a Lambda function and cleans up its runtime server.

func (*InMemoryBackend) DeleteFunctionCodeSigningConfig

func (b *InMemoryBackend) DeleteFunctionCodeSigningConfig(functionName string) error

DeleteFunctionCodeSigningConfig removes the code signing config association from a function.

func (*InMemoryBackend) DeleteFunctionConcurrency

func (b *InMemoryBackend) DeleteFunctionConcurrency(name string) error

DeleteFunctionConcurrency removes the reserved concurrency setting for a function, restoring it to the account-level default.

func (*InMemoryBackend) DeleteFunctionEventInvokeConfig

func (b *InMemoryBackend) DeleteFunctionEventInvokeConfig(name string) error

DeleteFunctionEventInvokeConfig removes the event invoke configuration for a function.

func (*InMemoryBackend) DeleteFunctionURLConfig

func (b *InMemoryBackend) DeleteFunctionURLConfig(functionName string) error

DeleteFunctionURLConfig removes the function URL config, stops the listener, and deregisters DNS.

func (*InMemoryBackend) DeleteLayerVersion

func (b *InMemoryBackend) DeleteLayerVersion(layerName string, version int64) error

DeleteLayerVersion removes an immutable layer version.

func (*InMemoryBackend) DeleteProvisionedConcurrencyConfig

func (b *InMemoryBackend) DeleteProvisionedConcurrencyConfig(name, qualifier string) error

DeleteProvisionedConcurrencyConfig removes the provisioned concurrency configuration for a function qualifier.

func (*InMemoryBackend) GetAccountSettings

func (b *InMemoryBackend) GetAccountSettings() *AccountSettingsOutput

GetAccountSettings returns the Lambda account settings for this in-memory backend.

func (*InMemoryBackend) GetAlias

func (b *InMemoryBackend) GetAlias(name, aliasName string) (*FunctionAlias, error)

GetAlias returns a named alias for a function.

func (*InMemoryBackend) GetCapacityProvider

func (b *InMemoryBackend) GetCapacityProvider(name string) (*CapacityProvider, error)

GetCapacityProvider retrieves a capacity provider by name.

func (*InMemoryBackend) GetCodeSigningConfig

func (b *InMemoryBackend) GetCodeSigningConfig(cscARN string) (*CodeSigningConfig, error)

GetCodeSigningConfig retrieves a code signing config by ARN.

func (*InMemoryBackend) GetEventSourceMapping

func (b *InMemoryBackend) GetEventSourceMapping(uuid string) (*EventSourceMapping, error)

GetEventSourceMapping retrieves an event source mapping by UUID.

func (*InMemoryBackend) GetFunction

func (b *InMemoryBackend) GetFunction(name string) (*FunctionConfiguration, error)

GetFunction retrieves a Lambda function configuration by name.

func (*InMemoryBackend) GetFunctionByQualifier

func (b *InMemoryBackend) GetFunctionByQualifier(
	name, qualifier string,
) (*FunctionConfiguration, error)

GetFunctionByQualifier returns the configuration for a specific qualifier (version number, alias name, "$LATEST", or empty for $LATEST).

Matching real AWS GetFunction/GetFunctionConfiguration behaviour:

  • "" or "$LATEST" returns the live function configuration unchanged.
  • A numeric version returns the immutable published snapshot, with FunctionArn suffixed ":<version>" and Version set to that number.
  • An alias name resolves to the alias's primary target version, but the returned FunctionArn is suffixed with the alias name (":<alias>") — AWS echoes the qualifier you asked for in the ARN while reporting the resolved Version. Weighted routing config does NOT affect GetFunction.

Returns ErrFunctionNotFound when the function does not exist and ErrVersionNotFound when the qualifier resolves to no known version/alias.

func (*InMemoryBackend) GetFunctionCodeSigningConfig

func (b *InMemoryBackend) GetFunctionCodeSigningConfig(functionName string) (string, error)

GetFunctionCodeSigningConfig returns the code signing config ARN associated with a function.

func (*InMemoryBackend) GetFunctionConcurrency

func (b *InMemoryBackend) GetFunctionConcurrency(name string) (*FunctionConcurrency, error)

GetFunctionConcurrency returns the reserved concurrent executions for a function.

func (*InMemoryBackend) GetFunctionEventInvokeConfig

func (b *InMemoryBackend) GetFunctionEventInvokeConfig(
	name string,
) (*FunctionEventInvokeConfig, error)

GetFunctionEventInvokeConfig returns the event invoke configuration for a function.

func (*InMemoryBackend) GetFunctionRecursionConfig

func (b *InMemoryBackend) GetFunctionRecursionConfig(
	name string,
) (*FunctionRecursionConfig, error)

GetFunctionRecursionConfig returns the recursion config for a function.

func (*InMemoryBackend) GetFunctionScalingConfig

func (b *InMemoryBackend) GetFunctionScalingConfig(name string) (*FunctionScalingConfig, error)

GetFunctionScalingConfig returns the scaling config for a function.

func (*InMemoryBackend) GetFunctionURLConfig

func (b *InMemoryBackend) GetFunctionURLConfig(functionName string) (*FunctionURLConfig, error)

GetFunctionURLConfig returns the function URL config for a function.

func (*InMemoryBackend) GetLayerVersion

func (b *InMemoryBackend) GetLayerVersion(
	layerName string,
	version int64,
) (*GetLayerVersionOutput, error)

GetLayerVersion retrieves metadata for a specific layer version.

func (*InMemoryBackend) GetLayerVersionByArn

func (b *InMemoryBackend) GetLayerVersionByArn(
	layerVersionARN string,
) (*GetLayerVersionOutput, error)

GetLayerVersionByArn retrieves a layer version by its full ARN.

func (*InMemoryBackend) GetLayerVersionPolicy

func (b *InMemoryBackend) GetLayerVersionPolicy(
	layerName string,
	version int64,
) (*LayerVersionPolicy, error)

GetLayerVersionPolicy returns the resource policy for a layer version.

func (*InMemoryBackend) GetPolicy

func (b *InMemoryBackend) GetPolicy(functionName, qualifier string) (*GetPolicyOutput, error)

GetPolicy returns the resource-based policy JSON for a function, scoped to qualifier when non-empty.

func (*InMemoryBackend) GetProvisionedConcurrencyConfig

func (b *InMemoryBackend) GetProvisionedConcurrencyConfig(
	name, qualifier string,
) (*ProvisionedConcurrencyConfig, error)

GetProvisionedConcurrencyConfig returns the provisioned concurrency configuration for a function qualifier.

func (*InMemoryBackend) GetRuntimeManagementConfig

func (b *InMemoryBackend) GetRuntimeManagementConfig(
	name string,
) (*RuntimeManagementConfig, error)

GetRuntimeManagementConfig returns the runtime management config for a function.

func (*InMemoryBackend) GetVersion

func (b *InMemoryBackend) GetVersion(name, version string) (*FunctionVersion, error)

GetVersion returns a specific version snapshot of a function. Pass "$LATEST" to get the live function config as a FunctionVersion.

func (*InMemoryBackend) InvokeFunction

func (b *InMemoryBackend) InvokeFunction(
	ctx context.Context,
	name string,
	invocationType InvocationType,
	payload []byte,
) ([]byte, int, error)

InvokeFunction invokes a Lambda function without a qualifier (equivalent to "$LATEST"). For qualified invocations (alias or version number), use InvokeFunctionWithQualifier.

func (*InMemoryBackend) InvokeFunctionWithQualifier

func (b *InMemoryBackend) InvokeFunctionWithQualifier(
	ctx context.Context,
	name, qualifier, clientContext, logType string,
	invocationType InvocationType,
	payload []byte,
) ([]byte, string, string, int, error)

InvokeFunctionWithQualifier invokes a Lambda function using an optional qualifier.

func (*InMemoryBackend) ListAliases

func (b *InMemoryBackend) ListAliases(
	name, functionVersion, marker string,
	maxItems int,
) (page.Page[*FunctionAlias], error)

ListAliases returns a page of aliases for a function sorted by name. If functionVersion is non-empty, only aliases pointing to that version are returned.

func (*InMemoryBackend) ListCapacityProviders

func (b *InMemoryBackend) ListCapacityProviders() []*CapacityProvider

ListCapacityProviders returns all capacity providers.

func (*InMemoryBackend) ListCodeSigningConfigs

func (b *InMemoryBackend) ListCodeSigningConfigs() []*CodeSigningConfig

ListCodeSigningConfigs returns all code signing configs.

func (*InMemoryBackend) ListEventSourceMappings

func (b *InMemoryBackend) ListEventSourceMappings(
	functionName, eventSourceARN, marker string,
	maxItems int,
) page.Page[*EventSourceMapping]

ListEventSourceMappings returns a page of event source mappings, optionally filtered by function name.

func (*InMemoryBackend) ListFunctionEventInvokeConfigs

func (b *InMemoryBackend) ListFunctionEventInvokeConfigs(
	name, marker string,
	maxItems int,
) ([]*FunctionEventInvokeConfig, string, error)

ListFunctionEventInvokeConfigs returns a page of event invoke configurations for a function.

func (*InMemoryBackend) ListFunctionURLConfigs

func (b *InMemoryBackend) ListFunctionURLConfigs() []*FunctionURLConfig

ListFunctionURLConfigs returns all function URL configs.

func (*InMemoryBackend) ListFunctionVersionsByCapacityProvider

func (b *InMemoryBackend) ListFunctionVersionsByCapacityProvider(
	name, marker string,
	maxItems int,
) (page.Page[string], error)

ListFunctionVersionsByCapacityProvider returns a page of function-version ARNs assigned to the named capacity provider. It returns ErrFunctionNotFound if the provider does not exist. Assignments are populated only via the internal SeedCapacityProviderFunctionVersions helper, since AWS exposes no public assignment API in this emulator's surface.

func (*InMemoryBackend) ListFunctions

func (b *InMemoryBackend) ListFunctions(
	marker string,
	maxItems int,
) page.Page[*FunctionConfiguration]

ListFunctions returns a page of Lambda function configurations sorted by name.

func (*InMemoryBackend) ListFunctionsAll

func (b *InMemoryBackend) ListFunctionsAll(
	marker string,
	maxItems int,
) page.Page[*FunctionConfiguration]

ListFunctionsAll returns a page of all published versions across all functions, sorted by FunctionName then numerically by version. This is the response for ListFunctions?FunctionVersion=ALL.

func (*InMemoryBackend) ListFunctionsByCodeSigningConfig

func (b *InMemoryBackend) ListFunctionsByCodeSigningConfig(cscARN string) ([]string, error)

ListFunctionsByCodeSigningConfig returns function ARNs associated with a code signing config.

func (*InMemoryBackend) ListLayerVersions

func (b *InMemoryBackend) ListLayerVersions(layerName, compatibleRuntime string) ([]*LayerVersion, error)

ListLayerVersions returns all versions of a specific layer in descending order.

func (*InMemoryBackend) ListLayers

func (b *InMemoryBackend) ListLayers(compatibleRuntime, marker string, maxItems int) page.Page[*Layer]

ListLayers returns a paginated summary of all layers with their latest version. Marker is an opaque cursor; maxItems uses lambdaDefaultMaxItems when zero.

func (*InMemoryBackend) ListProvisionedConcurrencyConfigs

func (b *InMemoryBackend) ListProvisionedConcurrencyConfigs(
	name string,
) ([]*ProvisionedConcurrencyConfig, error)

ListProvisionedConcurrencyConfigs returns all provisioned concurrency configurations for a function.

func (*InMemoryBackend) ListVersionsByFunction

func (b *InMemoryBackend) ListVersionsByFunction(
	name, marker string,
	maxItems int,
) (page.Page[*FunctionVersion], error)

ListVersionsByFunction returns a page of published versions for a function (including $LATEST).

func (*InMemoryBackend) PublishLayerVersion

func (b *InMemoryBackend) PublishLayerVersion(
	input *PublishLayerVersionInput,
) (*PublishLayerVersionOutput, error)

PublishLayerVersion creates a new immutable version of the named layer.

func (*InMemoryBackend) PublishVersion

func (b *InMemoryBackend) PublishVersion(name, description string) (*FunctionVersion, error)

PublishVersion creates an immutable version snapshot of the current $LATEST function config.

func (*InMemoryBackend) PublishVersionWithRevision added in v1.2.0

func (b *InMemoryBackend) PublishVersionWithRevision(name, description, revisionID string) (*FunctionVersion, error)

PublishVersionWithRevision behaves like PublishVersion but additionally enforces AWS's optimistic-concurrency RevisionId precondition: when revisionID is non-empty it must match the function's current ($LATEST) RevisionId or the publish is rejected with ErrPreconditionFailed and the function is left unmodified. The check and the publish happen under a single lock acquisition to avoid a check-then-act race against a concurrent UpdateFunctionConfiguration/UpdateFunctionCode.

func (*InMemoryBackend) Purge

func (b *InMemoryBackend) Purge(ctx context.Context, cutoff time.Time)

Purge removes all functions older than the given cutoff time.

func (*InMemoryBackend) PutFunctionCodeSigningConfig

func (b *InMemoryBackend) PutFunctionCodeSigningConfig(functionName, cscARN string) error

PutFunctionCodeSigningConfig associates a code signing config with a function.

func (*InMemoryBackend) PutFunctionConcurrency

func (b *InMemoryBackend) PutFunctionConcurrency(
	name string,
	reserved int,
) (*FunctionConcurrency, error)

PutFunctionConcurrency sets the reserved concurrent executions for a function. Setting ReservedConcurrentExecutions to 0 disables all invocations of the function.

func (*InMemoryBackend) PutFunctionEventInvokeConfig

func (b *InMemoryBackend) PutFunctionEventInvokeConfig(
	name string,
	input *PutFunctionEventInvokeConfigInput,
) (*FunctionEventInvokeConfig, error)

PutFunctionEventInvokeConfig creates or replaces the event invoke configuration for a function.

func (*InMemoryBackend) PutFunctionRecursionConfig

func (b *InMemoryBackend) PutFunctionRecursionConfig(
	name string,
	input *PutFunctionRecursionConfigInput,
) (*FunctionRecursionConfig, error)

PutFunctionRecursionConfig sets the recursion config for a function.

func (*InMemoryBackend) PutFunctionScalingConfig

func (b *InMemoryBackend) PutFunctionScalingConfig(
	name string,
	input *PutFunctionScalingConfigInput,
) (*FunctionScalingConfig, error)

PutFunctionScalingConfig sets the scaling config for a function.

func (*InMemoryBackend) PutProvisionedConcurrencyConfig

func (b *InMemoryBackend) PutProvisionedConcurrencyConfig(
	name, qualifier string,
	requested int,
) (*ProvisionedConcurrencyConfig, error)

PutProvisionedConcurrencyConfig sets the provisioned concurrency configuration for a function qualifier. The qualifier must be a version number or alias name; $LATEST is not supported. Status is returned as READY immediately (stub implementation — no actual pre-warming).

func (*InMemoryBackend) PutRuntimeManagementConfig

func (b *InMemoryBackend) PutRuntimeManagementConfig(
	name string,
	input *PutRuntimeManagementConfigInput,
) (*RuntimeManagementConfig, error)

PutRuntimeManagementConfig sets the runtime management config for a function.

func (*InMemoryBackend) RemoveLayerVersionPermission

func (b *InMemoryBackend) RemoveLayerVersionPermission(
	layerName string,
	version int64,
	statementID string,
	revisionID string,
) error

RemoveLayerVersionPermission removes a permission statement from a layer version's resource policy. When revisionID is non-empty it must match the policy's current revision or the call is rejected with ErrPreconditionFailed without mutating the policy.

func (*InMemoryBackend) RemovePermission

func (b *InMemoryBackend) RemovePermission(functionName, qualifier, statementID, revisionID string) error

RemovePermission removes a permission statement from a function's resource-based policy. When revisionID is non-empty it must match the policy's current revision (as returned by GetPolicy), matching real Lambda's optimistic-concurrency check; a mismatch returns ErrPreconditionFailed without mutating the policy.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all in-memory state from the backend. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development. All active function URL server listeners are shut down before state is cleared so ports are released and stale handlers are removed.

func (*InMemoryBackend) Restore

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

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable. Code bytes are not restored — functions must be re-deployed after restore.

func (*InMemoryBackend) SeedCapacityProviderFunctionVersions

func (b *InMemoryBackend) SeedCapacityProviderFunctionVersions(
	name string,
	versions ...string,
) error

SeedCapacityProviderFunctionVersions assigns the given function-version ARNs to the named capacity provider. AWS exposes no public assignment API in this emulator's surface, so this internal helper is the only way to populate the assignments observed by ListFunctionVersionsByCapacityProvider (primarily for tests). It returns ErrFunctionNotFound if the provider does not exist.

func (*InMemoryBackend) SetActivationDelay

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

SetActivationDelay configures how long a newly created function stays in the Pending state before transitioning to Active. Zero (the default) creates functions directly in Active, matching the near-instant activation of ZIP functions; a positive delay reproduces the Pending→Active window AWS exhibits for VPC and container functions.

func (*InMemoryBackend) SetAsyncDestinationDelivery

func (b *InMemoryBackend) SetAsyncDestinationDelivery(d AsyncDestinationDelivery)

SetAsyncDestinationDelivery wires the cross-service delivery implementation used to route DeadLetterConfig and DestinationConfig (OnSuccess/OnFailure) outcomes.

func (*InMemoryBackend) SetCWLogsBackend

func (b *InMemoryBackend) SetCWLogsBackend(cwl CWLogsBackend)

SetCWLogsBackend sets the CloudWatch Logs backend for Lambda log delivery.

func (*InMemoryBackend) SetDNSRegistrar

func (b *InMemoryBackend) SetDNSRegistrar(r DNSRegistrar)

SetDNSRegistrar sets the optional DNS registrar used to register function URL hostnames.

func (*InMemoryBackend) SetDynamoDBStreamsReader

func (b *InMemoryBackend) SetDynamoDBStreamsReader(r DynamoDBStreamsReader)

SetDynamoDBStreamsReader sets the DynamoDB Streams reader on the event source poller so that DynamoDB stream records can trigger Lambda functions via event source mappings.

func (*InMemoryBackend) SetKinesisPoller

func (b *InMemoryBackend) SetKinesisPoller(p *EventSourcePoller)

SetKinesisPoller sets the event source poller for Kinesis stream polling.

func (*InMemoryBackend) SetProvisionedConcurrencyDelay

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

SetProvisionedConcurrencyDelay configures how long a provisioned concurrency config stays IN_PROGRESS before transitioning to READY. Zero (the default) reports READY immediately.

func (*InMemoryBackend) SetS3CodeFetcher

func (b *InMemoryBackend) SetS3CodeFetcher(f S3CodeFetcher)

SetS3CodeFetcher sets the S3CodeFetcher for fetching Zip Lambda code from S3.

func (*InMemoryBackend) SetSQSReader

func (b *InMemoryBackend) SetSQSReader(r SQSReader)

SetSQSReader sets the SQS reader on the event source poller so that SQS queues can trigger Lambda functions via event source mappings.

func (*InMemoryBackend) SetSigV4Secret

func (b *InMemoryBackend) SetSigV4Secret(secret string)

SetSigV4Secret sets the shared secret used to verify SigV4 signatures on AWS_IAM Function URL invocations. When empty the default "test" secret is used.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state to JSON. It implements persistence.Persistable. ZipData (code bytes) are not serialised — code must be re-deployed after restore.

func (*InMemoryBackend) StartKinesisPoller

func (b *InMemoryBackend) StartKinesisPoller(ctx context.Context)

StartKinesisPoller starts the Kinesis event source poller if one has been set. It stores a cancel function so Close() can stop the poller gracefully.

func (*InMemoryBackend) TagResource

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

TagResource applies the given tags to the named function, updating FunctionConfiguration.Tags.

func (*InMemoryBackend) UntagResource

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

UntagResource removes the specified tag keys from the named function's FunctionConfiguration.Tags.

func (*InMemoryBackend) UpdateAlias

func (b *InMemoryBackend) UpdateAlias(
	name, aliasName string,
	input *UpdateAliasInput,
) (*FunctionAlias, error)

UpdateAlias updates an existing alias.

func (*InMemoryBackend) UpdateCapacityProvider

func (b *InMemoryBackend) UpdateCapacityProvider(
	name string,
	input *UpdateCapacityProviderInput,
) (*CapacityProvider, error)

UpdateCapacityProvider updates an existing capacity provider.

func (*InMemoryBackend) UpdateCodeSigningConfig

func (b *InMemoryBackend) UpdateCodeSigningConfig(
	cscARN string,
	input *UpdateCodeSigningConfigInput,
) (*CodeSigningConfig, error)

UpdateCodeSigningConfig updates an existing code signing config.

func (*InMemoryBackend) UpdateEventSourceMapping

func (b *InMemoryBackend) UpdateEventSourceMapping(
	id string,
	input *UpdateEventSourceMappingInput,
) (*EventSourceMapping, error)

UpdateEventSourceMapping updates an existing event source mapping.

func (*InMemoryBackend) UpdateFunction

func (b *InMemoryBackend) UpdateFunction(fn *FunctionConfiguration) error

UpdateFunction replaces a Lambda function's configuration. Any running container is evicted so the next invocation picks up the new code/config.

func (*InMemoryBackend) UpdateFunctionEventInvokeConfig

func (b *InMemoryBackend) UpdateFunctionEventInvokeConfig(
	name string,
	input *PutFunctionEventInvokeConfigInput,
) (*FunctionEventInvokeConfig, error)

UpdateFunctionEventInvokeConfig updates the event invoke configuration for a function. It returns ErrEventInvokeConfigNotFound if no config exists yet.

func (*InMemoryBackend) UpdateFunctionURLConfig

func (b *InMemoryBackend) UpdateFunctionURLConfig(
	functionName, authType string,
	cors *FunctionURLCors,
) (*FunctionURLConfig, error)

UpdateFunctionURLConfig updates an existing function URL config.

type InvocationType

type InvocationType = string

InvocationType for Lambda invocations. Must remain a type alias (= string) because multiple packages (apigateway, eventbridge, secretsmanager, stepfunctions) define LambdaInvoker interfaces with InvokeFunction(... invocationType string ...). A defined type would prevent *InMemoryBackend from satisfying those interfaces.

const (
	// InvocationTypeRequestResponse waits for the function to return.
	InvocationTypeRequestResponse InvocationType = "RequestResponse"
	// InvocationTypeEvent fires and forgets.
	InvocationTypeEvent InvocationType = "Event"
	// InvocationTypeDryRun validates without executing.
	InvocationTypeDryRun InvocationType = "DryRun"

	LogTypeNone = "None"
	LogTypeTail = "Tail"
)

type Janitor

type Janitor struct {
	Backend     *InMemoryBackend
	Interval    time.Duration
	TaskTimeout time.Duration
}

Janitor is the Lambda background worker that manages resource cleanup. It evicts idle runtimes (containers) and cleans up stale event source mappings.

func NewJanitor

func NewJanitor(backend *InMemoryBackend, _ Settings) *Janitor

NewJanitor creates a new Lambda Janitor for the given backend.

func (*Janitor) Run

func (j *Janitor) Run(ctx context.Context)

Run runs the janitor loop until ctx is cancelled.

type KinesisReader

type KinesisReader interface {
	// GetShardIDs returns the shard IDs for the given stream.
	GetShardIDs(streamName string) ([]string, error)
	// GetShardIterator returns an iterator token for a shard.
	GetShardIterator(streamName, shardID, iteratorType, startingSeqNum string) (string, error)
	// GetRecords reads up to limit records from the given iterator, returning records and next iterator.
	GetRecords(iteratorToken string, limit int) ([]KinesisRecord, string, error)
}

KinesisReader is the interface for reading Kinesis records. It is implemented by the kinesis backend.

type KinesisRecord

type KinesisRecord struct {
	ArrivalTime    time.Time
	PartitionKey   string
	SequenceNumber string
	Data           []byte
}

KinesisRecord is a single record from a Kinesis shard.

type LastUpdateStatus

type LastUpdateStatus string

LastUpdateStatus represents the status of the last update to a Lambda function.

const (
	// LastUpdateStatusSuccessful means the last update succeeded.
	LastUpdateStatusSuccessful LastUpdateStatus = "Successful"
	// LastUpdateStatusFailed means the last update failed.
	LastUpdateStatusFailed LastUpdateStatus = "Failed"
	// LastUpdateStatusInProgress means an update is in progress.
	LastUpdateStatusInProgress LastUpdateStatus = "InProgress"
)

type Layer

type Layer struct {
	LatestMatchingVersion *LayerVersion `json:"LatestMatchingVersion,omitempty"`
	LayerArn              string        `json:"LayerArn"`
	LayerName             string        `json:"LayerName"`
}

Layer holds a summary of a layer with its latest version.

type LayerVersion

type LayerVersion struct {
	Content            *LayerVersionContent `json:"Content,omitempty"`
	LayerVersionArn    string               `json:"LayerVersionArn"`
	Description        string               `json:"Description,omitempty"`
	CreatedDate        string               `json:"CreatedDate"`
	LicenseInfo        string               `json:"LicenseInfo,omitempty"`
	CompatibleRuntimes []string             `json:"CompatibleRuntimes,omitempty"`
	ZipData            []byte               `json:"-"`
	Version            int64                `json:"Version"`
}

LayerVersion holds an immutable snapshot of a layer version.

type LayerVersionContent

type LayerVersionContent struct {
	CodeSha256 string `json:"CodeSha256,omitempty"`
	Location   string `json:"Location,omitempty"`
	CodeSize   int64  `json:"CodeSize"`
}

LayerVersionContent holds the content details for a layer version.

type LayerVersionContentInput

type LayerVersionContentInput struct {
	S3Bucket string `json:"S3Bucket,omitempty"`
	S3Key    string `json:"S3Key,omitempty"`
	ZipFile  []byte `json:"ZipFile,omitempty"`
}

LayerVersionContentInput holds the zip content for a new layer version.

type LayerVersionPolicy

type LayerVersionPolicy struct {
	Policy     string `json:"Policy"`
	RevisionID string `json:"RevisionId"`
}

LayerVersionPolicy holds the resource policy for a layer version.

type LayerVersionStatement

type LayerVersionStatement struct {
	Principal   string `json:"Principal"`
	Action      string `json:"Action"`
	StatementID string `json:"StatementId"`
}

LayerVersionStatement is a single statement in a layer version resource policy.

type ListAliasesOutput

type ListAliasesOutput struct {
	NextMarker string           `json:"NextMarker,omitempty"`
	Aliases    []*FunctionAlias `json:"Aliases"`
}

ListAliasesOutput is the response for ListAliases.

type ListCapacityProvidersOutput

type ListCapacityProvidersOutput struct {
	NextMarker        string              `json:"NextMarker,omitempty"`
	CapacityProviders []*CapacityProvider `json:"CapacityProviders"`
}

ListCapacityProvidersOutput is the response for ListCapacityProviders.

type ListCodeSigningConfigsOutput

type ListCodeSigningConfigsOutput struct {
	NextMarker         string               `json:"NextMarker,omitempty"`
	CodeSigningConfigs []*CodeSigningConfig `json:"CodeSigningConfigs"`
}

ListCodeSigningConfigsOutput is the response for ListCodeSigningConfigs.

type ListDurableExecutionsByFunctionOutput added in v1.2.0

type ListDurableExecutionsByFunctionOutput struct {
	NextMarker        *string                   `json:"NextMarker,omitempty"`
	DurableExecutions []DurableExecutionSummary `json:"DurableExecutions"`
}

ListDurableExecutionsByFunctionOutput mirrors api_op_ListDurableExecutionsByFunction.go's output.

type ListFunctionEventInvokeConfigsOutput

type ListFunctionEventInvokeConfigsOutput struct {
	NextMarker                 string                       `json:"NextMarker,omitempty"`
	FunctionEventInvokeConfigs []*FunctionEventInvokeConfig `json:"FunctionEventInvokeConfigs"`
}

ListFunctionEventInvokeConfigsOutput is the response for ListFunctionEventInvokeConfigs.

type ListFunctionURLConfigsOutput

type ListFunctionURLConfigsOutput struct {
	FunctionURLConfigs []*FunctionURLConfig `json:"FunctionUrlConfigs"`
}

ListFunctionURLConfigsOutput is the response for listing function URL configs.

type ListFunctionsByCodeSigningConfigOutput

type ListFunctionsByCodeSigningConfigOutput struct {
	NextMarker   string   `json:"NextMarker,omitempty"`
	FunctionArns []string `json:"FunctionArns"`
}

ListFunctionsByCodeSigningConfigOutput is the response for ListFunctionsByCodeSigningConfig.

type ListFunctionsOutput

type ListFunctionsOutput struct {
	NextMarker string                   `json:"NextMarker,omitempty"`
	Functions  []*FunctionConfiguration `json:"Functions"`
}

ListFunctionsOutput is the response for ListFunctions.

type ListLayerVersionsOutput

type ListLayerVersionsOutput struct {
	NextMarker    string          `json:"NextMarker,omitempty"`
	LayerVersions []*LayerVersion `json:"LayerVersions"`
}

ListLayerVersionsOutput is the response for ListLayerVersions.

type ListLayersOutput

type ListLayersOutput struct {
	NextMarker string   `json:"NextMarker,omitempty"`
	Layers     []*Layer `json:"Layers"`
}

ListLayersOutput is the response for ListLayers.

type ListProvisionedConcurrencyConfigsOutput

type ListProvisionedConcurrencyConfigsOutput struct {
	NextMarker                    string                          `json:"NextMarker,omitempty"`
	ProvisionedConcurrencyConfigs []*ProvisionedConcurrencyConfig `json:"ProvisionedConcurrencyConfigs"`
}

ListProvisionedConcurrencyConfigsOutput is the response for ListProvisionedConcurrencyConfigs.

type ListVersionsByFunctionOutput

type ListVersionsByFunctionOutput struct {
	NextMarker string             `json:"NextMarker,omitempty"`
	Versions   []*FunctionVersion `json:"Versions"`
}

ListVersionsByFunctionOutput is the response for ListVersionsByFunction.

type LoggingConfig

type LoggingConfig struct {
	ApplicationLogLevel string `json:"ApplicationLogLevel,omitempty"`
	LogFormat           string `json:"LogFormat"`
	LogGroup            string `json:"LogGroup,omitempty"`
	SystemLogLevel      string `json:"SystemLogLevel,omitempty"`
}

LoggingConfig holds the function's logging configuration. Real AWS returns this on every GetFunction / GetFunctionConfiguration response.

type Provider

type Provider struct{}

Provider implements service.Provider for the Lambda service.

func (*Provider) Init

Init initializes the Lambda service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the logical name of the provider.

type ProvisionedConcurrencyConfig

type ProvisionedConcurrencyConfig struct {
	FunctionArn                              string `json:"FunctionArn,omitempty"`
	LastModified                             string `json:"LastModified"`
	Status                                   string `json:"Status"`
	StatusReason                             string `json:"StatusReason,omitempty"`
	AllocatedProvisionedConcurrentExecutions int    `json:"AllocatedProvisionedConcurrentExecutions"`
	AvailableProvisionedConcurrentExecutions int    `json:"AvailableProvisionedConcurrentExecutions"`
	RequestedProvisionedConcurrentExecutions int    `json:"RequestedProvisionedConcurrentExecutions"`
}

ProvisionedConcurrencyConfig holds the provisioned concurrency configuration for a function version or alias.

type PublishLayerVersionInput

type PublishLayerVersionInput struct {
	Content            *LayerVersionContentInput `json:"Content"`
	Description        string                    `json:"Description,omitempty"`
	LayerName          string                    `json:"-"`
	LicenseInfo        string                    `json:"LicenseInfo,omitempty"`
	CompatibleRuntimes []string                  `json:"CompatibleRuntimes,omitempty"`
}

PublishLayerVersionInput is the request body for PublishLayerVersion.

type PublishLayerVersionOutput

type PublishLayerVersionOutput struct {
	Content            *LayerVersionContent `json:"Content"`
	LayerVersionArn    string               `json:"LayerVersionArn"`
	LayerArn           string               `json:"LayerArn"`
	Description        string               `json:"Description,omitempty"`
	CreatedDate        string               `json:"CreatedDate"`
	LicenseInfo        string               `json:"LicenseInfo,omitempty"`
	CompatibleRuntimes []string             `json:"CompatibleRuntimes,omitempty"`
	Version            int64                `json:"Version"`
}

PublishLayerVersionOutput is the response for PublishLayerVersion.

type PutFunctionCodeSigningConfigInput

type PutFunctionCodeSigningConfigInput struct {
	CodeSigningConfigArn string `json:"CodeSigningConfigArn"`
}

PutFunctionCodeSigningConfigInput is the request body for PutFunctionCodeSigningConfig.

type PutFunctionCodeSigningConfigOutput

type PutFunctionCodeSigningConfigOutput struct {
	CodeSigningConfigArn string `json:"CodeSigningConfigArn"`
	FunctionName         string `json:"FunctionName"`
}

PutFunctionCodeSigningConfigOutput is the response for PutFunctionCodeSigningConfig.

type PutFunctionConcurrencyInput

type PutFunctionConcurrencyInput struct {
	ReservedConcurrentExecutions int `json:"ReservedConcurrentExecutions"`
}

PutFunctionConcurrencyInput is the request body for PutFunctionConcurrency.

type PutFunctionEventInvokeConfigInput

type PutFunctionEventInvokeConfigInput struct {
	DestinationConfig        *DestinationConfig `json:"DestinationConfig,omitempty"`
	MaximumEventAgeInSeconds *int               `json:"MaximumEventAgeInSeconds,omitempty"`
	MaximumRetryAttempts     *int               `json:"MaximumRetryAttempts,omitempty"`
}

PutFunctionEventInvokeConfigInput is the shared request body for Put/Update FunctionEventInvokeConfig.

type PutFunctionRecursionConfigInput

type PutFunctionRecursionConfigInput struct {
	RecursiveLoop string `json:"RecursiveLoop"`
}

PutFunctionRecursionConfigInput is the request body for PutFunctionRecursionConfig.

type PutFunctionScalingConfigInput

type PutFunctionScalingConfigInput struct {
	MaximumConcurrency *int `json:"MaximumConcurrency,omitempty"`
}

PutFunctionScalingConfigInput is the request body for PutFunctionScalingConfig.

type PutProvisionedConcurrencyConfigInput

type PutProvisionedConcurrencyConfigInput struct {
	ProvisionedConcurrentExecutions int `json:"ProvisionedConcurrentExecutions"`
}

PutProvisionedConcurrencyConfigInput is the request body for PutProvisionedConcurrencyConfig.

type PutRuntimeManagementConfigInput

type PutRuntimeManagementConfigInput struct {
	RuntimeVersionArn string `json:"RuntimeVersionArn,omitempty"`
	UpdateRuntimeOn   string `json:"UpdateRuntimeOn"`
}

PutRuntimeManagementConfigInput is the request body for PutRuntimeManagementConfig.

type QualifierInvoker

type QualifierInvoker interface {
	InvokeFunctionWithQualifier(
		ctx context.Context, name, qualifier, clientContext, logType string, invocationType InvocationType, payload []byte,
	) ([]byte, string, string, int, error)
}

QualifierInvoker is an optional extension of StorageBackend that supports qualified invocations. Backends implement this to support ?Qualifier= on Invoke (alias or version qualifier).

type QualifierResolver

type QualifierResolver interface {
	GetFunctionByQualifier(name, qualifier string) (*FunctionConfiguration, error)
}

QualifierResolver is an optional extension of StorageBackend that resolves a qualifier (version number or alias name) to a function configuration for GetFunction/GetFunctionConfiguration. Backends implement this to support ?Qualifier= on the read paths.

type RuntimeManagementConfig

type RuntimeManagementConfig struct {
	// RuntimeVersionArn is set when UpdateRuntimeOn is "Manual".
	RuntimeVersionArn string `json:"RuntimeVersionArn,omitempty"`
	// UpdateRuntimeOn controls when the runtime is updated: "Auto", "FunctionUpdate", or "Manual".
	UpdateRuntimeOn string `json:"UpdateRuntimeOn"`
	FunctionArn     string `json:"FunctionArn,omitempty"`
}

RuntimeManagementConfig holds the runtime management configuration for a Lambda function.

type S3CodeFetcher

type S3CodeFetcher interface {
	GetObjectBytes(ctx context.Context, bucket, key string) ([]byte, error)
}

S3CodeFetcher can retrieve zip bytes from an S3-compatible store. It is used by InMemoryBackend to pull Zip Lambda code from S3.

type SQSMessage

type SQSMessage struct {
	Attributes             map[string]string
	MessageAttributes      map[string]SQSMessageAttribute
	MessageID              string
	ReceiptHandle          string
	Body                   string
	MD5OfBody              string
	MD5OfMessageAttributes string
	// SentTimestampMillis is the SQS SentTimestamp in Unix milliseconds, used to
	// enforce MaximumRecordAgeInSeconds. Zero means unknown (never expired).
	SentTimestampMillis int64
}

SQSMessage is a single SQS message delivered to a Lambda function via ESM.

type SQSMessageAttribute

type SQSMessageAttribute struct {
	DataType    string `json:"dataType"`
	StringValue string `json:"stringValue,omitempty"`
	BinaryValue []byte `json:"binaryValue,omitempty"`
}

SQSMessageAttribute is a user-supplied SQS message attribute delivered to the Lambda function in the event record's messageAttributes map.

type SQSReader

type SQSReader interface {
	// ReceiveMessagesLocal pulls up to maxMessages from the queue identified by queueARN.
	ReceiveMessagesLocal(queueARN string, maxMessages int) ([]*SQSMessage, error)
	// DeleteMessagesLocal removes the messages identified by receiptHandles from the queue.
	DeleteMessagesLocal(queueARN string, receiptHandles []string) error
}

SQSReader is the interface for consuming SQS messages in the ESM poller. It is implemented by the SQS backend adapter in the CLI wiring layer.

type SelfManagedEventSource

type SelfManagedEventSource struct {
	Endpoints map[string][]string `json:"Endpoints,omitempty"`
}

SelfManagedEventSource holds the bootstrap broker endpoints for a self-managed Kafka cluster. Endpoints is a map from endpoint type (e.g. "KAFKA_BOOTSTRAP_SERVERS") to list of broker addresses.

type SelfManagedKafkaEventSourceConfig

type SelfManagedKafkaEventSourceConfig struct {
	ConsumerGroupID string `json:"ConsumerGroupId,omitempty"`
}

SelfManagedKafkaEventSourceConfig holds configuration for self-managed Apache Kafka event sources.

type SendDurableExecutionCallbackFailureOutput added in v1.2.0

type SendDurableExecutionCallbackFailureOutput struct{}

SendDurableExecutionCallbackFailureOutput mirrors the real (empty-body) output.

type SendDurableExecutionCallbackHeartbeatOutput added in v1.2.0

type SendDurableExecutionCallbackHeartbeatOutput struct{}

SendDurableExecutionCallbackHeartbeatOutput mirrors the real (empty-body) output.

type SendDurableExecutionCallbackSuccessOutput added in v1.2.0

type SendDurableExecutionCallbackSuccessOutput struct{}

SendDurableExecutionCallbackSuccessOutput mirrors the real (empty-body) output.

type Settings

type Settings struct {
	// DockerHost is the host/IP that Lambda containers use to reach the runtime API.
	// Defaults to "172.17.0.1" (Docker bridge gateway on Linux).
	// For Podman rootless on Linux, use the host's routable IP or "host.containers.internal".
	DockerHost string `` //nolint:lll,golines // config struct tags are intentionally verbose
	/* 169-byte string literal not displayed */
	// ContainerRuntime selects the container runtime: docker, podman, or auto.
	// Defaults to "docker". Can be overridden via CONTAINER_RUNTIME env var.
	ContainerRuntime string `` //nolint:lll,golines // config struct tags are intentionally verbose
	/* 162-byte string literal not displayed */
	// PoolSize is the max number of warm containers per function.
	PoolSize int `` //nolint:lll,golines // config struct tags are intentionally verbose
	/* 152-byte string literal not displayed */
	// IdleTimeout is how long an idle container is kept before reaping.
	IdleTimeout time.Duration `` //nolint:lll,golines // config struct tags are intentionally verbose
	/* 135-byte string literal not displayed */
	// MaxRuntimes is the maximum number of per-function runtimes kept alive simultaneously.
	// When the limit is exceeded, the least-recently-used runtime is stopped and evicted.
	// Defaults to defaultMaxRuntimes. Set to 0 to use the default.
	MaxRuntimes int `` //nolint:lll,golines // config struct tags are intentionally verbose
	/* 172-byte string literal not displayed */
	// KeepContainers determines if Lambda containers should be kept alive after execution.
	// If true, the containers will not be stopped and removed. Useful for debugging.
	KeepContainers bool `` //nolint:lll,golines // config struct tags are intentionally verbose
	/* 157-byte string literal not displayed */
}

Settings holds configurable settings for the Lambda service.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns Settings with sensible defaults for use without Kong.

type SettingsProvider

type SettingsProvider interface {
	GetLambdaSettings() Settings
}

SettingsProvider is implemented by config objects that supply Lambda settings.

type SnapStart

type SnapStart struct {
	ApplyOn string `json:"ApplyOn,omitempty"`
}

SnapStart holds the SnapStart configuration for a Lambda function. ApplyOn can be "PublishedVersions" or "None".

type SnapStartResponse

type SnapStartResponse struct {
	ApplyOn            string `json:"ApplyOn"`
	OptimizationStatus string `json:"OptimizationStatus"`
}

SnapStartResponse is the SnapStart field returned in GetFunction/GetFunctionConfiguration.

type SourceAccessConfiguration

type SourceAccessConfiguration struct {
	URI  string `json:"URI,omitempty"`
	Type string `json:"Type,omitempty"`
}

SourceAccessConfiguration specifies an auth protocol, VPC component, or virtual host used to secure access to an event source.

type StopDurableExecutionOutput added in v1.2.0

type StopDurableExecutionOutput struct {
	StopTimestamp float64 `json:"StopTimestamp"`
}

StopDurableExecutionOutput mirrors api_op_StopDurableExecution.go's output.

type StorageBackend

type StorageBackend interface {
	CreateFunction(fn *FunctionConfiguration) error
	GetFunction(name string) (*FunctionConfiguration, error)
	ListFunctions(marker string, maxItems int) page.Page[*FunctionConfiguration]
	DeleteFunction(name string) error
	UpdateFunction(fn *FunctionConfiguration) error
	InvokeFunction(
		ctx context.Context,
		name string,
		invocationType InvocationType,
		payload []byte,
	) ([]byte, int, error)
	Purge(ctx context.Context, cutoff time.Time)
}

StorageBackend defines the interface for Lambda backend operations.

type TaggedFunctionInfo

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

TaggedFunctionInfo contains a Lambda function's ARN and tag snapshot. Used by the Resource Groups Tagging API cross-service listing.

type TraceHeader added in v1.2.0

type TraceHeader struct {
	XAmznTraceID *string `json:"XAmznTraceId,omitempty"`
}

TraceHeader mirrors types.TraceHeader.

type TracingConfig

type TracingConfig struct {
	Mode string `json:"Mode"`
}

TracingConfig holds the X-Ray tracing configuration for a Lambda function.

type UpdateAliasInput

type UpdateAliasInput struct {
	RoutingConfig   *AliasRoutingConfig `json:"RoutingConfig,omitempty"`
	Description     string              `json:"Description,omitempty"`
	FunctionVersion string              `json:"FunctionVersion,omitempty"`
	// RevisionID, when set, must match the alias's current RevisionId or the
	// update is rejected with PreconditionFailedException (optimistic concurrency).
	RevisionID string `json:"RevisionId,omitempty"`
}

UpdateAliasInput holds the request body for UpdateAlias.

type UpdateCapacityProviderInput

type UpdateCapacityProviderInput struct {
	TelemetryConfig           *CapacityProviderTelemetryConfig `json:"TelemetryConfig,omitempty"`
	TargetOnDemandConcurrency int                              `json:"TargetOnDemandConcurrency,omitempty"`
}

UpdateCapacityProviderInput is the request body for UpdateCapacityProvider.

type UpdateCapacityProviderOutput

type UpdateCapacityProviderOutput struct {
	CapacityProvider *CapacityProvider `json:"CapacityProvider"`
}

UpdateCapacityProviderOutput is the response for UpdateCapacityProvider.

type UpdateCodeSigningConfigInput

type UpdateCodeSigningConfigInput struct {
	AllowedPublishers   *AllowedPublishers   `json:"AllowedPublishers,omitempty"`
	CodeSigningPolicies *CodeSigningPolicies `json:"CodeSigningPolicies,omitempty"`
	Description         string               `json:"Description,omitempty"`
}

UpdateCodeSigningConfigInput is the request body for UpdateCodeSigningConfig.

type UpdateCodeSigningConfigOutput

type UpdateCodeSigningConfigOutput struct {
	CodeSigningConfig *CodeSigningConfig `json:"CodeSigningConfig"`
}

UpdateCodeSigningConfigOutput is the response for UpdateCodeSigningConfig.

type UpdateEventSourceMappingInput

type UpdateEventSourceMappingInput struct {
	Enabled                        *bool
	FilterCriteria                 *FilterCriteria
	DestinationConfig              *ESMDestinationConfig
	BisectBatchOnFunctionError     *bool
	UUID                           string
	SourceAccessConfigurations     []SourceAccessConfiguration
	Topics                         []string
	Queues                         []string
	FunctionResponseTypes          []string
	BatchSize                      int
	MaximumBatchingWindowInSeconds int
	TumblingWindowInSeconds        int
	MaximumRecordAgeInSeconds      int
	MaximumRetryAttempts           int
	ParallelizationFactor          int
}

UpdateEventSourceMappingInput is the input for UpdateEventSourceMapping.

type UpdateFunctionCodeInput

type UpdateFunctionCodeInput struct {
	ImageURI      string   `json:"ImageUri,omitempty"`
	S3Bucket      string   `json:"S3Bucket,omitempty"`
	S3Key         string   `json:"S3Key,omitempty"`
	RevisionID    string   `json:"RevisionId,omitempty"`
	Architectures []string `json:"Architectures,omitempty"`
	ZipFile       []byte   `json:"ZipFile,omitempty"`
	Publish       bool     `json:"Publish,omitempty"`
}

UpdateFunctionCodeInput holds the request body for UpdateFunctionCode.

type UpdateFunctionConfigurationInput

type UpdateFunctionConfigurationInput struct {
	DurableConfig     *DurableConfig          `json:"DurableConfig,omitempty"`
	Environment       *EnvironmentConfig      `json:"Environment,omitempty"`
	VpcConfig         *VpcConfig              `json:"VpcConfig,omitempty"`
	TracingConfig     *TracingConfig          `json:"TracingConfig,omitempty"`
	DeadLetterConfig  *DeadLetterConfig       `json:"DeadLetterConfig,omitempty"`
	EphemeralStorage  *EphemeralStorageConfig `json:"EphemeralStorage,omitempty"`
	SnapStart         *SnapStart              `json:"SnapStart,omitempty"`
	Runtime           string                  `json:"Runtime,omitempty"`
	Description       string                  `json:"Description,omitempty"`
	Handler           string                  `json:"Handler,omitempty"`
	Role              string                  `json:"Role,omitempty"`
	RevisionID        string                  `json:"RevisionId,omitempty"`
	FileSystemConfigs []*FileSystemConfig     `json:"FileSystemConfigs,omitempty"`
	Layers            []string                `json:"Layers,omitempty"`
	MemorySize        int                     `json:"MemorySize,omitempty"`
	Timeout           int                     `json:"Timeout,omitempty"`
}

UpdateFunctionConfigurationInput holds the request body for UpdateFunctionConfiguration.

type UpdateFunctionURLConfigInput

type UpdateFunctionURLConfigInput struct {
	Cors     *FunctionURLCors `json:"Cors,omitempty"`
	AuthType string           `json:"AuthType,omitempty"`
}

UpdateFunctionURLConfigInput is the request body for UpdateFunctionUrlConfig.

type VpcConfig

type VpcConfig struct {
	Ipv6AllowedForDualStack *bool    `json:"Ipv6AllowedForDualStack,omitempty"`
	VpcID                   string   `json:"VpcId,omitempty"`
	SubnetIDs               []string `json:"SubnetIds,omitempty"`
	SecurityGroupIDs        []string `json:"SecurityGroupIds,omitempty"`
}

VpcConfig holds the VPC configuration for a Lambda function.

Jump to

Keyboard shortcuts

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