diff --git a/README.md b/README.md
index cdf9766bf9..8f3fee0d5d 100644
--- a/README.md
+++ b/README.md
@@ -297,7 +297,7 @@ Floci supports local emulation for application services, data services, eventing
| API and identity | API Gateway REST, API Gateway v2, AppSync, Cognito, Cognito Identity, ACM, Route53, Route 53 Resolver, Cloud Map, Global Accelerator |
| Containers and compute | ECS, EC2, Lightsail, EKS, MWAA, ECR, EFS, CodeBuild, CodeDeploy, CodePipeline, CodeGuru Reviewer, CodeArtifact, AWS Batch, Auto Scaling, Application Auto Scaling, Elastic Beanstalk, ELB v2, ELB Classic |
| Data, analytics, and AI | Athena, Glue, Lake Formation, EMR, EMR Serverless, Redshift, Redshift Data API, Firehose, Managed Service for Apache Flink, OpenSearch, S3 Tables, S3 Vectors, Textract, Transcribe, Comprehend, Rekognition, Translate, Bedrock, Bedrock Runtime, Bedrock AgentCore, Bedrock AgentCore Control, SageMaker |
-| Databases and caching | RDS, RDS Data API, Neptune, DocumentDB, MemoryDB, ElastiCache |
+| Databases and caching | RDS, RDS Data API, Neptune, DocumentDB, MemoryDB, ElastiCache, Timestream for InfluxDB |
| Messaging and transfer | SES, Kinesis, MSK, Amazon MQ, Transfer Family, DataSync, IoT Core, Amazon Connect, Amazon AppIntegrations |
| Security and governance | AWS Network Firewall, AWS RAM, Service Quotas, WAF v2, GuardDuty, Amazon Inspector, CloudTrail, CloudFront, Resource Groups Tagging API, Resource Explorer 2, CloudHSM v2, Organizations, AWS Account Management, IAM Access Analyzer, IAM Identity Center (SSO Admin, OIDC, Access Portal, SCIM), Identity Store, Amazon Macie, Amazon Detective, Security Hub, Amazon Verified Permissions, Control Catalog, Control Tower, Service Catalog, AWS Marketplace |
| Cost and billing | AWS Budgets, Pricing, Cost Explorer, Cost and Usage Reports, BCM Pricing Calculator, BCM Data Exports |
@@ -337,6 +337,7 @@ For operation-level compatibility, see the [Services Overview](https://floci.io/
| ElastiCache | Real Docker | Redis / Valkey protocol, IAM auth, SigV4 validation |
| MemoryDB | Real Docker | Redis / Valkey protocol via real containers; JSON 1.1 control plane; reuses ElastiCache RESP proxy |
| RDS | Real Docker | PostgreSQL, MySQL, MariaDB, IAM auth, JDBC-compatible engines |
+| Timestream for InfluxDB | Real Docker, mock mode available | InfluxDB 2.x DB instances and read replica clusters via `influxdb:2.7`; initial auth secret in Secrets Manager; backups and restore through the influx CLI |
| RDS Data API | REST JSON over real RDS containers | Raw SQL execution and transactions for local MySQL / MariaDB RDS resources |
| Neptune | Real Docker | Graph DB via TinkerPop Gremlin Server (default) or Neo4j for openCypher/Bolt (`NEPTUNE_DB_TYPE`); RDS-shaped control plane; SigV4 proxy on port 8182 |
| DocumentDB | Real Docker, mock mode available | MongoDB-compatible cluster via real MongoDB containers; RDS-shaped control plane; MongoDB wire protocol on port 27017 |
diff --git a/compatibility-tests/sdk-test-java/pom.xml b/compatibility-tests/sdk-test-java/pom.xml
index cb72711cfe..772cb060d7 100644
--- a/compatibility-tests/sdk-test-java/pom.xml
+++ b/compatibility-tests/sdk-test-java/pom.xml
@@ -537,6 +537,11 @@
software.amazon.awssdk
bcmpricingcalculator
+
+
+ software.amazon.awssdk
+ timestreaminfluxdb
+
software.amazon.awssdk
diff --git a/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java b/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
index 77b364a2df..a4432d4141 100644
--- a/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
+++ b/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
@@ -41,6 +41,7 @@ import software.amazon.awssdk.services.ssooidc.SsoOidcClient;
import software.amazon.awssdk.services.identitystore.IdentitystoreClient;
import software.amazon.awssdk.services.budgets.BudgetsClient;
import software.amazon.awssdk.services.bcmpricingcalculator.BcmPricingCalculatorClient;
+import software.amazon.awssdk.services.timestreaminfluxdb.TimestreamInfluxDbClient;
import software.amazon.awssdk.services.macie2.Macie2Client;
import software.amazon.awssdk.services.controlcatalog.ControlCatalogClient;
import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient;
@@ -1339,6 +1340,14 @@ public final class TestFixtures {
.build();
}
+ public static TimestreamInfluxDbClient timestreamInfluxDbClient() {
+ return TimestreamInfluxDbClient.builder()
+ .endpointOverride(ENDPOINT)
+ .region(REGION)
+ .credentialsProvider(CREDENTIALS)
+ .build();
+ }
+
public static ResourceExplorer2Client resourceExplorer2Client() {
return resourceExplorer2Client(REGION);
}
diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/TimestreamInfluxDbTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/TimestreamInfluxDbTest.java
new file mode 100644
index 0000000000..aa7543c141
--- /dev/null
+++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/TimestreamInfluxDbTest.java
@@ -0,0 +1,86 @@
+package com.floci.test;
+
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.services.timestreaminfluxdb.TimestreamInfluxDbClient;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.CreateDbInstanceRequest;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.CreateDbInstanceResponse;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.CreateDbParameterGroupRequest;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.CreateDbParameterGroupResponse;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.DeleteDbInstanceRequest;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.GetDbInstanceRequest;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.GetDbInstanceResponse;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.GetDbParameterGroupRequest;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.InfluxDBv2Parameters;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.ListDbInstancesRequest;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.ListTagsForResourceRequest;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.LogLevel;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.Parameters;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.ResourceNotFoundException;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.TagResourceRequest;
+import software.amazon.awssdk.services.timestreaminfluxdb.model.ValidationException;
+
+import java.util.Map;
+import java.util.UUID;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class TimestreamInfluxDbTest {
+
+ @Test
+ void parameterGroupAndInstanceLifecycle() {
+ String suffix = UUID.randomUUID().toString().substring(0, 8);
+ try (TimestreamInfluxDbClient client = TestFixtures.timestreamInfluxDbClient()) {
+ CreateDbParameterGroupResponse group = client.createDbParameterGroup(CreateDbParameterGroupRequest.builder()
+ .name("sdk-group-" + suffix)
+ .parameters(Parameters.fromInfluxDBv2(InfluxDBv2Parameters.builder().logLevel(LogLevel.DEBUG).build()))
+ .build());
+ assertEquals(LogLevel.DEBUG, client.getDbParameterGroup(GetDbParameterGroupRequest.builder()
+ .identifier(group.id()).build()).parameters().influxDBv2().logLevel());
+
+ CreateDbInstanceResponse created = client.createDbInstance(CreateDbInstanceRequest.builder()
+ .name("sdk-db-" + suffix)
+ .password("password123")
+ .dbInstanceType("db.influx.medium")
+ .allocatedStorage(20)
+ .dbParameterGroupIdentifier(group.id())
+ .vpcSubnetIds("subnet-abc123")
+ .vpcSecurityGroupIds("sg-abc123")
+ .tags(Map.of("env", "compat"))
+ .build());
+ assertNotNull(created.id());
+ assertEquals("CREATING", created.statusAsString());
+
+ try {
+ GetDbInstanceResponse instance = client.getDbInstance(GetDbInstanceRequest.builder()
+ .identifier(created.id()).build());
+ assertEquals(created.arn(), instance.arn());
+ assertEquals(group.id(), instance.dbParameterGroupIdentifier());
+ assertTrue(client.listDbInstances(ListDbInstancesRequest.builder().build()).items().stream()
+ .anyMatch(summary -> summary.id().equals(created.id())));
+
+ client.tagResource(TagResourceRequest.builder()
+ .resourceArn(created.arn()).tags(Map.of("team", "metrics")).build());
+ Map tags = client.listTagsForResource(ListTagsForResourceRequest.builder()
+ .resourceArn(created.arn()).build()).tags();
+ assertEquals("compat", tags.get("env"));
+ assertEquals("metrics", tags.get("team"));
+ } finally {
+ client.deleteDbInstance(DeleteDbInstanceRequest.builder().identifier(created.id()).build());
+ }
+
+ assertThrows(ResourceNotFoundException.class, () -> client.getDbInstance(GetDbInstanceRequest.builder()
+ .identifier(created.id()).build()));
+ assertThrows(ValidationException.class, () -> client.createDbInstance(CreateDbInstanceRequest.builder()
+ .name("sdk-bad-" + suffix)
+ .password("password123")
+ .dbInstanceType("db.influx.medium")
+ .allocatedStorage(19)
+ .vpcSubnetIds("subnet-abc123")
+ .vpcSecurityGroupIds("sg-abc123")
+ .build()));
+ }
+ }
+}
diff --git a/docs/services/index.md b/docs/services/index.md
index 2e4091a2e2..95e2ed4a91 100644
--- a/docs/services/index.md
+++ b/docs/services/index.md
@@ -63,6 +63,7 @@ Operation counts are exact. For dispatch-table services (Query and JSON 1.1) eac
| [MemoryDB](memorydb.md) | `POST /` + `X-Amz-Target: AmazonMemoryDB.*` + TCP proxy | JSON 1.1 + RESP | 7 |
| [RDS](rds.md) | `POST /` with `Action=` param + TCP proxy | Query + wire | 14 |
| [RDS Data API](rds-data.md) | `/Execute`, `/BeginTransaction`, `/CommitTransaction`, `/RollbackTransaction` | REST JSON | 4 |
+| [Timestream for InfluxDB](timestream-influxdb.md) | `POST /` + `X-Amz-Target: AmazonTimestreamInfluxDB.*` + InfluxDB container | JSON 1.0 + InfluxDB HTTP | 24 |
| [MSK](msk.md) | `/v1/clusters/...`, `/api/v2/clusters/...` + Redpanda broker | REST JSON + Kafka | 8 |
| [Amazon MQ](amazonmq.md) | `/v1/brokers/...` + RabbitMQ broker | REST JSON + AMQP | 5 |
| [MWAA](mwaa.md) | `/` REST paths for environments + CLI/web proxy | REST JSON | 10 |
diff --git a/docs/services/timestream-influxdb.md b/docs/services/timestream-influxdb.md
new file mode 100644
index 0000000000..cf443c46f2
--- /dev/null
+++ b/docs/services/timestream-influxdb.md
@@ -0,0 +1,124 @@
+# Timestream for InfluxDB
+
+**Protocol:** JSON 1.0 (`X-Amz-Target: AmazonTimestreamInfluxDB.*`)
+**Endpoint:** `POST http://localhost:4566/`
+**Signing name:** `timestream-influxdb`
+
+Floci emulates the Amazon Timestream for InfluxDB management API and backs InfluxDB 2.x DB instances with
+real InfluxDB containers. The endpoint and port returned by `CreateDbInstance`, `GetDbInstance` and
+`GetDbCluster` point at the container, so the influx CLI, the InfluxDB UI and any InfluxDB 2.x client can
+write and query data against it.
+
+## Supported Actions
+
+
+| Action | Description |
+| --- | --- |
+| `CreateDbInstance` | Starts an InfluxDB 2.x container initialized with the requested username, password, organization and bucket |
+| `GetDbInstance` | Returns the instance, including the reachable endpoint and port once it is AVAILABLE |
+| `ListDbInstances` | Lists standalone and cluster instances with pagination |
+| `UpdateDbInstance` | Updates instance settings; a new parameter group recreates the container with its InfluxDB options |
+| `RebootDbInstance` | Restarts the backing container |
+| `DeleteDbInstance` | Stops and removes the container and its volumes |
+| `CreateDbCluster` | Creates a read replica cluster backed by one InfluxDB 2.x container, or an InfluxDB 3 cluster record |
+| `GetDbCluster` | Returns the cluster, including writer and reader endpoints |
+| `ListDbClusters` | Lists clusters with pagination |
+| `ListDbInstancesForCluster` | Lists the nodes of a cluster with their instance modes |
+| `UpdateDbCluster` | Updates cluster settings and applies them to every node |
+| `RebootDbCluster` | Restarts the cluster container; `instanceIds` must name nodes of the cluster |
+| `DeleteDbCluster` | Removes the cluster, its nodes, and its container |
+| `CreateDbParameterGroup` | Creates an InfluxDB v2, v3 Core or v3 Enterprise parameter group |
+| `GetDbParameterGroup` | Returns a parameter group and its parameters |
+| `ListDbParameterGroups` | Lists parameter groups with pagination |
+| `CreateDbBackup` | Takes an on-demand backup with `influx backup` inside the container |
+| `GetDbBackup` | Returns a backup and the resource configuration captured with it |
+| `ListDbBackups` | Lists backups, optionally filtered by `dbResourceId` |
+| `DeleteDbBackup` | Deletes a backup and its stored files |
+| `RestoreFromDbBackup` | Restores a backup into a new resource or into the existing one with `influx restore --full` |
+| `ListTagsForResource` | Lists tags on an instance, cluster, parameter group or backup |
+| `TagResource` | Adds tags, up to 200 per resource |
+| `UntagResource` | Removes tags by key |
+
+
+## Data plane
+
+- `CreateDbInstance` returns `CREATING`. Floci starts the configured image with
+ `DOCKER_INFLUXDB_INIT_MODE=setup` and moves the instance to `AVAILABLE` once `GET /health` answers. If the
+ container fails to start or never becomes healthy, the instance becomes `FAILED`.
+- The InfluxDB HTTP listener (container port 8086) is published on a host port from
+ `host-port-base`..`host-port-max`. The returned `port` is that published port, so `UpdateDbInstance` and
+ `UpdateDbCluster` store a requested `port` but the reachable port stays the published one.
+- `organization`, `bucket` and `username` are optional in the API but required by InfluxDB setup. When they
+ are omitted Floci uses `default`, `default` and `admin`.
+- The initial authorization parameters are stored in a Secrets Manager secret named
+ `READONLY-InfluxDB-auth-parameters-` with the keys `organization`, `bucket`, `username` and `password`.
+ `influxAuthParametersSecretArn` is returned once the resource leaves `CREATING`.
+- InfluxDB v2 parameter group values are passed to the container as the matching `INFLUXD_*` environment
+ variables. Assigning a different parameter group recreates the container on the same volumes.
+- Instance types, storage types and allocated storage are recorded but do not limit the container.
+- Data and the influx CLI configuration live on per-resource Docker volumes (or host directories when
+ `FLOCI_STORAGE_HOST_PERSISTENT_PATH` is an absolute path). After a Floci restart, persisted instances and
+ clusters get their containers back without running setup again.
+- When no Docker daemon is reachable, resources still reach `AVAILABLE` without a container so the
+ management API keeps working.
+
+## Clusters
+
+- An InfluxDB v2 read replica cluster (`MULTI_NODE_READ_REPLICAS`) has a `PRIMARY` and a `REPLICA` node. Both
+ nodes, the writer endpoint and the reader endpoint are served by one InfluxDB 2.x container: open source
+ InfluxDB has no read replica replication, so replication and failover are not emulated.
+- A cluster created without `password` has no container, because InfluxDB setup needs one.
+- InfluxDB 3 Core and Enterprise clusters are management records only. Nodes follow the parameter group
+ (`ingestQueryInstances`, `queryOnlyInstances`, `dedicatedCompactor`) and the default port is 8181, but no
+ InfluxDB 3 container is started.
+- Nodes can't be updated or deleted individually; use the cluster operations.
+
+## Backups
+
+- `CreateDbBackup` runs `influx backup` inside the container, copies the result to
+ `/timestream-influxdb/backups`, and moves the backup from `IN_PROGRESS` to `COMPLETED`
+ (or `FAILED`).
+- `RestoreFromDbBackup` with `NEW_RESOURCE` starts a new container and runs `influx restore --full`, so the
+ restored resource has the users, tokens, organizations and buckets of the source. `REPLACE_EXISTING`
+ restores into the existing container and requires `name` to match the existing resource.
+- `restoreToTime` is rejected with `ValidationException`. Point-in-time restore is only available for
+ continuous backups, and Floci models on-demand backups only, so accepting the parameter would silently
+ restore the on-demand contents instead of the requested moment.
+- `REPLACE_EXISTING` accepts no configuration overrides: `vpcSubnetIds`, `vpcSecurityGroupIds`,
+ `publiclyAccessible`, `logDeliveryConfiguration`, `maintenanceSchedule`, `tags`, `port`, `networkType`,
+ `deploymentType`, `dbBackupConfigurations` and `kmsKeyId` are rejected with `ValidationException` naming the
+ member, because restoring into an existing resource changes only its data.
+- `dbBackupConfigurations` are validated and stored; automated backups are not scheduled.
+
+## Configuration
+
+| Variable | Default | Description |
+| --- | --- | --- |
+| `FLOCI_SERVICES_TIMESTREAM_INFLUXDB_ENABLED` | `true` | Enable or disable the service |
+| `FLOCI_SERVICES_TIMESTREAM_INFLUXDB_MOCK` | `false` | `true` keeps metadata only, without containers |
+| `FLOCI_SERVICES_TIMESTREAM_INFLUXDB_DEFAULT_IMAGE` | `influxdb:2.7` | InfluxDB 2.x image for DB instances |
+| `FLOCI_SERVICES_TIMESTREAM_INFLUXDB_HOST_PORT_BASE` | `8086` | Lowest published host port |
+| `FLOCI_SERVICES_TIMESTREAM_INFLUXDB_HOST_PORT_MAX` | `8185` | Highest published host port |
+| `FLOCI_SERVICES_TIMESTREAM_INFLUXDB_READINESS_TIMEOUT_SECONDS` | `120` | Time to wait for the container health check |
+| `FLOCI_SERVICES_TIMESTREAM_INFLUXDB_DOCKER_NETWORK` | unset | Docker network for InfluxDB containers |
+
+## Example
+
+```bash
+export AWS_ENDPOINT_URL=http://localhost:4566
+
+id=$(aws timestream-influxdb create-db-instance \
+ --name metrics-db \
+ --username admin --password password123 \
+ --organization acme --bucket metrics \
+ --db-instance-type db.influx.medium --allocated-storage 20 \
+ --vpc-subnet-ids subnet-abc123 --vpc-security-group-ids sg-abc123 \
+ --query id --output text)
+
+aws timestream-influxdb get-db-instance --identifier "$id" \
+ --query "[status,endpoint,port]"
+
+influx config create --config-name floci --active \
+ --host-url "http://localhost:" --org acme --username-password admin:password123
+influx write --bucket metrics "cpu,host=a value=42"
+```
diff --git a/mkdocs.yml b/mkdocs.yml
index 20c9d7f9ef..a5fe8dce46 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -140,6 +140,7 @@ nav:
- MemoryDB: services/memorydb.md
- RDS: services/rds.md
- RDS Data API: services/rds-data.md
+ - Timestream for InfluxDB: services/timestream-influxdb.md
- MSK (Kafka): services/msk.md
- Amazon MQ: services/amazonmq.md
- Glue: services/glue.md
diff --git a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
index c2477f6c07..a215cde92b 100644
--- a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
+++ b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
@@ -741,6 +741,7 @@ public interface EmulatorConfig {
BcmDataExportsServiceConfig bcmDataExports();
OamServiceConfig oam();
BcmPricingCalculatorServiceConfig bcmPricingCalculator();
+ TimestreamInfluxDbServiceConfig timestreamInfluxdb();
ConfigServiceConfig configservice();
CloudTrailServiceConfig cloudtrail();
CloudControlServiceConfig cloudcontrol();
@@ -2075,6 +2076,34 @@ public interface EmulatorConfig {
boolean enabled();
}
+ interface TimestreamInfluxDbServiceConfig {
+ @WithDefault("true")
+ boolean enabled();
+
+ /** When true, DB instances and clusters reach AVAILABLE without a backing InfluxDB container. */
+ @WithDefault("false")
+ boolean mock();
+
+ /** InfluxDB 2.x image backing DB instances. Env: FLOCI_SERVICES_TIMESTREAM_INFLUXDB_DEFAULT_IMAGE */
+ @WithDefault("influxdb:2.7")
+ String defaultImage();
+
+ /** Lowest host port the InfluxDB HTTP listener (container port 8086) is published on. */
+ @WithDefault("8086")
+ int hostPortBase();
+
+ /** Highest host port the InfluxDB HTTP listener is published on. */
+ @WithDefault("8185")
+ int hostPortMax();
+
+ /** Seconds to wait for a started InfluxDB container to answer its health check. */
+ @WithDefault("120")
+ int readinessTimeoutSeconds();
+
+ /** Docker network to attach InfluxDB containers to. Empty uses the default network. */
+ Optional dockerNetwork();
+ }
+
interface BcmDataExportsServiceConfig {
@WithDefault("true")
boolean enabled();
diff --git a/src/main/java/io/github/hectorvent/floci/core/common/AwsJsonController.java b/src/main/java/io/github/hectorvent/floci/core/common/AwsJsonController.java
index d125ce5a64..9b39ae53cd 100644
--- a/src/main/java/io/github/hectorvent/floci/core/common/AwsJsonController.java
+++ b/src/main/java/io/github/hectorvent/floci/core/common/AwsJsonController.java
@@ -17,6 +17,7 @@ import io.github.hectorvent.floci.services.sns.SnsJsonHandler;
import io.github.hectorvent.floci.services.sqs.SqsJsonHandler;
import io.github.hectorvent.floci.services.stepfunctions.StepFunctionsJsonHandler;
import io.github.hectorvent.floci.services.swf.SwfJsonHandler;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.TimestreamInfluxDbJsonHandler;
import io.github.hectorvent.floci.services.verifiedpermissions.VerifiedPermissionsJsonHandler;
import jakarta.inject.Inject;
import jakarta.ws.rs.*;
@@ -55,6 +56,7 @@ public class AwsJsonController {
private final MarketplaceJsonHandler marketplaceJsonHandler;
private final VerifiedPermissionsJsonHandler verifiedPermissionsJsonHandler;
private final BcmPricingCalculatorJsonHandler bcmPricingCalculatorJsonHandler;
+ private final TimestreamInfluxDbJsonHandler timestreamInfluxDbJsonHandler;
@Inject
public AwsJsonController(ObjectMapper objectMapper, ResolvedServiceCatalog catalog,
@@ -69,7 +71,8 @@ public class AwsJsonController {
NetworkFirewallJsonHandler networkFirewallJsonHandler,
MarketplaceJsonHandler marketplaceJsonHandler,
VerifiedPermissionsJsonHandler verifiedPermissionsJsonHandler,
- BcmPricingCalculatorJsonHandler bcmPricingCalculatorJsonHandler) {
+ BcmPricingCalculatorJsonHandler bcmPricingCalculatorJsonHandler,
+ TimestreamInfluxDbJsonHandler timestreamInfluxDbJsonHandler) {
this.objectMapper = objectMapper;
this.strictBodyReader = objectMapper.reader().with(DeserializationFeature.FAIL_ON_TRAILING_TOKENS);
this.catalog = catalog;
@@ -86,6 +89,7 @@ public class AwsJsonController {
this.marketplaceJsonHandler = marketplaceJsonHandler;
this.verifiedPermissionsJsonHandler = verifiedPermissionsJsonHandler;
this.bcmPricingCalculatorJsonHandler = bcmPricingCalculatorJsonHandler;
+ this.timestreamInfluxDbJsonHandler = timestreamInfluxDbJsonHandler;
}
@POST
@@ -147,6 +151,7 @@ public class AwsJsonController {
case "marketplace" -> marketplaceJsonHandler.handle(action, request, region);
case "verifiedpermissions" -> verifiedPermissionsJsonHandler.handle(action, request, region);
case "bcm-pricing-calculator" -> bcmPricingCalculatorJsonHandler.handle(action, request, region);
+ case "timestream-influxdb" -> timestreamInfluxDbJsonHandler.handle(action, request, region);
default -> null;
};
// catalog.matchTarget is protocol-agnostic: a JSON 1.1 target
diff --git a/src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java b/src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java
index 60508da9cd..3d4f49f184 100644
--- a/src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java
+++ b/src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java
@@ -184,7 +184,7 @@ public class ResolvedServiceCatalog {
protocols(ServiceProtocol.QUERY),
Set.of(), Set.of("neptune"), Set.of(), Set.of()),
descriptor("docdb", "docdb", config.services().docdb().enabled(), true,
- "docdb", config.storage().mode(),
+ "docdb", config.storage().mode(),
5000L, AwsNamespaces.RDS, ServiceProtocol.QUERY,
protocols(ServiceProtocol.QUERY),
Set.of(), Set.of("docdb"), Set.of(), Set.of()),
@@ -583,6 +583,11 @@ public class ResolvedServiceCatalog {
"bcmpricingcalculator", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
protocols(ServiceProtocol.JSON),
Set.of("AWSBCMPricingCalculator."), Set.of("bcm-pricing-calculator"), Set.of(), Set.of()),
+ descriptor("timestream-influxdb", "timestreaminfluxdb",
+ config.services().timestreamInfluxdb().enabled(), true,
+ "timestreaminfluxdb", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
+ protocols(ServiceProtocol.JSON),
+ Set.of("AmazonTimestreamInfluxDB."), Set.of("timestream-influxdb"), Set.of(), Set.of()),
descriptor("bcm-data-exports", "bcmdataexports", config.services().bcmDataExports().enabled(), true,
"bcmdataexports", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
protocols(ServiceProtocol.JSON),
diff --git a/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java b/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java
index d4671a84fa..27376cb607 100644
--- a/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java
+++ b/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java
@@ -34,6 +34,7 @@ import io.github.hectorvent.floci.services.memorydb.container.MemoryDbContainerM
import io.github.hectorvent.floci.services.memorydb.proxy.MemoryDbProxyManager;
import io.github.hectorvent.floci.services.rds.container.RdsContainerManager;
import io.github.hectorvent.floci.services.rds.proxy.RdsProxyManager;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.TimestreamInfluxDbService;
import io.quarkus.runtime.Quarkus;
import io.quarkus.runtime.ShutdownDelayInitiatedEvent;
import io.quarkus.runtime.ShutdownEvent;
@@ -84,6 +85,7 @@ public class EmulatorLifecycle {
private final RabbitMqManager rabbitMqManager;
private final FlinkContainerManager flinkContainerManager;
private final RdsService rdsService;
+ private final TimestreamInfluxDbService timestreamInfluxDbService;
private final ElbV2Service elbV2Service;
private final ElbClassicService elbClassicService;
private final InitializationHooksRunner initializationHooksRunner;
@@ -118,6 +120,7 @@ public class EmulatorLifecycle {
RabbitMqManager rabbitMqManager,
FlinkContainerManager flinkContainerManager,
RdsService rdsService,
+ TimestreamInfluxDbService timestreamInfluxDbService,
ElbV2Service elbV2Service,
ElbClassicService elbClassicService,
InitializationHooksRunner initializationHooksRunner,
@@ -151,6 +154,7 @@ public class EmulatorLifecycle {
this.rabbitMqManager = rabbitMqManager;
this.flinkContainerManager = flinkContainerManager;
this.rdsService = rdsService;
+ this.timestreamInfluxDbService = timestreamInfluxDbService;
this.elbV2Service = elbV2Service;
this.elbClassicService = elbClassicService;
this.initializationHooksRunner = initializationHooksRunner;
@@ -207,6 +211,9 @@ public class EmulatorLifecycle {
dynamodbStreamsPoller.startPersistedPollers();
pipesService.startPersistedPollers();
rdsService.restorePersistedRuntime();
+ if (config.services().timestreamInfluxdb().enabled()) {
+ timestreamInfluxDbService.restorePersistedRuntime();
+ }
if (config.services().elasticache().enabled()) {
elastiCacheService.restorePersistedRuntime().exceptionally(ex -> {
LOG.warnv("ElastiCache cluster-mode restore failed: {0}", ex.getMessage());
diff --git a/src/main/java/io/github/hectorvent/floci/services/timestreaminfluxdb/TimestreamInfluxDbJsonHandler.java b/src/main/java/io/github/hectorvent/floci/services/timestreaminfluxdb/TimestreamInfluxDbJsonHandler.java
new file mode 100644
index 0000000000..c8808c4bf1
--- /dev/null
+++ b/src/main/java/io/github/hectorvent/floci/services/timestreaminfluxdb/TimestreamInfluxDbJsonHandler.java
@@ -0,0 +1,299 @@
+package io.github.hectorvent.floci.services.timestreaminfluxdb;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import io.github.hectorvent.floci.core.common.JsonErrorResponseUtils;
+import io.github.hectorvent.floci.core.common.PaginatedResult;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.TimestreamInfluxDbService.Reported;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.TimestreamInfluxDbService.RestoreResult;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.model.DbBackup;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.model.DbCluster;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.model.DbInstance;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.model.DbParameterGroup;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.core.Response;
+
+import java.time.Instant;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+
+@ApplicationScoped
+public class TimestreamInfluxDbJsonHandler {
+
+ private final TimestreamInfluxDbService service;
+ private final ObjectMapper objectMapper;
+
+ @Inject
+ public TimestreamInfluxDbJsonHandler(TimestreamInfluxDbService service, ObjectMapper objectMapper) {
+ this.service = service;
+ this.objectMapper = objectMapper;
+ }
+
+ public Response handle(String action, JsonNode request, String region) {
+ return switch (action) {
+ case "CreateDbInstance" -> ok(reportedInstance(service.createDbInstance(request, region)));
+ case "GetDbInstance" -> ok(instanceNode(service.getDbInstance(request, region), null));
+ case "ListDbInstances" -> ok(page(service.listDbInstances(request, region), this::instanceSummary));
+ case "UpdateDbInstance" -> ok(reportedInstance(service.updateDbInstance(request, region)));
+ case "RebootDbInstance" -> ok(reportedInstance(service.rebootDbInstance(request, region)));
+ case "DeleteDbInstance" -> ok(reportedInstance(service.deleteDbInstance(request, region)));
+ case "CreateDbCluster" -> ok(clusterStatus(service.createDbCluster(request, region)));
+ case "GetDbCluster" -> ok(clusterNode(service.getDbCluster(request, region)));
+ case "ListDbClusters" -> ok(page(service.listDbClusters(request, region), this::clusterSummary));
+ case "ListDbInstancesForCluster" -> ok(page(service.listDbInstancesForCluster(request, region),
+ this::clusterMemberSummary));
+ case "UpdateDbCluster" -> ok(clusterStatusOnly(service.updateDbCluster(request, region)));
+ case "RebootDbCluster" -> ok(clusterStatusOnly(service.rebootDbCluster(request, region)));
+ case "DeleteDbCluster" -> ok(clusterStatusOnly(service.deleteDbCluster(request, region)));
+ case "CreateDbParameterGroup" -> ok(parameterGroupNode(service.createDbParameterGroup(request, region)));
+ case "GetDbParameterGroup" -> ok(parameterGroupNode(service.getDbParameterGroup(request, region)));
+ case "ListDbParameterGroups" -> ok(page(service.listDbParameterGroups(request, region),
+ this::parameterGroupSummary));
+ case "CreateDbBackup" -> ok(reportedBackup(service.createDbBackup(request, region)));
+ case "GetDbBackup" -> ok(backupNode(service.getDbBackup(request, region), null));
+ case "ListDbBackups" -> ok(page(service.listDbBackups(request, region), this::backupSummary));
+ case "DeleteDbBackup" -> ok(reportedBackup(service.deleteDbBackup(request, region)));
+ case "RestoreFromDbBackup" -> ok(restoreNode(service.restoreFromDbBackup(request, region)));
+ case "ListTagsForResource" -> ok(tagsNode(service.listTagsForResource(request)));
+ case "TagResource" -> {
+ service.tagResource(request);
+ yield ok(objectMapper.createObjectNode());
+ }
+ case "UntagResource" -> {
+ service.untagResource(request);
+ yield ok(objectMapper.createObjectNode());
+ }
+ default -> JsonErrorResponseUtils.createUnknownOperationErrorResponse("AmazonTimestreamInfluxDB." + action);
+ };
+ }
+
+ private ObjectNode reportedInstance(Reported reported) {
+ return instanceNode(reported.resource(), reported.status());
+ }
+
+ private ObjectNode reportedBackup(Reported reported) {
+ return backupNode(reported.resource(), reported.status());
+ }
+
+ private ObjectNode instanceNode(DbInstance instance, String reportedStatus) {
+ String status = reportedStatus != null ? reportedStatus : instance.getStatus();
+ ObjectNode node = instanceSummary(instance);
+ node.put("status", status);
+ putStrings(node, "vpcSubnetIds", instance.getVpcSubnetIds());
+ put(node, "publiclyAccessible", instance.getPubliclyAccessible());
+ putStrings(node, "vpcSecurityGroupIds", instance.getVpcSecurityGroupIds());
+ put(node, "dbParameterGroupIdentifier", instance.getDbParameterGroupIdentifier());
+ put(node, "availabilityZone", instance.getAvailabilityZone());
+ put(node, "secondaryAvailabilityZone", instance.getSecondaryAvailabilityZone());
+ putJson(node, "logDeliveryConfiguration", instance.getLogDeliveryConfiguration());
+ if (!"CREATING".equals(status)) {
+ put(node, "influxAuthParametersSecretArn", instance.getInfluxAuthParametersSecretArn());
+ }
+ put(node, "dbClusterId", instance.getDbClusterId());
+ put(node, "instanceMode", instance.getInstanceMode());
+ if (instance.getDbClusterId() != null) {
+ putStrings(node, "instanceModes", instance.getInstanceModes());
+ }
+ putJson(node, "maintenanceSchedule", instance.getMaintenanceSchedule());
+ putJson(node, "dbBackupConfigurations", instance.getDbBackupConfigurations());
+ put(node, "kmsKeyId", instance.getKmsKeyId());
+ return node;
+ }
+
+ private ObjectNode instanceSummary(DbInstance instance) {
+ ObjectNode node = objectMapper.createObjectNode();
+ node.put("id", instance.getId());
+ node.put("name", instance.getName());
+ node.put("arn", instance.getArn());
+ put(node, "status", instance.getStatus());
+ put(node, "endpoint", instance.getEndpoint());
+ put(node, "port", instance.getPort());
+ put(node, "networkType", instance.getNetworkType());
+ put(node, "dbInstanceType", instance.getDbInstanceType());
+ put(node, "dbStorageType", instance.getDbStorageType());
+ put(node, "allocatedStorage", instance.getAllocatedStorage());
+ put(node, "deploymentType", instance.getDeploymentType());
+ return node;
+ }
+
+ private ObjectNode clusterMemberSummary(DbInstance instance) {
+ ObjectNode node = instanceSummary(instance);
+ put(node, "instanceMode", instance.getInstanceMode());
+ putStrings(node, "instanceModes", instance.getInstanceModes());
+ return node;
+ }
+
+ private ObjectNode clusterStatus(Reported reported) {
+ ObjectNode node = objectMapper.createObjectNode();
+ node.put("dbClusterId", reported.resource().getId());
+ node.put("dbClusterStatus", reported.status());
+ return node;
+ }
+
+ private ObjectNode clusterStatusOnly(Reported reported) {
+ ObjectNode node = objectMapper.createObjectNode();
+ node.put("dbClusterStatus", reported.status());
+ return node;
+ }
+
+ private ObjectNode clusterNode(DbCluster cluster) {
+ ObjectNode node = clusterSummary(cluster);
+ put(node, "publiclyAccessible", cluster.getPubliclyAccessible());
+ put(node, "dbParameterGroupIdentifier", cluster.getDbParameterGroupIdentifier());
+ putJson(node, "logDeliveryConfiguration", cluster.getLogDeliveryConfiguration());
+ putJson(node, "maintenanceSchedule", cluster.getMaintenanceSchedule());
+ if (!"CREATING".equals(cluster.getStatus())) {
+ put(node, "influxAuthParametersSecretArn", cluster.getInfluxAuthParametersSecretArn());
+ }
+ putStrings(node, "vpcSubnetIds", cluster.getVpcSubnetIds());
+ putStrings(node, "vpcSecurityGroupIds", cluster.getVpcSecurityGroupIds());
+ put(node, "failoverMode", cluster.getFailoverMode());
+ putJson(node, "clusterConfiguration", cluster.getClusterConfiguration());
+ putJson(node, "dbBackupConfigurations", cluster.getDbBackupConfigurations());
+ put(node, "kmsKeyId", cluster.getKmsKeyId());
+ return node;
+ }
+
+ private ObjectNode clusterSummary(DbCluster cluster) {
+ ObjectNode node = objectMapper.createObjectNode();
+ node.put("id", cluster.getId());
+ node.put("name", cluster.getName());
+ node.put("arn", cluster.getArn());
+ put(node, "status", cluster.getStatus());
+ put(node, "endpoint", cluster.getEndpoint());
+ put(node, "readerEndpoint", cluster.getReaderEndpoint());
+ put(node, "port", cluster.getPort());
+ put(node, "deploymentType", cluster.getDeploymentType());
+ put(node, "dbInstanceType", cluster.getDbInstanceType());
+ put(node, "networkType", cluster.getNetworkType());
+ put(node, "dbStorageType", cluster.getDbStorageType());
+ put(node, "allocatedStorage", cluster.getAllocatedStorage());
+ put(node, "engineType", cluster.getEngineType());
+ return node;
+ }
+
+ private ObjectNode parameterGroupNode(DbParameterGroup group) {
+ ObjectNode node = parameterGroupSummary(group);
+ putJson(node, "parameters", group.getParameters());
+ return node;
+ }
+
+ private ObjectNode parameterGroupSummary(DbParameterGroup group) {
+ ObjectNode node = objectMapper.createObjectNode();
+ node.put("id", group.getId());
+ node.put("name", group.getName());
+ node.put("arn", group.getArn());
+ put(node, "description", group.getDescription());
+ return node;
+ }
+
+ private ObjectNode backupNode(DbBackup backup, String reportedStatus) {
+ ObjectNode node = backupSummary(backup);
+ if (reportedStatus != null) {
+ node.put("status", reportedStatus);
+ }
+ putJson(node, "clusterConfiguration", backup.getClusterConfiguration());
+ put(node, "dbParameterGroupId", backup.getDbParameterGroupId());
+ put(node, "dbInstanceType", backup.getDbInstanceType());
+ putJson(node, "logDeliveryConfiguration", backup.getLogDeliveryConfiguration());
+ put(node, "failoverMode", backup.getFailoverMode());
+ put(node, "dbStorageType", backup.getDbStorageType());
+ put(node, "allocatedStorage", backup.getAllocatedStorage());
+ putStrings(node, "vpcSubnetIds", backup.getVpcSubnetIds());
+ putStrings(node, "vpcSecurityGroupIds", backup.getVpcSecurityGroupIds());
+ put(node, "publiclyAccessible", backup.getPubliclyAccessible());
+ put(node, "port", backup.getPort());
+ put(node, "networkType", backup.getNetworkType());
+ put(node, "influxAuthParametersSecretArn", backup.getInfluxAuthParametersSecretArn());
+ putJson(node, "maintenanceSchedule", backup.getMaintenanceSchedule());
+ return node;
+ }
+
+ private ObjectNode backupSummary(DbBackup backup) {
+ ObjectNode node = objectMapper.createObjectNode();
+ node.put("id", backup.getId());
+ put(node, "name", backup.getName());
+ node.put("arn", backup.getArn());
+ put(node, "status", backup.getStatus());
+ if (backup.getCreatedAt() != null) {
+ node.put("createdAt", epochSeconds(backup.getCreatedAt()));
+ }
+ put(node, "expiresAfter", backup.getExpiresAfter());
+ put(node, "dbResourceId", backup.getDbResourceId());
+ put(node, "type", backup.getType());
+ put(node, "engineType", backup.getEngineType());
+ put(node, "deploymentType", backup.getDeploymentType());
+ put(node, "kmsKeyId", backup.getKmsKeyId());
+ return node;
+ }
+
+ private ObjectNode restoreNode(RestoreResult result) {
+ ObjectNode node = objectMapper.createObjectNode();
+ node.put("restoredDbResourceId", result.restoredDbResourceId());
+ node.put("restoreStatus", "RESTORING");
+ node.put("resourceType", result.resourceType());
+ put(node, "engineType", result.engineType());
+ put(node, "deploymentType", result.deploymentType());
+ return node;
+ }
+
+ private ObjectNode tagsNode(Map tags) {
+ ObjectNode node = objectMapper.createObjectNode();
+ ObjectNode tagNode = node.putObject("tags");
+ tags.forEach(tagNode::put);
+ return node;
+ }
+
+ private ObjectNode page(PaginatedResult result, Function mapper) {
+ ObjectNode node = objectMapper.createObjectNode();
+ ArrayNode items = node.putArray("items");
+ for (T item : result.items()) {
+ items.add(mapper.apply(item));
+ }
+ put(node, "nextToken", result.nextToken());
+ return node;
+ }
+
+ private static Response ok(ObjectNode node) {
+ return Response.ok(node).build();
+ }
+
+ private static void put(ObjectNode node, String field, String value) {
+ if (value != null) {
+ node.put(field, value);
+ }
+ }
+
+ private static void put(ObjectNode node, String field, Integer value) {
+ if (value != null) {
+ node.put(field, value);
+ }
+ }
+
+ private static void put(ObjectNode node, String field, Boolean value) {
+ if (value != null) {
+ node.put(field, value);
+ }
+ }
+
+ private static void putJson(ObjectNode node, String field, JsonNode value) {
+ if (value != null && !value.isNull()) {
+ node.set(field, value);
+ }
+ }
+
+ private static void putStrings(ObjectNode node, String field, List values) {
+ if (values != null && !values.isEmpty()) {
+ ArrayNode array = node.putArray(field);
+ values.forEach(array::add);
+ }
+ }
+
+ private static double epochSeconds(Instant instant) {
+ return instant.getEpochSecond() + instant.getNano() / 1_000_000_000.0;
+ }
+}
diff --git a/src/main/java/io/github/hectorvent/floci/services/timestreaminfluxdb/TimestreamInfluxDbService.java b/src/main/java/io/github/hectorvent/floci/services/timestreaminfluxdb/TimestreamInfluxDbService.java
new file mode 100644
index 0000000000..056e354b6d
--- /dev/null
+++ b/src/main/java/io/github/hectorvent/floci/services/timestreaminfluxdb/TimestreamInfluxDbService.java
@@ -0,0 +1,1328 @@
+package io.github.hectorvent.floci.services.timestreaminfluxdb;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import io.github.hectorvent.floci.config.EmulatorConfig;
+import io.github.hectorvent.floci.core.common.AwsException;
+import io.github.hectorvent.floci.core.common.PaginatedResult;
+import io.github.hectorvent.floci.core.common.Pagination;
+import io.github.hectorvent.floci.core.common.RegionResolver;
+import io.github.hectorvent.floci.core.common.Resettable;
+import io.github.hectorvent.floci.core.storage.AccountAwareStorageBackend;
+import io.github.hectorvent.floci.core.storage.StorageFactory;
+import io.github.hectorvent.floci.services.secretsmanager.SecretsManagerService;
+import io.github.hectorvent.floci.services.secretsmanager.model.Secret;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.container.TimestreamInfluxDbContainerManager;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.container.TimestreamInfluxDbContainerManager.InfluxDbEndpoint;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.container.TimestreamInfluxDbContainerManager.InfluxDbSetup;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.model.DbBackup;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.model.DbCluster;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.model.DbInstance;
+import io.github.hectorvent.floci.services.timestreaminfluxdb.model.DbParameterGroup;
+import jakarta.annotation.PreDestroy;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import org.jboss.logging.Logger;
+
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.ZoneOffset;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.regex.Matcher;
+
+import static io.github.hectorvent.floci.services.timestreaminfluxdb.TimestreamInfluxDbValidation.conflict;
+import static io.github.hectorvent.floci.services.timestreaminfluxdb.TimestreamInfluxDbValidation.notFound;
+import static io.github.hectorvent.floci.services.timestreaminfluxdb.TimestreamInfluxDbValidation.validation;
+
+@ApplicationScoped
+public class TimestreamInfluxDbService implements Resettable {
+
+ static final String ENGINE_V2 = "INFLUXDB_V2";
+ static final String ENGINE_V3_CORE = "INFLUXDB_V3_CORE";
+ static final String ENGINE_V3_ENTERPRISE = "INFLUXDB_V3_ENTERPRISE";
+ static final String DB_INSTANCE = "DB_INSTANCE";
+ static final String DB_CLUSTER = "DB_CLUSTER";
+ static final String DB_PARAMETER_GROUP = "DB_PARAMETER_GROUP";
+ static final String DB_BACKUP = "DB_BACKUP";
+ static final String AVAILABLE = "AVAILABLE";
+ static final String LOCAL_ENDPOINT = "localhost";
+
+ private static final Logger LOG = Logger.getLogger(TimestreamInfluxDbService.class);
+ private static final String ARN_SERVICE = "timestream-influxdb";
+ private static final String DEFAULT_USERNAME = "admin";
+ private static final String DEFAULT_ORGANIZATION = "default";
+ private static final String DEFAULT_BUCKET = "default";
+ private static final int V2_PORT = 8086;
+ private static final int V3_PORT = 8181;
+ private static final int MAX_TAGS = 200;
+ private static final int MAX_PAGE = 100;
+ private static final List REPLACE_EXISTING_REJECTED_MEMBERS = List.of(
+ "vpcSubnetIds", "vpcSecurityGroupIds", "publiclyAccessible", "logDeliveryConfiguration",
+ "maintenanceSchedule", "tags", "port", "networkType", "deploymentType", "dbBackupConfigurations",
+ "kmsKeyId");
+
+ public record Reported(T resource, String status) {
+ }
+
+ public record RestoreResult(String restoredDbResourceId, String resourceType, String engineType,
+ String deploymentType) {
+ }
+
+ private final AccountAwareStorageBackend instances;
+ private final AccountAwareStorageBackend clusters;
+ private final AccountAwareStorageBackend parameterGroups;
+ private final AccountAwareStorageBackend backups;
+ private final RegionResolver regionResolver;
+ private final SecretsManagerService secretsManagerService;
+ private final ObjectMapper objectMapper;
+ private final TimestreamInfluxDbContainerManager containerManager;
+ private final boolean mock;
+ private final Executor executor;
+
+ @Inject
+ public TimestreamInfluxDbService(StorageFactory storageFactory, RegionResolver regionResolver,
+ SecretsManagerService secretsManagerService, ObjectMapper objectMapper,
+ EmulatorConfig config, TimestreamInfluxDbContainerManager containerManager) {
+ this(storageFactory.create("timestreaminfluxdb", "timestream-influxdb-instances.json",
+ new TypeReference