kinesisanalyticsv2

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: 23 Imported by: 0

README

Kinesis Analytics v2

Parity grade: A · SDK aws-sdk-go-v2/service/kinesisanalyticsv2@v1.36.22 · last audited 2026-07-23 (1c4ee34e)

Coverage

Metric Value
Operations audited 33 (30 ok, 2 partial, 1 deferred)
Feature families 1 (1 ok)
Known gaps 6
Deferred items 1
Resource leaks clean
Known gaps
  • ZeppelinApplicationConfiguration/ZeppelinApplicationConfigurationUpdate (Managed Service for Apache Flink Studio notebooks: CatalogConfiguration/Glue Data Catalog, CustomArtifactConfiguration/Maven+S3 UDF JARs, DeployAsApplicationConfiguration) are accepted on the wire (to avoid rejecting well-formed requests) but not modeled -- out of scope for this pass given the size of the Flink/SQL core-path work already covered; Studio notebooks are a materially separate feature surface (INTERACTIVE ApplicationMode) from the streaming-application path this pass focused on. (bd: file follow-up)
  • StartApplication's SqlRunConfigurations (per-input InputStartingPositionConfiguration) and FlinkApplicationConfigurationDescription.JobPlanDescription (DescribeApplicationRequest.IncludeAdditionalDetails) are accepted-but-ignored: neither has any backing state anywhere in this emulator (no real stream position tracking, no real Flink job graph), the same root cause as DiscoverInputSchema's documented synthetic-schema limitation. Leniency only.
  • StopApplication's Force field (skip the pre-stop snapshot) is accepted but has no observable effect: this backend never auto-snapshots on stop regardless of Force. Real AWS's auto-snapshot naming/visibility isn't documented publicly enough to model without risking a gopherstack-invented behavior, so it was deliberately left unimplemented rather than fabricated.
  • UpdateApplicationMaintenanceConfiguration's ApplicationMaintenanceWindowEndTime is never computed/returned (pre-existing gap, unchanged, low value -- no client observably depends on the exact window end time).
  • DeleteApplication is synchronous (app removed immediately); real AWS transitions through a DELETING status first. ApplicationStatusDeleting const is defined but unused. Matches the synchronous-delete convention used elsewhere in this codebase; not fixed (pre-existing, unchanged).
  • Real AWS's default-assigned maintenance window (every application gets one automatically at creation, before any UpdateApplicationMaintenanceConfiguration call) is not modeled -- ApplicationMaintenanceConfigurationDescription is only populated in DescribeApplication once UpdateApplicationMaintenanceConfiguration has been called at least once. Pre-existing, unchanged; low value.
Deferred
  • DiscoverInputSchema (inherently synthetic without live stream sampling)

More

Documentation

Overview

Package kinesisanalyticsv2 provides an in-memory stub of AWS Kinesis Data Analytics v2.

Index

Constants

View Source
const (
	// ApplicationStatusReady indicates a running application that is ready.
	ApplicationStatusReady = "READY"
	// ApplicationStatusRunning indicates a running application.
	ApplicationStatusRunning = "RUNNING"
	// ApplicationStatusDeleting indicates an application being deleted.
	ApplicationStatusDeleting = "DELETING"
)
View Source
const OperationStatusSuccessful = "SUCCESSFUL"

OperationStatusSuccessful is the real Kinesis Analytics v2 OperationStatus enum value ("SUCCESSFUL", not "SUCCESS") for a completed operation. gopherstack applies application-lifecycle operations (Start/Stop/UpdateApplication/RollbackApplication) synchronously, so every recorded operation goes straight to SUCCESSFUL -- there is no IN_PROGRESS window to observe via DescribeApplicationOperation/ListApplicationOperations.

Variables

