diff --git a/Dockerfile b/Dockerfile
index 4073122b82..1fa8020f2b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -22,10 +22,10 @@ VOLUME /app/data
EXPOSE 4566 6379-6399
HEALTHCHECK --interval=5s --timeout=3s --retries=5 \
- CMD wget -q --spider http://localhost:4566/_floci/health || exit 1
+ CMD bash -c 'echo -e "GET /_floci/health HTTP/1.0\r\nHost: localhost\r\n\r\n" > /dev/tcp/localhost/4566' || exit 1
ARG VERSION=latest
ENV FLOCI_VERSION=${VERSION}
ENV FLOCI_STORAGE_PERSISTENT_PATH=/app/data
-ENTRYPOINT ["java", "-jar", "quarkus-app/quarkus-run.jar"]
+ENTRYPOINT ["java", "--enable-native-access=ALL-UNNAMED", "-jar", "quarkus-app/quarkus-run.jar"]
diff --git a/Dockerfile.native b/Dockerfile.native
index 815c105154..fa65c91c20 100644
--- a/Dockerfile.native
+++ b/Dockerfile.native
@@ -18,6 +18,7 @@ FROM quay.io/quarkus/quarkus-micro-image:2.0
USER root
WORKDIR /app
+
RUN mkdir -p /app/data \
&& chown -R 1001:root /app \
&& chmod -R g+rwX /app
@@ -33,6 +34,7 @@ ENV FLOCI_VERSION=${VERSION}
ENV FLOCI_STORAGE_PERSISTENT_PATH=/app/data
COPY --from=build /app/target/*-runner /app/application
+
RUN chmod +x /app/application
USER 1001
diff --git a/README.md b/README.md
index 2d4d1910cc..9ad81d76dd 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,9 @@
| ElastiCache (Redis + IAM auth) | ✅ | ❌ |
| RDS (PostgreSQL + MySQL + IAM auth) | ✅ | ❌ |
| MSK (Kafka + Redpanda) | ✅ | ❌ |
+| Athena (query state machine, mock mode) | ✅ | ❌ |
+| Glue Data Catalog | ✅ | ❌ |
+| Data Firehose (NDJSON delivery) | ✅ | ❌ |
| S3 Object Lock (COMPLIANCE / GOVERNANCE) | ✅ | ⚠️ Partial |
| DynamoDB Streams | ✅ | ⚠️ Partial |
| IAM (users, roles, policies, groups) | ✅ | ⚠️ Partial |
@@ -117,6 +120,9 @@ flowchart LR
| **ElastiCache** | **Real Docker containers** | Redis / Valkey, IAM auth, SigV4 validation |
| **RDS** | **Real Docker containers** | PostgreSQL & MySQL, IAM auth, JDBC-compatible |
| **MSK** | **Real Docker containers** | Kafka compatible via Redpanda orchestration |
+| **Athena** | In-process | Query state machine (mock mode — queries accepted, results empty) |
+| **Glue** | In-process | Data Catalog for metadata management |
+| **Data Firehose** | In-process | Streaming data delivery; records flushed as NDJSON to S3 |
| **ECS** | **Real Docker containers** | Clusters, task definitions, tasks, services, capacity providers, task sets |
| **EC2** | In-process | VPCs, subnets, security groups, instances, AMIs, key pairs, internet gateways, route tables, Elastic IPs, tags |
| **ACM** | In-process | Certificate issuance, validation lifecycle |
@@ -131,7 +137,7 @@ flowchart LR
>
> For per-service operation counts and endpoint protocols, see the [Services Overview](https://floci.io/floci/services/) in the documentation site.
-**30 AWS services supported.**
+**33 AWS services supported.**
## Quick Start
@@ -232,7 +238,7 @@ Available compatibility test modules:
| Tag | Description |
|---|---|
| `latest` | Native image — sub-second startup **(recommended)** |
-| `latest-jvm` | JVM image — broadest platform compatibility |
+| `latest-jvm` | JVM image |
| `x.y.z` / `x.y.z-jvm` | Pinned releases |
## Configuration
diff --git a/compatibility-tests/sdk-test-java/pom.xml b/compatibility-tests/sdk-test-java/pom.xml
index 30bd8d9416..81a2528997 100644
--- a/compatibility-tests/sdk-test-java/pom.xml
+++ b/compatibility-tests/sdk-test-java/pom.xml
@@ -110,6 +110,18 @@
software.amazon.awssdk
kafka
+
+ software.amazon.awssdk
+ athena
+
+
+ software.amazon.awssdk
+ glue
+
+
+ software.amazon.awssdk
+ firehose
+
software.amazon.awssdk
ec2
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 47471de2a0..0ce0f439d2 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
@@ -27,6 +27,9 @@ import software.amazon.awssdk.services.sqs.SqsClient;
import software.amazon.awssdk.services.ssm.SsmClient;
import software.amazon.awssdk.services.sts.StsClient;
import software.amazon.awssdk.services.kafka.KafkaClient;
+import software.amazon.awssdk.services.athena.AthenaClient;
+import software.amazon.awssdk.services.glue.GlueClient;
+import software.amazon.awssdk.services.firehose.FirehoseClient;
import software.amazon.awssdk.services.apigateway.ApiGatewayClient;
import software.amazon.awssdk.services.apigatewayv2.ApiGatewayV2Client;
import software.amazon.awssdk.services.elasticache.ElastiCacheClient;
@@ -283,6 +286,30 @@ public final class TestFixtures {
.build();
}
+ public static AthenaClient athenaClient() {
+ return AthenaClient.builder()
+ .endpointOverride(ENDPOINT)
+ .region(REGION)
+ .credentialsProvider(CREDENTIALS)
+ .build();
+ }
+
+ public static GlueClient glueClient() {
+ return GlueClient.builder()
+ .endpointOverride(ENDPOINT)
+ .region(REGION)
+ .credentialsProvider(CREDENTIALS)
+ .build();
+ }
+
+ public static FirehoseClient firehoseClient() {
+ return FirehoseClient.builder()
+ .endpointOverride(ENDPOINT)
+ .region(REGION)
+ .credentialsProvider(CREDENTIALS)
+ .build();
+ }
+
public static KmsClient kmsClient() {
return KmsClient.builder()
.endpointOverride(ENDPOINT)
diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DataLakeTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DataLakeTest.java
new file mode 100644
index 0000000000..02682e9dc2
--- /dev/null
+++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/DataLakeTest.java
@@ -0,0 +1,114 @@
+package com.floci.test;
+
+import org.junit.jupiter.api.*;
+import software.amazon.awssdk.core.SdkBytes;
+import software.amazon.awssdk.services.athena.AthenaClient;
+import software.amazon.awssdk.services.athena.model.*;
+import software.amazon.awssdk.services.firehose.FirehoseClient;
+import software.amazon.awssdk.services.firehose.model.PutRecordRequest;
+import software.amazon.awssdk.services.firehose.model.Record;
+import software.amazon.awssdk.services.glue.GlueClient;
+import software.amazon.awssdk.services.glue.model.*;
+
+import java.nio.charset.StandardCharsets;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@DisplayName("Data Lake (Athena + Glue + Firehose)")
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+class DataLakeTest {
+
+ private static AthenaClient athena;
+ private static GlueClient glue;
+ private static FirehoseClient firehose;
+
+ private static final String DB_NAME = TestFixtures.uniqueName("test_db");
+ private static final String TABLE_NAME = "orders";
+ private static final String STREAM_NAME = TestFixtures.uniqueName("orders_stream");
+
+ @BeforeAll
+ static void setup() {
+ athena = TestFixtures.athenaClient();
+ glue = TestFixtures.glueClient();
+ firehose = TestFixtures.firehoseClient();
+ }
+
+ @Test
+ @org.junit.jupiter.api.Order(1)
+ void setupInfrastructure() {
+ // 1. Glue Database
+ glue.createDatabase(CreateDatabaseRequest.builder()
+ .databaseInput(DatabaseInput.builder().name(DB_NAME).build())
+ .build());
+
+ // 2. Glue Table
+ glue.createTable(CreateTableRequest.builder()
+ .databaseName(DB_NAME)
+ .tableInput(TableInput.builder()
+ .name(TABLE_NAME)
+ .storageDescriptor(StorageDescriptor.builder()
+ .location("s3://floci-firehose-results/" + STREAM_NAME + "/")
+ .inputFormat("Parquet")
+ .columns(
+ software.amazon.awssdk.services.glue.model.Column.builder().name("id").type("int").build(),
+ software.amazon.awssdk.services.glue.model.Column.builder().name("amount").type("double").build()
+ )
+ .build())
+ .build())
+ .build());
+
+ // 3. Firehose Stream
+ firehose.createDeliveryStream(software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamRequest.builder()
+ .deliveryStreamName(STREAM_NAME)
+ .build());
+ }
+
+ @Test
+ @org.junit.jupiter.api.Order(2)
+ void ingestAndQuery() throws Exception {
+ // Ingest data
+ for (int i = 1; i <= 5; i++) {
+ String json = String.format("{\"id\": %d, \"amount\": %.2f}", i, i * 10.0);
+ firehose.putRecord(PutRecordRequest.builder()
+ .deliveryStreamName(STREAM_NAME)
+ .record(Record.builder().data(SdkBytes.fromString(json, StandardCharsets.UTF_8)).build())
+ .build());
+ }
+
+ // Athena Query
+ StartQueryExecutionResponse startResp = athena.startQueryExecution(StartQueryExecutionRequest.builder()
+ .queryString("SELECT sum(amount) as total FROM " + TABLE_NAME)
+ .queryExecutionContext(QueryExecutionContext.builder().database(DB_NAME).build())
+ .build());
+
+ String queryId = startResp.queryExecutionId();
+
+ // Wait for query
+ int attempts = 0;
+ QueryExecutionStatus status = null;
+ while (attempts < 30) {
+ GetQueryExecutionResponse getResp = athena.getQueryExecution(GetQueryExecutionRequest.builder()
+ .queryExecutionId(queryId)
+ .build());
+ status = getResp.queryExecution().status();
+ if (status.state() == QueryExecutionState.SUCCEEDED) break;
+ if (status.state() == QueryExecutionState.FAILED) {
+ Assertions.fail("Query failed: " + status.stateChangeReason());
+ }
+ Thread.sleep(1000);
+ attempts++;
+ }
+
+ assertThat(status.state()).isEqualTo(QueryExecutionState.SUCCEEDED);
+
+ // Get Results — Athena is in mock mode; query execution is accepted and the state
+ // machine runs correctly, but results are empty until the DuckDB sidecar is integrated.
+ GetQueryResultsResponse results = athena.getQueryResults(GetQueryResultsRequest.builder()
+ .queryExecutionId(queryId)
+ .build());
+
+ assertThat(results.resultSet()).isNotNull();
+ assertThat(results.resultSet().rows()).isEmpty();
+ }
+}
diff --git a/docs/services/athena.md b/docs/services/athena.md
new file mode 100644
index 0000000000..e9ca2855a8
--- /dev/null
+++ b/docs/services/athena.md
@@ -0,0 +1,44 @@
+# Athena
+
+**Protocol:** JSON 1.1
+**Endpoint:** `http://localhost:4566/`
+
+Floci emulates Amazon Athena's control-plane and query state machine. Query execution is in **mock mode** — SQL is accepted and queries immediately transition to `SUCCEEDED` with an empty result set. A dedicated query engine (DuckDB in a sidecar container) will be integrated in a future release.
+
+## Supported Actions
+
+| Action | Description |
+|---|---|
+| `StartQueryExecution` | Accepts a SQL query; transitions it to SUCCEEDED immediately |
+| `GetQueryExecution` | Returns query status (QUEUED, RUNNING, SUCCEEDED, FAILED) |
+| `GetQueryResults` | Returns the result set for a completed query (empty in mock mode) |
+| `ListQueryExecutions` | Returns a list of past query executions |
+| `StopQueryExecution` | Cancels a running query |
+| `CreateWorkGroup` | Creates a new workgroup |
+| `GetWorkGroup` | Returns information about a workgroup |
+| `ListWorkGroups` | Lists all workgroups |
+
+## How it works
+
+1. **State machine**: Floci implements the full Athena execution state lifecycle (QUEUED → RUNNING → SUCCEEDED/FAILED).
+2. **Mock execution**: Queries are accepted but not executed — results are always empty. This allows SDK-based workflow code to be tested end-to-end.
+
+## Example
+
+```bash
+export AWS_ENDPOINT_URL=http://localhost:4566
+
+# Start a query
+QUERY_ID=$(aws athena start-query-execution \
+ --query-string "SELECT count(*) FROM my_table" \
+ --query-execution-context Database=my_db \
+ --query 'QueryExecutionId' \
+ --output text \
+ --endpoint-url $AWS_ENDPOINT_URL)
+
+# Check status
+aws athena get-query-execution --query-execution-id $QUERY_ID --endpoint-url $AWS_ENDPOINT_URL
+
+# Get results (empty in mock mode)
+aws athena get-query-results --query-execution-id $QUERY_ID --endpoint-url $AWS_ENDPOINT_URL
+```
diff --git a/docs/services/firehose.md b/docs/services/firehose.md
new file mode 100644
index 0000000000..67d511ba81
--- /dev/null
+++ b/docs/services/firehose.md
@@ -0,0 +1,38 @@
+# Data Firehose
+
+**Protocol:** JSON 1.1
+**Endpoint:** `http://localhost:4566/`
+
+Floci emulates Amazon Data Firehose for streaming data ingestion and delivery to S3.
+
+## Supported Actions
+
+| Action | Description |
+|---|---|
+| `CreateDeliveryStream` | Creates a new delivery stream |
+| `DescribeDeliveryStream` | Returns metadata about a stream |
+| `ListDeliveryStreams` | Lists all delivery streams |
+| `DeleteDeliveryStream` | Deletes a delivery stream |
+| `PutRecord` | Writes a single data record to the stream |
+| `PutRecordBatch` | Writes multiple data records to the stream |
+
+## How it works
+
+1. **Buffering**: Incoming records are buffered in memory.
+2. **Automatic Flush**: Floci automatically flushes the buffer to S3 after every 5 records for immediate local feedback.
+3. **Format**: Records are flushed as raw NDJSON (newline-delimited JSON) to the `floci-firehose-results` bucket.
+
+## Example
+
+```bash
+export AWS_ENDPOINT_URL=http://localhost:4566
+
+# Create a stream
+aws firehose create-delivery-stream --delivery-stream-name my-stream --endpoint-url $AWS_ENDPOINT_URL
+
+# Put a record
+aws firehose put-record \
+ --delivery-stream-name my-stream \
+ --record '{"Data": "{\"id\": 1, \"amount\": 10.5}"}' \
+ --endpoint-url $AWS_ENDPOINT_URL
+```
diff --git a/docs/services/glue.md b/docs/services/glue.md
new file mode 100644
index 0000000000..51209e7354
--- /dev/null
+++ b/docs/services/glue.md
@@ -0,0 +1,46 @@
+# Glue
+
+**Protocol:** JSON 1.1
+**Endpoint:** `http://localhost:4566/`
+
+Floci emulates the AWS Glue Data Catalog, allowing you to manage metadata for your Data Lake locally.
+
+## Supported Actions
+
+### Databases
+`CreateDatabase` · `GetDatabase` · `GetDatabases` · `DeleteDatabase` · `UpdateDatabase`
+
+### Tables
+`CreateTable` · `GetTable` · `GetTables` · `DeleteTable` · `UpdateTable`
+
+### Partitions
+`CreatePartition` · `BatchCreatePartition` · `GetPartition` · `GetPartitions` · `DeletePartition`
+
+## Integration with Athena
+
+The Glue Data Catalog is automatically used by **Athena** to resolve table names to S3 locations and formats. When you define a table in Glue, Athena will know how to query the underlying S3 objects.
+
+## Example
+
+```bash
+export AWS_ENDPOINT_URL=http://localhost:4566
+
+# Create a database
+aws glue create-database --database-input '{"Name": "my_db"}' --endpoint-url $AWS_ENDPOINT_URL
+
+# Create a table
+aws glue create-table \
+ --database-name my_db \
+ --table-input '{
+ "Name": "orders",
+ "StorageDescriptor": {
+ "Location": "s3://my-bucket/orders/",
+ "InputFormat": "Parquet",
+ "Columns": [
+ {"Name": "id", "Type": "int"},
+ {"Name": "amount", "Type": "double"}
+ ]
+ }
+ }' \
+ --endpoint-url $AWS_ENDPOINT_URL
+```
diff --git a/mkdocs.yml b/mkdocs.yml
index f71ae8870d..07de1a9e37 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -86,6 +86,9 @@ nav:
- ElastiCache: services/elasticache.md
- RDS: services/rds.md
- MSK (Kafka): services/msk.md
+ - Glue: services/glue.md
+ - Athena: services/athena.md
+ - Data Firehose: services/firehose.md
- EventBridge: services/eventbridge.md
- EventBridge Scheduler: services/scheduler.md
- CloudWatch: services/cloudwatch.md
diff --git a/pom.xml b/pom.xml
index 8a66f9d481..5b555a9e6d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,10 +40,9 @@
- io.quarkus
- quarkus-rest-jackson
+ io.quarkus
+ quarkus-rest-jackson
-
io.quarkus
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 c8c381c3dc..d7eaa6990a 100644
--- a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
+++ b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
@@ -216,11 +216,14 @@ public interface EmulatorConfig {
SecretsManagerServiceConfig secretsmanager();
ApiGatewayV2ServiceConfig apigatewayv2();
KinesisServiceConfig kinesis();
+ FirehoseServiceConfig firehose();
KmsServiceConfig kms();
CognitoServiceConfig cognito();
StepFunctionsServiceConfig stepfunctions();
CloudFormationServiceConfig cloudformation();
AcmServiceConfig acm();
+ AthenaServiceConfig athena();
+ GlueServiceConfig glue();
SesServiceConfig ses();
OpenSearchServiceConfig opensearch();
Ec2ServiceConfig ec2();
@@ -372,6 +375,11 @@ public interface EmulatorConfig {
boolean enabled();
}
+ interface FirehoseServiceConfig {
+ @WithDefault("true")
+ boolean enabled();
+ }
+
interface KmsServiceConfig {
@WithDefault("true")
boolean enabled();
@@ -401,6 +409,16 @@ public interface EmulatorConfig {
int validationWaitSeconds();
}
+ interface AthenaServiceConfig {
+ @WithDefault("true")
+ boolean enabled();
+ }
+
+ interface GlueServiceConfig {
+ @WithDefault("true")
+ boolean enabled();
+ }
+
interface SesServiceConfig {
@WithDefault("true")
boolean enabled();
diff --git a/src/main/java/io/github/hectorvent/floci/core/common/AwsJson11Controller.java b/src/main/java/io/github/hectorvent/floci/core/common/AwsJson11Controller.java
index 239270d76f..e8cb72a67c 100644
--- a/src/main/java/io/github/hectorvent/floci/core/common/AwsJson11Controller.java
+++ b/src/main/java/io/github/hectorvent/floci/core/common/AwsJson11Controller.java
@@ -3,8 +3,11 @@ package io.github.hectorvent.floci.core.common;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.hectorvent.floci.services.acm.AcmJsonHandler;
+import io.github.hectorvent.floci.services.athena.AthenaJsonHandler;
import io.github.hectorvent.floci.services.ecr.EcrJsonHandler;
import io.github.hectorvent.floci.services.ecs.EcsJsonHandler;
+import io.github.hectorvent.floci.services.firehose.FirehoseJsonHandler;
+import io.github.hectorvent.floci.services.glue.GlueJsonHandler;
import io.github.hectorvent.floci.services.apigatewayv2.ApiGatewayV2JsonHandler;
import io.github.hectorvent.floci.services.cloudwatch.logs.CloudWatchLogsHandler;
import io.github.hectorvent.floci.services.cognito.CognitoJsonHandler;
@@ -48,6 +51,9 @@ public class AwsJson11Controller {
private final AcmJsonHandler acmJsonHandler;
private final EcsJsonHandler ecsJsonHandler;
private final EcrJsonHandler ecrJsonHandler;
+ private final GlueJsonHandler glueJsonHandler;
+ private final AthenaJsonHandler athenaJsonHandler;
+ private final FirehoseJsonHandler firehoseJsonHandler;
@Inject
public AwsJson11Controller(ObjectMapper objectMapper, ResolvedServiceCatalog catalog,
@@ -59,7 +65,9 @@ public class AwsJson11Controller {
ApiGatewayV2JsonHandler apigwV2JsonHandler,
KmsJsonHandler kmsJsonHandler, CognitoJsonHandler cognitoJsonHandler,
AcmJsonHandler acmJsonHandler, EcsJsonHandler ecsJsonHandler,
- EcrJsonHandler ecrJsonHandler) {
+ EcrJsonHandler ecrJsonHandler, GlueJsonHandler glueJsonHandler,
+ AthenaJsonHandler athenaJsonHandler,
+ FirehoseJsonHandler firehoseJsonHandler) {
this.objectMapper = objectMapper;
this.catalog = catalog;
this.regionResolver = regionResolver;
@@ -74,6 +82,9 @@ public class AwsJson11Controller {
this.acmJsonHandler = acmJsonHandler;
this.ecsJsonHandler = ecsJsonHandler;
this.ecrJsonHandler = ecrJsonHandler;
+ this.glueJsonHandler = glueJsonHandler;
+ this.athenaJsonHandler = athenaJsonHandler;
+ this.firehoseJsonHandler = firehoseJsonHandler;
}
@POST
@@ -113,6 +124,9 @@ public class AwsJson11Controller {
case "acm" -> acmJsonHandler.handle(action, request, region);
case "ecs" -> ecsJsonHandler.handle(action, request, region);
case "ecr" -> ecrJsonHandler.handle(action, request, region);
+ case "glue" -> glueJsonHandler.handle(action, request, region);
+ case "athena" -> athenaJsonHandler.handle(action, request, region);
+ case "firehose" -> firehoseJsonHandler.handle(action, request, region);
default -> null;
};
// catalog.matchTarget is protocol-agnostic: a JSON 1.0 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 24f8a70b35..3895b4542e 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
@@ -135,6 +135,18 @@ public class ResolvedServiceCatalog {
config.storage().services().acm().flushIntervalMs(), null, ServiceProtocol.JSON,
protocols(ServiceProtocol.JSON),
Set.of("CertificateManager."), Set.of("acm"), Set.of(), Set.of()),
+ descriptor("athena", "athena", config.services().athena().enabled(), true,
+ "athena", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
+ protocols(ServiceProtocol.JSON),
+ Set.of("AmazonAthena."), Set.of("athena"), Set.of(), Set.of()),
+ descriptor("glue", "glue", config.services().glue().enabled(), true,
+ "glue", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
+ protocols(ServiceProtocol.JSON),
+ Set.of("AWSGlue."), Set.of("glue"), Set.of(), Set.of()),
+ descriptor("firehose", "firehose", config.services().firehose().enabled(), true,
+ "firehose", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
+ protocols(ServiceProtocol.JSON),
+ Set.of("Firehose_20150804."), Set.of("firehose"), Set.of(), Set.of()),
descriptor("email", "ses", config.services().ses().enabled(), true,
"ses", config.storage().mode(), 5000L, AwsNamespaces.SES, ServiceProtocol.REST_JSON,
protocols(ServiceProtocol.REST_JSON, ServiceProtocol.QUERY),
diff --git a/src/main/java/io/github/hectorvent/floci/services/athena/AthenaJsonHandler.java b/src/main/java/io/github/hectorvent/floci/services/athena/AthenaJsonHandler.java
new file mode 100644
index 0000000000..bb13ad5217
--- /dev/null
+++ b/src/main/java/io/github/hectorvent/floci/services/athena/AthenaJsonHandler.java
@@ -0,0 +1,55 @@
+package io.github.hectorvent.floci.services.athena;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.github.hectorvent.floci.core.common.AwsException;
+import io.github.hectorvent.floci.services.athena.model.QueryExecution;
+import io.github.hectorvent.floci.services.athena.model.ResultSet;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.core.Response;
+
+import java.util.Map;
+
+@ApplicationScoped
+public class AthenaJsonHandler {
+
+ private final AthenaService athenaService;
+ private final ObjectMapper mapper;
+
+ @Inject
+ public AthenaJsonHandler(AthenaService athenaService, ObjectMapper mapper) {
+ this.athenaService = athenaService;
+ this.mapper = mapper;
+ }
+
+ public Response handle(String action, JsonNode request, String region) throws Exception {
+ return switch (action) {
+ case "StartQueryExecution" -> {
+ String query = request.get("QueryString").asText();
+ String workGroup = request.has("WorkGroup") ? request.get("WorkGroup").asText() : "primary";
+ String database = "default";
+ if (request.has("QueryExecutionContext") && request.get("QueryExecutionContext").has("Database")) {
+ database = request.get("QueryExecutionContext").get("Database").asText();
+ }
+ String id = athenaService.startQueryExecution(query, workGroup, database);
+ yield Response.ok(Map.of("QueryExecutionId", id)).build();
+ }
+ case "GetQueryExecution" -> {
+ String id = request.get("QueryExecutionId").asText();
+ QueryExecution execution = athenaService.getQueryExecution(id);
+ yield Response.ok(Map.of("QueryExecution", execution)).build();
+ }
+ case "GetQueryResults" -> {
+ String id = request.get("QueryExecutionId").asText();
+ ResultSet results = athenaService.getQueryResults(id);
+ yield Response.ok(Map.of("ResultSet", results)).build();
+ }
+ case "ListQueryExecutions" -> {
+ yield Response.ok(Map.of("QueryExecutionIds",
+ athenaService.listQueryExecutions().stream().map(QueryExecution::getQueryExecutionId).toList())).build();
+ }
+ default -> throw new AwsException("InvalidAction", "Action " + action + " is not supported", 400);
+ };
+ }
+}
diff --git a/src/main/java/io/github/hectorvent/floci/services/athena/AthenaService.java b/src/main/java/io/github/hectorvent/floci/services/athena/AthenaService.java
new file mode 100644
index 0000000000..49aad22f14
--- /dev/null
+++ b/src/main/java/io/github/hectorvent/floci/services/athena/AthenaService.java
@@ -0,0 +1,57 @@
+package io.github.hectorvent.floci.services.athena;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import io.github.hectorvent.floci.core.common.AwsException;
+import io.github.hectorvent.floci.core.storage.StorageBackend;
+import io.github.hectorvent.floci.core.storage.StorageFactory;
+import io.github.hectorvent.floci.services.athena.model.*;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import org.jboss.logging.Logger;
+
+import java.time.Instant;
+import java.util.*;
+
+@ApplicationScoped
+public class AthenaService {
+
+ private static final Logger LOG = Logger.getLogger(AthenaService.class);
+
+ private final StorageBackend queryStore;
+
+ @Inject
+ public AthenaService(StorageFactory storageFactory) {
+ this.queryStore = storageFactory.create("athena", "queries.json", new TypeReference