Introducing a new way to review your PRs.

Read the announcement

floci-io / floci

Light, fluffy, and always free - The AWS Local Emulator alternative

View on GitHub

38 documents · Updated Nov 23, 2026

docs / svc-timestream-influxdb

Timestream for InfluxDB

Timestream for InfluxDB provides an AWS-shaped control plane for InfluxDB resources. It manages instances, clusters, parameter groups, backups, tags, and resource state while optionally running a real InfluxDB 2.x data plane in Docker. The control plane keeps resource records and database runtime state aligned across create, update, reboot, restore, delete, and emulator restart flows.

For shared emulator startup, storage, and reset behavior, see Service configuration and lifecycle. For the wider database and cache service model, see Databases and cache. For the storage boundary used by persisted resources, see Storage backend.

Service boundary

The action adapter in src/…/TimestreamInfluxDbJsonHandler.java maps Timestream for InfluxDB actions to the service and turns resource state into AWS-shaped JSON. The service owns the resource relationships, validation, persistence, status changes, and runtime work. Requests are scoped to a region and account, and list actions return paged results.

The service exposes four resource areas:

  • DB instances are standalone InfluxDB resources or members of a DB cluster.
  • DB clusters describe a grouped deployment and expose member instances.
  • DB parameter groups select an InfluxDB engine and hold engine settings.
  • DB backups capture resource configuration and, when a data plane exists, database data.

Tags use the same resource ARN boundary for all four areas. Secret Manager stores the initial InfluxDB authorization values when the service can create the secret.

Action surface

The action surface supports create, read, list, update, reboot, and delete operations for instances and clusters. It also supports parameter-group creation and lookup, backup creation and lookup, restore, and tag changes. Cluster member listing makes the relationship between a cluster and its generated instances visible without treating members as independent cluster resources.

The response shape separates summary data from detail data. Create, update, reboot, and delete responses report the requested state transition, while get and list responses report stored state. Sensitive authorization information is not returned while a resource is in CREATING status.

References: src/…/TimestreamInfluxDbJsonHandler.java• L36-71 src/…/TimestreamInfluxDbService.java• L52-93 src/…/TimestreamInfluxDbService.java• L758-780

Resource model

Instances and clusters form the main database control plane. A standalone instance owns one InfluxDB runtime. A cluster owns a group of generated member instances, so changes to the cluster also update the member view.

Instance lifecycle

An instance represents an InfluxDB 2.x deployment with a name, endpoint, port, capacity, network placement, deployment mode, backup settings, and optional parameter group. A standalone instance requires an initial password and can use either a single availability zone or a Multi-AZ standby mode. Its endpoint becomes usable when the resource reaches AVAILABLE.

Instance updates change supported operational settings such as the instance type, storage, port, deployment mode, maintenance schedule, backup configuration, log delivery, or parameter group. A cluster member cannot be updated or deleted as an independent instance; the cluster is the control point for that member.

References: src/…/TimestreamInfluxDbService.java• L145-220 src/…/TimestreamInfluxDbService.java• L233-312 src/…/DbInstance.java• L13-51

Cluster lifecycle

A cluster represents a grouped deployment with a writer endpoint and reader endpoint. It can use InfluxDB v2, InfluxDB v3 Core, or InfluxDB v3 Enterprise through its parameter group. The cluster creates member instances that describe roles such as primary, replica, ingest, query, or compaction.

Cluster updates change shared settings and propagate the relevant values to all members. Reboot acts on the cluster runtime and can validate a selected subset of member IDs before the reboot starts. Deleting a cluster removes its member records together with the cluster; member deletion is not a separate path.

References: src/…/TimestreamInfluxDbService.java• L318-405 src/…/TimestreamInfluxDbService.java• L426-506 src/…/TimestreamInfluxDbService.java• L1090-1148 src/…/DbCluster.java• L13-49

Parameter groups

A DB parameter group is a named set of engine settings that selects the InfluxDB engine used by a cluster. A group with no engine section defaults to InfluxDB v2. The service accepts one engine section per group and validates the values that affect the selected engine.