View Source
var (
	// ErrNotFound is returned when a requested resource does not exist.
	ErrNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource already exists.
	ErrAlreadyExists = awserr.New("ResourceInUseException", awserr.ErrAlreadyExists)
	// ErrConcurrentModification is returned when the application version does not match.
	ErrConcurrentModification = awserr.New(
		"ConcurrentModificationException",
		awserr.ErrInvalidParameter,
	)
	// ErrValidation is returned for invalid input parameters.
	ErrValidation = awserr.New("InvalidArgumentException", awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("kinesisanalyticsv2: AppContext must not be nil")

ErrNilAppContext is returned by Provider.Init when a nil AppContext is supplied.

Functions

This section is empty.

Types

type Application

type Application struct {
	LastUpdateTimestamp               time.Time `json:"-"`
	CreatedAt                         time.Time `json:"-"`
	ApplicationVersionCreateTimestamp time.Time `json:"-"`
	RunConfig                         *RunConfigDesc
	EncryptionConfig                  *ApplicationEncryptionConfigDesc
	RollbackEnabled                   *bool
	SnapshotsEnabled                  *bool
	FlinkConfig                       *FlinkApplicationConfigDesc
	CodeConfig                        *ApplicationCodeConfigDesc
	ApplicationVersionRolledBackTo    *int64
	ApplicationVersionRolledBackFrom  *int64
	ApplicationVersionUpdatedFrom     *int64
	ApplicationMode                   string                        `json:"ApplicationMode,omitempty"`
	ApplicationStatus                 string                        `json:"ApplicationStatus"`
	ApplicationARN                    string                        `json:"ApplicationARN"`
	ApplicationName                   string                        `json:"ApplicationName"`
	RuntimeEnvironment                string                        `json:"RuntimeEnvironment"`
	ServiceExecutionRole              string                        `json:"ServiceExecutionRole,omitempty"`
	ApplicationDescription            string                        `json:"ApplicationDescription,omitempty"`
	Region                            string                        `json:"-"`
	MaintenanceWindowStartTime        string                        `json:"MaintenanceWindowStartTime,omitempty"`
	Tags                              []Tag                         `json:"-"`
	CloudWatchLoggingOptionDescs      []CloudWatchLoggingOptionDesc `json:"-"`
	EnvironmentPropertyGroups         []PropertyGroup
	InputDescriptions                 []InputDescription               `json:"-"`
	OutputDescriptions                []OutputDescription              `json:"-"`
	VpcConfigurationDescriptions      []VpcConfigurationDescription    `json:"-"`
	ReferenceDataSourceDescriptions   []ReferenceDataSourceDescription `json:"-"`
	ApplicationVersionID              int64                            `json:"ApplicationVersionId"`
}

Application represents a Kinesis Data Analytics v2 application.

type ApplicationCodeConfigDesc added in v1.2.0

type ApplicationCodeConfigDesc struct {
	CodeContentDescription *CodeContentDescription `json:"CodeContentDescription,omitempty"`
	CodeContentType        string                  `json:"CodeContentType"`
}

ApplicationCodeConfigDesc describes an application's code configuration.

type ApplicationCodeConfigUpdate added in v1.2.0

type ApplicationCodeConfigUpdate struct {
	CodeContentUpdate     *CodeContentUpdate
	CodeContentTypeUpdate string
}

ApplicationCodeConfigUpdate describes updates to an application's code configuration.

type ApplicationConfigurationUpdate added in v1.2.0

type ApplicationConfigurationUpdate struct {
	ApplicationCodeConfigurationUpdate           *ApplicationCodeConfigUpdate
	FlinkApplicationConfigurationUpdate          *FlinkApplicationConfigUpdate
	ApplicationSnapshotConfigurationUpdate       *bool
	ApplicationSystemRollbackConfigurationUpdate *bool
	ApplicationEncryptionConfigurationUpdate     *ApplicationEncryptionConfigDesc
	SQLApplicationConfigurationUpdate            *SQLApplicationConfigUpdate
	EnvironmentPropertyUpdates                   []PropertyGroup
	VpcConfigurationUpdates                      []VpcConfigUpdate
	// hasEnvironmentPropertyUpdates distinguishes "no EnvironmentPropertyUpdates
	// object in the request" from "EnvironmentPropertyUpdates with zero
	// PropertyGroups" (which real AWS treats as clearing every group).
	HasEnvironmentPropertyUpdates bool
}

ApplicationConfigurationUpdate bundles every optional delta accepted by UpdateApplication's ApplicationConfigurationUpdate request field.

type ApplicationEncryptionConfigDesc added in v1.2.0

type ApplicationEncryptionConfigDesc struct {
	KeyType string `json:"KeyType"`
	KeyID   string `json:"KeyId,omitempty"`
}

ApplicationEncryptionConfigDesc describes the encryption-at-rest configuration.

type ApplicationOperation

type ApplicationOperation struct {
	StartTimestamp  time.Time `json:"-"`
	EndTimestamp    time.Time `json:"-"`
	OperationID     string    `json:"OperationId"`
	ApplicationName string    `json:"ApplicationName"`
	Operation       string    `json:"Operation"`
	OperationStatus string    `json:"OperationStatus"`
}

ApplicationOperation represents a single KDA v2 application operation record.

type ApplicationRestoreConfig added in v1.2.0

type ApplicationRestoreConfig struct {
	ApplicationRestoreType string `json:"ApplicationRestoreType"`
	SnapshotName           string `json:"SnapshotName,omitempty"`
}

ApplicationRestoreConfig describes how a restarting application restores state (shared shape for RunConfiguration's request field and RunConfigurationDescription's response field -- real AWS uses the identical ApplicationRestoreConfiguration type on both sides).

type ApplicationSnapshotConfigDesc added in v1.2.0

type ApplicationSnapshotConfigDesc struct {
	SnapshotsEnabled bool `json:"SnapshotsEnabled"`
}

ApplicationSnapshotConfigDesc describes whether snapshots are enabled.

type ApplicationSystemRollbackConfigDesc added in v1.2.0

type ApplicationSystemRollbackConfigDesc struct {
	RollbackEnabled bool `json:"RollbackEnabled"`
}

ApplicationSystemRollbackConfigDesc describes whether system rollback is enabled.

type ApplicationVersionSummary

type ApplicationVersionSummary struct {
	ApplicationStatus    string `json:"ApplicationStatus"`
	ApplicationVersionID int64  `json:"ApplicationVersionId"`
}

ApplicationVersionSummary is a compact view of an application version.

type CheckpointConfigDesc added in v1.2.0

type CheckpointConfigDesc struct {
	CheckpointingEnabled       *bool  `json:"CheckpointingEnabled,omitempty"`
	CheckpointInterval         *int64 `json:"CheckpointInterval,omitempty"`
	MinPauseBetweenCheckpoints *int64 `json:"MinPauseBetweenCheckpoints,omitempty"`
	ConfigurationType          string `json:"ConfigurationType"`
}

CheckpointConfigDesc describes a Flink application's checkpointing configuration.

type CheckpointConfigUpdate added in v1.2.0

type CheckpointConfigUpdate struct {
	CheckpointingEnabledUpdate       *bool
	CheckpointIntervalUpdate         *int64
	MinPauseBetweenCheckpointsUpdate *int64
	ConfigurationTypeUpdate          string
}

CheckpointConfigUpdate describes updates to a Flink application's checkpointing configuration.

type CloudWatchLoggingOptionDesc

type CloudWatchLoggingOptionDesc struct {
	CloudWatchLoggingOptionID string `json:"CloudWatchLoggingOptionId"`
	LogStreamARN              string `json:"LogStreamARN"`
	RoleARN                   string `json:"RoleARN,omitempty"`
}

CloudWatchLoggingOptionDesc describes a CloudWatch logging option.

type CloudWatchLoggingOptionUpdate added in v1.2.0

type CloudWatchLoggingOptionUpdate struct {
	CloudWatchLoggingOptionID string
	LogStreamARNUpdate        string
}

CloudWatchLoggingOptionUpdate describes an update to an existing CloudWatch logging option's LogStreamARN, identified by CloudWatchLoggingOptionID. Real AWS's AddApplicationCloudWatchLoggingOption/ DeleteApplicationCloudWatchLoggingOption are the only ways to add/remove entries -- UpdateApplication can only update an existing one's ARN.

type CodeContentDescription added in v1.2.0

type CodeContentDescription struct {
	S3ApplicationCodeLocationDescription *S3CodeLocationDesc `json:"S3ApplicationCodeLocationDescription,omitempty"` //nolint:lll // AWS API name
	TextContent                          string              `json:"TextContent,omitempty"`
	CodeMD5                              string              `json:"CodeMD5,omitempty"`
	CodeSize                             int64               `json:"CodeSize,omitempty"`
}

CodeContentDescription describes the location and content of application code.

type CodeContentUpdate added in v1.2.0

type CodeContentUpdate struct {
	TextContentUpdate     *string
	S3BucketARNUpdate     *string
	S3FileKeyUpdate       *string
	S3ObjectVersionUpdate *string
	ZipFileContentUpdate  []byte
}

CodeContentUpdate describes an update to application code content. Only one of TextContentUpdate/ZipFileContentUpdate/S3*Update is expected to be set per real AWS's CodeContentUpdate.

type DestinationSchemaDesc

type DestinationSchemaDesc struct {
	RecordFormatType string `json:"RecordFormatType"`
}

DestinationSchemaDesc describes the destination record format.

type DiscoveredSchema

type DiscoveredSchema struct {
	RecordFormat       string     `json:"RecordFormat"`
	RecordEncoding     string     `json:"RecordEncoding,omitempty"`
	ParsedInputRecords [][]string `json:"ParsedInputRecords,omitempty"`
}

DiscoveredSchema holds the inferred schema from DiscoverInputSchema.

type FlinkApplicationConfigDesc added in v1.2.0

type FlinkApplicationConfigDesc struct {
	CheckpointConfigurationDescription  *CheckpointConfigDesc  `json:"CheckpointConfigurationDescription,omitempty"`  //nolint:lll // AWS API name
	MonitoringConfigurationDescription  *MonitoringConfigDesc  `json:"MonitoringConfigurationDescription,omitempty"`  //nolint:lll // AWS API name
	ParallelismConfigurationDescription *ParallelismConfigDesc `json:"ParallelismConfigurationDescription,omitempty"` //nolint:lll // AWS API name
}

FlinkApplicationConfigDesc describes a Flink application's runtime configuration.

type FlinkApplicationConfigUpdate added in v1.2.0

type FlinkApplicationConfigUpdate struct {
	CheckpointConfigurationUpdate  *CheckpointConfigUpdate
	MonitoringConfigurationUpdate  *MonitoringConfigUpdate
	ParallelismConfigurationUpdate *ParallelismConfigUpdate
}

FlinkApplicationConfigUpdate bundles the three FlinkApplicationConfigurationUpdate sub-updates.

type FlinkRunConfig added in v1.2.0

type FlinkRunConfig struct {
	AllowNonRestoredState *bool `json:"AllowNonRestoredState,omitempty"`
}

FlinkRunConfig describes Flink-specific starting parameters (shared shape, same rationale as ApplicationRestoreConfig).

type Handler

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

Handler is the HTTP handler for the Kinesis Data Analytics v2 JSON API.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Kinesis Data Analytics v2 handler.

func (*Handler) ChaosOperations

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

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

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

ChaosRegions returns all regions this handler instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

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

func (*Handler) ExtractOperation

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

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

func (*Handler) ExtractResource

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

ExtractResource extracts the application name from the request body.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

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

Handler returns the Echo handler function for Kinesis Data Analytics v2 requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears handler state by delegating to the backend if it supports it.

func (*Handler) Restore

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

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

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

RouteMatcher returns a function that matches Kinesis Data Analytics v2 requests. The SDK uses X-Amz-Target: KinesisAnalytics_20180523.{Operation} with POST to /.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

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

InMemoryBackend stores Kinesis Data Analytics v2 state in memory.

applications and snapshots are store.Table-backed (Phase 3.3); see store_setup.go for the composite keys and secondary indexes that replace the pre-Phase-3.3 nested map[region]map[name]* layout. operations and versions are left as plain nested maps of slices: both are order-sensitive append histories (versions is read by positional index in RollbackApplication; operations is returned in insertion order with no explicit sort), and store.Index does not preserve insertion order, so neither fits a store.Table+Index conversion -- see pkgs/store's package doc and .claude/memories/pkgs-catalog.md. Neither was persisted before this conversion and neither is persisted after it (see persistence.go).

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory Kinesis Data Analytics v2 backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the backend account ID.

func (*InMemoryBackend) AddApplicationCloudWatchLoggingOption

func (b *InMemoryBackend) AddApplicationCloudWatchLoggingOption(
	ctx context.Context,
	name string, currentVersionID int64, logStreamARN, roleARN string,
) (string, error)

AddApplicationCloudWatchLoggingOption adds a CloudWatch logging option to an application, returning the OperationID of the recorded AddApplicationCloudWatchLoggingOption operation (see recordOperation) -- real AWS's AddApplicationCloudWatchLoggingOptionOutput carries an OperationId field, unlike most other Add*/Delete* config ops.

func (*InMemoryBackend) AddApplicationInput

func (b *InMemoryBackend) AddApplicationInput(
	ctx context.Context,
	name string, currentVersionID int64, input InputDescription,
) error

AddApplicationInput adds an input configuration to an application.

func (*InMemoryBackend) AddApplicationInputProcessingConfiguration

func (b *InMemoryBackend) AddApplicationInputProcessingConfiguration(
	ctx context.Context,
	name string,
	currentVersionID int64,
	inputID string,
	config *InputProcessingConfigurationDesc,
) error

AddApplicationInputProcessingConfiguration sets a processing config on an existing input.

func (*InMemoryBackend) AddApplicationInternal

func (b *InMemoryBackend) AddApplicationInternal(ctx context.Context, app *Application)

AddApplicationInternal is a test-only seed helper that stores an application directly.

func (*InMemoryBackend) AddApplicationOutput

func (b *InMemoryBackend) AddApplicationOutput(
	ctx context.Context,
	name string, currentVersionID int64, output OutputDescription,
) error

AddApplicationOutput adds an output configuration to an application.

func (*InMemoryBackend) AddApplicationReferenceDataSource

func (b *InMemoryBackend) AddApplicationReferenceDataSource(
	ctx context.Context,
	name string, currentVersionID int64, ref ReferenceDataSourceDescription,
) error

AddApplicationReferenceDataSource adds a reference data source to an application.

func (*InMemoryBackend) AddApplicationVpcConfiguration

func (b *InMemoryBackend) AddApplicationVpcConfiguration(
	ctx context.Context,
	name string, currentVersionID int64, vpc VpcConfigurationDescription,
) (string, error)

AddApplicationVpcConfiguration adds a VPC configuration to an application, returning the OperationID of the recorded AddApplicationVpcConfiguration operation (see recordOperation) -- real AWS's AddApplicationVpcConfigurationOutput carries an OperationId field, unlike most other Add*/Delete* config ops.

func (*InMemoryBackend) CreateApplication

func (b *InMemoryBackend) CreateApplication(
	ctx context.Context,
	name, runtimeEnv, serviceRole, description, mode string,
	tags []Tag,
) (*Application, error)

CreateApplication creates a new Kinesis Data Analytics v2 application.

func (*InMemoryBackend) CreateApplicationSnapshot

func (b *InMemoryBackend) CreateApplicationSnapshot(
	ctx context.Context,
	appName, snapshotName string,
) (*Snapshot, error)

CreateApplicationSnapshot creates a snapshot for an application.

func (*InMemoryBackend) DeleteApplication

func (b *InMemoryBackend) DeleteApplication(ctx context.Context, name string, createTimestampSeconds *float64) error

DeleteApplication deletes an application by name. createTimestampSeconds, when non-nil, is validated against the application's actual CreateTimestamp (real AWS's DeleteApplicationInput.CreateTimestamp is a required safety check retrieved from a prior DescribeApplication) -- a mismatch returns ErrValidation instead of deleting.

func (*InMemoryBackend) DeleteApplicationCloudWatchLoggingOption

func (b *InMemoryBackend) DeleteApplicationCloudWatchLoggingOption(
	ctx context.Context,
	name string, currentVersionID int64, loggingOptionID string,
) (string, error)

DeleteApplicationCloudWatchLoggingOption removes a CloudWatch logging option from an application, returning the OperationID of the recorded DeleteApplicationCloudWatchLoggingOption operation (see recordOperation) -- real AWS's DeleteApplicationCloudWatchLoggingOptionOutput carries an OperationId field, unlike most other Add*/Delete* config ops.

func (*InMemoryBackend) DeleteApplicationInputProcessingConfiguration

func (b *InMemoryBackend) DeleteApplicationInputProcessingConfiguration(
	ctx context.Context,
	name string, currentVersionID int64, inputID string,
) error

DeleteApplicationInputProcessingConfiguration removes the processing config from an input.

func (*InMemoryBackend) DeleteApplicationOutput

func (b *InMemoryBackend) DeleteApplicationOutput(
	ctx context.Context,
	name string, currentVersionID int64, outputID string,
) error

DeleteApplicationOutput removes an output configuration from an application.

func (*InMemoryBackend) DeleteApplicationReferenceDataSource

func (b *InMemoryBackend) DeleteApplicationReferenceDataSource(
	ctx context.Context,
	name string, currentVersionID int64, referenceID string,
) error

DeleteApplicationReferenceDataSource removes a reference data source from an application.

func (*InMemoryBackend) DeleteApplicationSnapshot

func (b *InMemoryBackend) DeleteApplicationSnapshot(ctx context.Context, appName, snapshotName string) error

DeleteApplicationSnapshot deletes a snapshot.

func (*InMemoryBackend) DeleteApplicationVpcConfiguration

func (b *InMemoryBackend) DeleteApplicationVpcConfiguration(
	ctx context.Context,
	name string, currentVersionID int64, vpcConfigurationID string,
) (string, error)

DeleteApplicationVpcConfiguration removes a VPC configuration from an application, returning the OperationID of the recorded DeleteApplicationVpcConfiguration operation (see recordOperation) -- real AWS's DeleteApplicationVpcConfigurationOutput carries an OperationId field, unlike most other Add*/Delete* config ops.

func (*InMemoryBackend) DescribeApplication

func (b *InMemoryBackend) DescribeApplication(ctx context.Context, name string) (*Application, error)

DescribeApplication retrieves an application by name. Returns a deep copy so callers cannot mutate internal state.

func (*InMemoryBackend) DescribeApplicationOperation

func (b *InMemoryBackend) DescribeApplicationOperation(
	ctx context.Context,
	name, operationID string,
) (*ApplicationOperation, error)

DescribeApplicationOperation returns a single operation by ID.

func (*InMemoryBackend) DescribeApplicationSnapshot

func (b *InMemoryBackend) DescribeApplicationSnapshot(
	ctx context.Context,
	appName, snapshotName string,
) (*Snapshot, error)

DescribeApplicationSnapshot retrieves a snapshot by application name and snapshot name.

func (*InMemoryBackend) DescribeApplicationVersion

func (b *InMemoryBackend) DescribeApplicationVersion(
	ctx context.Context,
	name string,
	versionID int64,
) (*Application, error)

DescribeApplicationVersion returns the application state at a specific version ID.

func (*InMemoryBackend) DiscoverInputSchema

func (b *InMemoryBackend) DiscoverInputSchema(
	_ context.Context,
	resourceARN, _, _ string,
) (*DiscoveredSchema, error)

DiscoverInputSchema returns a synthetic discovered schema for a resource ARN.

func (*InMemoryBackend) GenerateApplicationARN

func (b *InMemoryBackend) GenerateApplicationARN(name string) string

GenerateApplicationARN exposes the ARN builder for testing.

func (*InMemoryBackend) ListApplicationOperations

func (b *InMemoryBackend) ListApplicationOperations(
	ctx context.Context,
	name, nextToken string,
) ([]*ApplicationOperation, string, error)

ListApplicationOperations returns operations for an application with optional pagination.

func (*InMemoryBackend) ListApplicationSnapshots

func (b *InMemoryBackend) ListApplicationSnapshots(
	ctx context.Context,
	appName, nextToken string,
) ([]*Snapshot, string, error)

ListApplicationSnapshots returns snapshots for an application with optional pagination, sorted by creation time.

func (*InMemoryBackend) ListApplicationVersions

func (b *InMemoryBackend) ListApplicationVersions(
	ctx context.Context,
	name, nextToken string,
) ([]*ApplicationVersionSummary, string, error)

ListApplicationVersions returns version summaries for an application.

func (*InMemoryBackend) ListApplications

func (b *InMemoryBackend) ListApplications(ctx context.Context, nextToken string) ([]*Application, string)

ListApplications returns applications with optional pagination.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(_ context.Context, resourceARN string) ([]Tag, error)

ListTagsForResource returns tags for an application, sorted by key.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the backend default region.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state and resets the ID counter.

func (*InMemoryBackend) Restore

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

Restore loads backend state from a JSON snapshot.

func (*InMemoryBackend) RollbackApplication

func (b *InMemoryBackend) RollbackApplication(
	ctx context.Context,
	name string,
	currentVersionID int64,
) (*Application, string, error)

RollbackApplication rolls back an application to its previous version, returning the OperationID of the recorded RollbackApplication operation (see recordOperation).

func (*InMemoryBackend) SeedApplicationConfiguration

func (b *InMemoryBackend) SeedApplicationConfiguration(ctx context.Context, name string, cfg SeedConfig) error

SeedApplicationConfiguration sets a newly created application's initial configuration (SQL inputs/outputs/reference-data-sources, VPC configurations, CloudWatch logging options, and the Flink/Code/ Environment/Snapshot/Rollback/Encryption portions of ApplicationConfiguration) in one step, without bumping ApplicationVersionId or appending a second version-history entry -- this mirrors real AWS, where CreateApplication's inline ApplicationConfiguration is part of the application's first version (ApplicationVersionId stays 1), unlike the separately-versioned Add* operations. Callers (handleCreateApplication) must invoke this immediately after CreateApplication succeeds, before the new application is exposed to any other caller. Returns ErrNotFound if name doesn't exist.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) StartApplication

func (b *InMemoryBackend) StartApplication(
	ctx context.Context,
	name string,
	runConfig *RunConfigInput,
) (string, error)

StartApplication sets the application status to RUNNING and returns the OperationID of the recorded StartApplication operation (see recordOperation). Returns ResourceInUseException if the application is not in READY state, matching real AWS Kinesis Analytics v2 behavior. runConfig, when non-nil, is stored as the application's RunConfigurationDescription -- real AWS clients (Terraform, CloudFormation) commonly start a Flink application with ApplicationRestoreConfiguration set to restore from a snapshot, and expect DescribeApplication to echo it back afterward.

func (*InMemoryBackend) StopApplication

func (b *InMemoryBackend) StopApplication(ctx context.Context, name string) (string, error)

StopApplication sets the application status to READY and returns the OperationID of the recorded StopApplication operation (see recordOperation). Returns ResourceInUseException if the application is not in RUNNING state, matching real AWS Kinesis Analytics v2 behavior.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(_ context.Context, resourceARN string, tags []Tag) error

TagResource adds tags to an application.

func (*InMemoryBackend) UntagResource

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

UntagResource removes tags from an application.

func (*InMemoryBackend) UpdateApplication

func (b *InMemoryBackend) UpdateApplication(
	ctx context.Context,
	params UpdateApplicationParams,
) (*Application, string, error)