Parameter groups link control-plane configuration to the runtime. InfluxDB v2 settings are converted to INFLUXD_* environment values when a container starts. A group must match the cluster engine, and instances accept only InfluxDB v2 groups. Changing a group on a resource that has a running data plane causes the runtime to be provisioned again with the new settings.

References: src/…/TimestreamInfluxDbService.java• L509-540 src/…/TimestreamInfluxDbService.java• L1217-1222 src/…/TimestreamInfluxDbContainerManager.java• L271-310 src/…/TimestreamInfluxDbValidation.java• L307-359

Backup and restore

Backups preserve both the resource configuration needed to recreate a database and, when Docker backs the resource, a copy of the InfluxDB data and CLI configuration. A backup can target either an instance or a cluster, but the source must be AVAILABLE.

The backup flow is asynchronous when a data plane exists. It first records the backup as IN_PROGRESS, captures the data, and then changes the backup to COMPLETED or FAILED. A resource without a data plane receives a completed control-plane backup without captured runtime data.

Restore modes

NEW_RESOURCE creates a new instance or cluster from the backup and allows supported network and operational settings to override the saved configuration. REPLACE_EXISTING restores data into the original resource, keeps its configuration unchanged, and requires the supplied name to match the existing resource. Point-in-time restore is rejected because continuous backup restore is not supported.

The restore response identifies the restored resource and reports RESTORING. When captured data is present, the runtime is restored asynchronously before the resource returns to AVAILABLE; a runtime error produces RESTORE_FAILED.

References: src/…/TimestreamInfluxDbService.java• L547-606 src/…/TimestreamInfluxDbService.java• L631-763 src/…/TimestreamInfluxDbService.java• L1025-1087 src/…/TimestreamInfluxDbContainerManager.java• L220-257

Validation and state changes

Validation protects the control-plane contract before a resource is stored or a runtime action starts. TimestreamInfluxDbValidation checks required fields, names, identifiers, enums, numeric ranges, network IDs, ports, tags, maintenance windows, backup settings, and engine parameter shapes. Validation errors use AWS-style ValidationException responses; missing resources and invalid state transitions use resource-not-found or conflict errors.

The most important cross-resource checks are:

  • Instance and cluster names must be unique within a region for their resource type.
  • A parameter group must exist before an instance or cluster can use it.
  • The parameter-group engine must match the cluster engine.
  • Storage types other than InfluxIOIncludedT1 require at least 400 GiB when allocated storage is set.
  • A port must be in the allowed range and must not use a reserved emulator port.
  • A resource backup must be AVAILABLE at capture time, and a restore source must be COMPLETED.
  • A resource can have no more than 200 tags.

Statuses show the difference between an accepted control-plane request and a ready runtime. Common transitional states include CREATING, UPDATING, UPDATING_INSTANCE_TYPE, UPDATING_DEPLOYMENT_TYPE, REBOOTING, RESTORING, and DELETING. The background runtime task later writes AVAILABLE or an operation-specific failure state.

References: src/…/TimestreamInfluxDbValidation.java• L76-219 src/…/TimestreamInfluxDbValidation.java• L221-359 src/…/TimestreamInfluxDbService.java• L547-668 src/…/TimestreamInfluxDbService.java• L827-863

Docker runtime lifecycle

The Docker-backed data plane gives a control-plane resource a real InfluxDB 2.x process. TimestreamInfluxDbContainerManager starts one container for each supported runtime, publishes the InfluxDB listener on an allocated host port, waits for the /health endpoint, and returns the endpoint to the resource record. The service performs this work in the background so control-plane calls can return a transitional status.

The runtime uses separate persistent storage for database data and InfluxDB configuration. Each instance or cluster records its data-volume name when it is created, so later restarts and deletes use the same storage identity. Older records resolve to the legacy volume name instead of silently moving their data to a new volume. This keeps database contents and CLI configuration across restarts and lets a persisted resource resume without setup credentials.

If Docker is not reachable, the service keeps the resource available with a local endpoint but does not provide a real InfluxDB data plane. Only InfluxDB v2 resources with credentials are container-backed; other supported engine shapes remain control-plane resources. A cluster without a password therefore exposes its control-plane state without starting an InfluxDB 2.x container.

This diagram shows how a resource request moves from stored state to a ready or failed runtime state.