UpdateApplication updates an application, returning the OperationID of the recorded UpdateApplication operation (see recordOperation). params.CurrentApplicationVersionID/params.ConditionalToken implement the two alternative optimistic-concurrency checks real AWS performs (see checkAndBumpVersionOrToken). References inside params.CloudWatchLoggingOptionUpdates/ApplicationConfigurationUpdate to sub-resource IDs that don't exist are validated *before* the version is bumped, so a rejected request never leaves a phantom version-history entry (matching the Add*/Delete* config ops' "find before bumping" convention elsewhere in this package).

func (*InMemoryBackend) UpdateApplicationMaintenanceConfiguration

func (b *InMemoryBackend) UpdateApplicationMaintenanceConfiguration(
	ctx context.Context,
	name string, maintenanceWindowStartTime string,
) (*Application, error)

UpdateApplicationMaintenanceConfiguration sets the maintenance window start time.

type InputDescription

type InputDescription struct {
	InputProcessingConfigurationDescription *InputProcessingConfigurationDesc `json:"InputProcessingConfigurationDescription,omitempty"` //nolint:lll // AWS API name
	KinesisStreamsInputDescription          *KinesisStreamsInputDesc          `json:"KinesisStreamsInputDescription,omitempty"`          //nolint:lll // AWS API name
	KinesisFirehoseInputDescription         *KinesisFirehoseInputDesc         `json:"KinesisFirehoseInputDescription,omitempty"`         //nolint:lll // AWS API name
	InputID                                 string                            `json:"InputId"`
	NamePrefix                              string                            `json:"NamePrefix,omitempty"`
}

InputDescription describes an application input configuration.

type InputProcessingConfigurationDesc

type InputProcessingConfigurationDesc struct {
	InputLambdaProcessor *LambdaProcessorDesc `json:"InputLambdaProcessor,omitempty"`
}

InputProcessingConfigurationDesc describes an input processing configuration.

type InputUpdate added in v1.2.0

type InputUpdate struct {
	KinesisStreamsInputUpdate          *KinesisStreamsInputDesc
	KinesisFirehoseInputUpdate         *KinesisFirehoseInputDesc
	InputProcessingConfigurationUpdate *InputProcessingConfigurationDesc
	InputID                            string
	NamePrefixUpdate                   string
}

InputUpdate describes updates to an existing application input, identified by InputID. Only the fields gopherstack's InputDescription models are supported (see models.go); InputSchemaUpdate/InputParallelismUpdate are not modeled anywhere in this backend (no different than at Add-time) and are ignored if present on the wire.

type KinesisFirehoseInputDesc

type KinesisFirehoseInputDesc struct {
	ResourceARN string `json:"ResourceARN"`
	RoleARN     string `json:"RoleARN,omitempty"`
}

KinesisFirehoseInputDesc describes a Kinesis Firehose input.

type KinesisFirehoseOutputDesc

type KinesisFirehoseOutputDesc struct {
	ResourceARN string `json:"ResourceARN"`
}