flowchart LR
    A[Create or change resource] --> B[Store transitional status]
    B --> C{Docker reachable?}
    C -- No --> D[Mark available without data plane]
    C -- Yes --> E[Start or restart container]
    E --> F[Attach persistent data and config]
    F --> G[Probe InfluxDB health]
    G -- Ready --> H[Save endpoint and container state]
    H --> I[Mark available]
    G -- Timeout or error --> J[Mark operation failed]

Reboot restarts the existing container and repeats the health check. Delete stops and removes the container, releases its host port, and removes named storage. On emulator reset, managed containers stop and resource records clear; persistent storage remains available for the next run. On startup, persisted resources with runtime records are started again without repeating initial setup.

References: src/…/TimestreamInfluxDbContainerManager.java• L40-45 src/…/TimestreamInfluxDbContainerManager.java• L87-218 src/…/TimestreamInfluxDbService.java• L831-849 src/…/TimestreamInfluxDbService.java• L868-905 src/…/TimestreamInfluxDbService.java• L908-1019 src/…/DbInstance.java• L42-63 src/…/DbCluster.java• L38-61

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to action names or response fields must stay aligned between the JSON handler and the resource state returned by the service.
  • Changes to engine parameter names must stay aligned between parameter validation, cluster member roles, and the INFLUXD_* environment mapping.
  • Changes to resource status transitions must cover both the immediate response and the later Docker task result.
  • Changes to backup metadata must preserve enough configuration for both NEW_RESOURCE and REPLACE_EXISTING restore paths.
  • Changes to container storage or port handling must cover restart, persisted-runtime recovery, delete, and reset flows.
  • Changes to the stamped Docker volume name must preserve the legacy-name fallback for resources created before the volume field existed.
  • Changes to resource ARN parsing must keep account and region scoping consistent with tag reads and writes.

Important failure modes

TriggerConsequenceGuard
Docker is unreachableThe resource reports AVAILABLE but has no real InfluxDB data plane.Treat the endpoint and runtime presence as separate concerns when testing or consuming the service.
InfluxDB does not pass the health probe before the configured timeoutCreate, parameter-group reprovision, or restore ends in its operation-specific failure status.Keep the image, port range, Docker network, and readiness timeout aligned.
A persisted resource loses its recorded volume nameRestart or restore can attach a new empty volume and hide the existing database data.Keep the stamped volume name and resolve older records through the legacy volume name.
A cluster member is updated or deleted directlyThe request fails because cluster members are controlled by the cluster.Send shared changes to the cluster and delete the cluster to remove its members.
A backup is requested while the source is not AVAILABLEThe backup request fails with a conflict and no usable backup is created.Wait for the source resource to reach AVAILABLE.
A restore uses a backup that is not COMPLETEDRestore is rejected before a new resource or runtime action starts.Poll backup status before restoring.
A parameter group engine does not match its clusterThe cluster update or related runtime configuration is rejected.Use an engine-matched group; use v2 groups for instances.
A runtime is removed while an asynchronous task is still finishingThe task can find no resource and discards the orphan runtime.Treat delete as final and do not assume a pending task will recreate the resource.

Key files

FileWhy to read it
src/…/TimestreamInfluxDbJsonHandler.javaShows the public action surface and the distinction between summary, detail, and transition responses.
src/…/TimestreamInfluxDbService.javaShows the resource relationships, lifecycle states, backup and restore behavior, persistence boundary, and asynchronous runtime coordination.
src/…/TimestreamInfluxDbValidation.javaDefines the request contract and the cross-field rules that shape accepted resources.
src/…/TimestreamInfluxDbContainerManager.javaExplains Docker startup, health checks, persistent storage, backup artifacts, parameter mapping, and runtime cleanup.
src/…/DbInstance.javaDefines the state exposed for standalone instances and cluster members, including the persisted Docker volume identity.
src/…/DbCluster.javaDefines the cluster state and its shared endpoint, configuration, and persisted Docker volume identity.
src/…/DbParameterGroup.javaDefines the engine selection and parameter-group state.
src/…/DbBackup.javaDefines backup status, source type, saved configuration, expiry, and captured-data state.