KinesisFirehoseOutputDesc describes a Kinesis Firehose output.

type KinesisStreamsInputDesc

type KinesisStreamsInputDesc struct {
	ResourceARN string `json:"ResourceARN"`
	RoleARN     string `json:"RoleARN,omitempty"`
}

KinesisStreamsInputDesc describes a Kinesis Streams input.

type KinesisStreamsOutputDesc

type KinesisStreamsOutputDesc struct {
	ResourceARN string `json:"ResourceARN"`
}

KinesisStreamsOutputDesc describes a Kinesis Streams output.

type LambdaOutputDesc

type LambdaOutputDesc struct {
	ResourceARN string `json:"ResourceARN"`
}

LambdaOutputDesc describes a Lambda output.

type LambdaProcessorDesc

type LambdaProcessorDesc struct {
	ResourceARN string `json:"ResourceARN"`
}

LambdaProcessorDesc describes a Lambda input processor.

type MonitoringConfigDesc added in v1.2.0

type MonitoringConfigDesc struct {
	ConfigurationType string `json:"ConfigurationType"`
	LogLevel          string `json:"LogLevel,omitempty"`
	MetricsLevel      string `json:"MetricsLevel,omitempty"`
}

MonitoringConfigDesc describes a Flink application's CloudWatch logging configuration.

type MonitoringConfigUpdate added in v1.2.0

type MonitoringConfigUpdate struct {
	ConfigurationTypeUpdate string
	LogLevelUpdate          string
	MetricsLevelUpdate      string
}

MonitoringConfigUpdate describes updates to a Flink application's CloudWatch logging configuration.

type OutputDescription

type OutputDescription struct {
	KinesisStreamsOutputDescription  *KinesisStreamsOutputDesc  `json:"KinesisStreamsOutputDescription,omitempty"`
	KinesisFirehoseOutputDescription *KinesisFirehoseOutputDesc `json:"KinesisFirehoseOutputDescription,omitempty"`
	LambdaOutputDescription          *LambdaOutputDesc          `json:"LambdaOutputDescription,omitempty"`
	DestinationSchema                *DestinationSchemaDesc     `json:"DestinationSchema,omitempty"`
	OutputID                         string                     `json:"OutputId"`
	Name                             string                     `json:"Name,omitempty"`
}

OutputDescription describes an application output configuration.

type OutputUpdate added in v1.2.0

type OutputUpdate struct {
	KinesisStreamsOutputUpdate  *KinesisStreamsOutputDesc
	KinesisFirehoseOutputUpdate *KinesisFirehoseOutputDesc
	LambdaOutputUpdate          *LambdaOutputDesc
	DestinationSchemaUpdate     *DestinationSchemaDesc
	OutputID                    string
	NameUpdate                  string
}

OutputUpdate describes updates to an existing application output, identified by OutputID.

type ParallelismConfigDesc added in v1.2.0

type ParallelismConfigDesc struct {
	AutoScalingEnabled *bool  `json:"AutoScalingEnabled,omitempty"`
	Parallelism        *int32 `json:"Parallelism,omitempty"`
	ParallelismPerKPU  *int32 `json:"ParallelismPerKPU,omitempty"`
	CurrentParallelism *int32 `json:"CurrentParallelism,omitempty"`
	ConfigurationType  string `json:"ConfigurationType"`
}

ParallelismConfigDesc describes a Flink application's parallelism configuration.

type ParallelismConfigUpdate added in v1.2.0

type ParallelismConfigUpdate struct {
	AutoScalingEnabledUpdate *bool
	ParallelismUpdate        *int32
	ParallelismPerKPUUpdate  *int32
	ConfigurationTypeUpdate  string
}

ParallelismConfigUpdate describes updates to a Flink application's parallelism configuration.

type PropertyGroup added in v1.2.0

type PropertyGroup struct {
	PropertyMap     map[string]string `json:"PropertyMap"`
	PropertyGroupID string            `json:"PropertyGroupId"`
}

PropertyGroup is a key-value execution property group (shared shape for both the request PropertyGroups and the response PropertyGroupDescriptions -- real AWS uses the identical PropertyGroup type on both sides).

type Provider

type Provider struct{}

Provider implements service.Provider for Kinesis Data Analytics v2.

func (*Provider) Init

Init initializes the Kinesis Data Analytics v2 backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ReferenceDataSourceDescription

type ReferenceDataSourceDescription struct {
	S3ReferenceDataSourceDescription *S3ReferenceDataSourceDesc `json:"S3ReferenceDataSourceDescription,omitempty"`
	ReferenceID                      string                     `json:"ReferenceId"`
	TableName                        string                     `json:"TableName,omitempty"`
}

ReferenceDataSourceDescription describes a reference data source.

type ReferenceDataSourceUpdate added in v1.2.0

type ReferenceDataSourceUpdate struct {
	S3ReferenceDataSourceUpdate *S3ReferenceDataSourceDesc
	ReferenceID                 string
	TableNameUpdate             string
}

ReferenceDataSourceUpdate describes updates to an existing reference data source, identified by ReferenceID.

type RunConfigDesc added in v1.2.0

type RunConfigDesc struct {
	ApplicationRestoreConfigurationDescription *ApplicationRestoreConfig `json:"ApplicationRestoreConfigurationDescription,omitempty"` //nolint:lll // AWS API name
	FlinkRunConfigurationDescription           *FlinkRunConfig           `json:"FlinkRunConfigurationDescription,omitempty"`           //nolint:lll // AWS API name
}

RunConfigDesc describes an application's starting parameters.

type RunConfigInput added in v1.2.0

type RunConfigInput struct {
	ApplicationRestoreConfiguration *ApplicationRestoreConfig
	FlinkRunConfiguration           *FlinkRunConfig
}

RunConfigInput carries StartApplication's RunConfiguration and UpdateApplication's RunConfigurationUpdate request fields -- both share the same ApplicationRestoreConfiguration/FlinkRunConfiguration shape in real AWS.

type S3CodeLocationDesc added in v1.2.0

type S3CodeLocationDesc struct {
	BucketARN     string `json:"BucketARN"`
	FileKey       string `json:"FileKey"`
	ObjectVersion string `json:"ObjectVersion,omitempty"`
}

S3CodeLocationDesc describes the S3 location of application code.

type S3ReferenceDataSourceDesc

type S3ReferenceDataSourceDesc struct {
	BucketARN string `json:"BucketARN"`
	FileKey   string `json:"FileKey"`
}

S3ReferenceDataSourceDesc describes the S3 source for reference data.

type SQLApplicationConfigUpdate added in v1.2.0

type SQLApplicationConfigUpdate struct {
	InputUpdates               []InputUpdate
	OutputUpdates              []OutputUpdate
	ReferenceDataSourceUpdates []ReferenceDataSourceUpdate
}

SQLApplicationConfigUpdate bundles the three SQLApplicationConfigurationUpdate sub-updates.

type SeedConfig added in v1.2.0

type SeedConfig struct {
	CodeConfig                *ApplicationCodeConfigDesc
	FlinkConfig               *FlinkApplicationConfigDesc
	SnapshotsEnabled          *bool
	RollbackEnabled           *bool
	EncryptionConfig          *ApplicationEncryptionConfigDesc
	Inputs                    []InputDescription
	Outputs                   []OutputDescription
	ReferenceDataSources      []ReferenceDataSourceDescription
	VpcConfigs                []VpcConfigurationDescription
	CWLOptions                []CloudWatchLoggingOptionDesc
	EnvironmentPropertyGroups []PropertyGroup
}

SeedConfig bundles every piece of inline configuration CreateApplication's ApplicationConfiguration/CloudWatchLoggingOptions request fields can carry. See SeedApplicationConfiguration.

func (SeedConfig) IsEmpty added in v1.2.0

func (cfg SeedConfig) IsEmpty() bool

IsEmpty reports whether cfg carries no inline configuration at all, so callers can skip the SeedApplicationConfiguration round-trip entirely (matching the pre-existing len(...)>0-checks convention in handleCreateApplication).

type Snapshot

type Snapshot struct {
	SnapshotCreation time.Time `json:"-"`
	ApplicationARN   string    `json:"ApplicationARN"`
	SnapshotName     string    `json:"SnapshotName"`
	SnapshotStatus   string    `json:"SnapshotStatus"`
	// Region and AppName are the owning region and application name, used
	// only to derive the store.Table composite key (region#appName#name) and
	// the byApp index -- SnapshotName alone is only unique within an
	// application. Never serialized on the wire: handler.go always builds a
	// dedicated snapshotDetail response DTO.
	Region             string `json:"-"`
	AppName            string `json:"-"`
	ApplicationVersion int64  `json:"ApplicationVersionId"`
}

Snapshot represents an application snapshot.

type StorageBackend

type StorageBackend interface {
	Region() string
	AccountID() string
	GenerateApplicationARN(name string) string

	CreateApplication(
		ctx context.Context, name, runtimeEnv, serviceRole, description, mode string, tags []Tag,
	) (*Application, error)
	SeedApplicationConfiguration(ctx context.Context, name string, cfg SeedConfig) error
	DescribeApplication(ctx context.Context, name string) (*Application, error)
	ListApplications(ctx context.Context, nextToken string) ([]*Application, string)
	UpdateApplication(ctx context.Context, params UpdateApplicationParams) (*Application, string, error)
	DeleteApplication(ctx context.Context, name string, createTimestampSeconds *float64) error
	StartApplication(ctx context.Context, name string, runConfig *RunConfigInput) (string, error)
	StopApplication(ctx context.Context, name string) (string, error)

	CreateApplicationSnapshot(ctx context.Context, appName, snapshotName string) (*Snapshot, error)
	DescribeApplicationSnapshot(ctx context.Context, appName, snapshotName string) (*Snapshot, error)
	ListApplicationSnapshots(ctx context.Context, appName, nextToken string) ([]*Snapshot, string, error)
	DeleteApplicationSnapshot(ctx context.Context, appName, snapshotName string) error

	TagResource(ctx context.Context, resourceARN string, tags []Tag) error
	UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
	ListTagsForResource(ctx context.Context, resourceARN string) ([]Tag, error)

	// AddApplicationCloudWatchLoggingOption/AddApplicationVpcConfiguration/
	// DeleteApplicationCloudWatchLoggingOption/DeleteApplicationVpcConfiguration
	// return an OperationID -- real AWS's outputs for these four ops (and only
	// these four among the Add*/Delete* config family) carry an OperationId
	// field, verified against aws-sdk-go-v2's api_op_*.go.
	AddApplicationCloudWatchLoggingOption(
		ctx context.Context, name string, currentVersionID int64, logStreamARN, roleARN string,
	) (string, error)
	AddApplicationInput(ctx context.Context, name string, currentVersionID int64, input InputDescription) error
	AddApplicationInputProcessingConfiguration(
		ctx context.Context,
		name string,
		currentVersionID int64,
		inputID string,
		config *InputProcessingConfigurationDesc,
	) error
	AddApplicationOutput(ctx context.Context, name string, currentVersionID int64, output OutputDescription) error
	AddApplicationReferenceDataSource(
		ctx context.Context, name string, currentVersionID int64, ref ReferenceDataSourceDescription,
	) error
	AddApplicationVpcConfiguration(
		ctx context.Context, name string, currentVersionID int64, vpc VpcConfigurationDescription,
	) (string, error)

	DeleteApplicationCloudWatchLoggingOption(
		ctx context.Context, name string, currentVersionID int64, loggingOptionID string,
	) (string, error)
	DeleteApplicationInputProcessingConfiguration(
		ctx context.Context, name string, currentVersionID int64, inputID string,
	) error
	DeleteApplicationOutput(ctx context.Context, name string, currentVersionID int64, outputID string) error
	DeleteApplicationReferenceDataSource(
		ctx context.Context, name string, currentVersionID int64, referenceID string,
	) error
	DeleteApplicationVpcConfiguration(
		ctx context.Context, name string, currentVersionID int64, vpcConfigurationID string,
	) (string, error)

	DescribeApplicationOperation(ctx context.Context, name, operationID string) (*ApplicationOperation, error)
	ListApplicationOperations(ctx context.Context, name, nextToken string) ([]*ApplicationOperation, string, error)
	DescribeApplicationVersion(ctx context.Context, name string, versionID int64) (*Application, error)
	ListApplicationVersions(ctx context.Context, name, nextToken string) ([]*ApplicationVersionSummary, string, error)
	RollbackApplication(ctx context.Context, name string, currentVersionID int64) (*Application, string, error)
	UpdateApplicationMaintenanceConfiguration(
		ctx context.Context, name string, maintenanceWindowStartTime string,
	) (*Application, error)
	DiscoverInputSchema(
		ctx context.Context, resourceARN, roleARN, inputStartingPosition string,
	) (*DiscoveredSchema, error)
}

StorageBackend is the interface for the Kinesis Data Analytics v2 in-memory backend.

type Tag

type Tag struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

Tag represents a key-value tag pair.

type UpdateApplicationParams added in v1.2.0

type UpdateApplicationParams struct {
	ApplicationConfigurationUpdate *ApplicationConfigurationUpdate
	RunConfigurationUpdate         *RunConfigInput
	Name                           string
	ConditionalToken               string
	ServiceExecutionRoleUpdate     string
	ApplicationDescription         string
	RuntimeEnvironmentUpdate       string
	CloudWatchLoggingOptionUpdates []CloudWatchLoggingOptionUpdate
	CurrentApplicationVersionID    int64
}

UpdateApplicationParams bundles every UpdateApplication request field.

type VpcConfigUpdate added in v1.2.0

type VpcConfigUpdate struct {
	VpcConfigurationID     string
	SubnetIDUpdates        []string
	SecurityGroupIDUpdates []string
}

VpcConfigUpdate describes updates to an existing VPC configuration, identified by VpcConfigurationID.

type VpcConfigurationDescription

type VpcConfigurationDescription struct {
	VpcConfigurationID string   `json:"VpcConfigurationId"`
	VpcID              string   `json:"VpcId,omitempty"`
	SubnetIDs          []string `json:"SubnetIds"`
	SecurityGroupIDs   []string `json:"SecurityGroupIds"`
}

VpcConfigurationDescription describes a VPC configuration.

Jump to

Keyboard shortcuts

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