Under IAM enforcement no S3 Tables request was checked: its model was not among the vendored REST routes and its namespace's request resources were not read, so no request mapped to an action and every call went through, DeleteTableBucket and the policy calls included. s3tables is now vendored by regen_rest_routes.py and read by the request-resources, tag-on-create and passed-role generators. A table bucket call is checked on the bucket its path names. A table's ARN ends in an id the service mints, which no request carries: a request names the table by its table bucket's ARN, its namespace and its name. A new generic rule in the request-resources generator reads such a type, found by its service by those path labels (or GetTable's query string members, when tableArn is absent), instead of filling the bucket's name from the table's name or reading the bucket's ARN as the table's. S3TablesStoredResourceArns answers it from the stored table, read only.
3.4 KiB
S3 Tables
Protocol: REST JSON
Signing service: s3tables
Endpoint: http://localhost:4566
Floci emulates the S3 Tables control plane for local development, Terraform
convergence, and SDK integration tests. It is a separate AWS service from S3:
S3 Tables requests are signed as s3tables and use REST JSON routes such as
/buckets and /tables/{tableBucketARN}/{namespace}.
Scope
This service stores table-bucket, namespace, table, policy, maintenance
configuration, and metadata-location state, and gives every table a warehouse:
a bucket of its own, named like the ones AWS creates (<id>--table-s3), which
GetTable and GetTableMetadataLocation report as warehouseLocation. An
Iceberg client such as Spark's S3TablesCatalog writes the table's data and
metadata files there through Floci's S3 and commits each new metadata file
with UpdateTableMetadataLocation. Deleting the table deletes its warehouse
and everything in it, every object version included. A warehouse bucket is the
table's storage, not a general purpose bucket, so ListBuckets leaves it out. Floci does not run an Iceberg engine itself: compaction,
snapshot expiry, replication, encryption management, and metrics are outside
this implementation.
A table's ARN ends in an id Floci mints when it creates the table
(arn:aws:s3tables:<region>:<account>:bucket/<bucket>/table/<id>), as AWS's
do, so two tables of one name in different namespaces have their own ARNs, and
a rename keeps it. GetTable takes either tableArn or the table bucket's
ARN, namespace and name. A table created by an earlier Floci keeps the ARN it
was stored with, which ends in its name.
Supported operations
| Area | Operations |
|---|---|
| Table buckets | CreateTableBucket, GetTableBucket, ListTableBuckets, DeleteTableBucket |
| Bucket policy | PutTableBucketPolicy, GetTableBucketPolicy, DeleteTableBucketPolicy |
| Bucket maintenance | PutTableBucketMaintenanceConfiguration, GetTableBucketMaintenanceConfiguration |
| Namespaces | CreateNamespace, GetNamespace, ListNamespaces, DeleteNamespace |
| Tables | CreateTable, GetTable, ListTables, DeleteTable, RenameTable |
| Metadata location | GetTableMetadataLocation, UpdateTableMetadataLocation |
| Table policy | PutTablePolicy, GetTablePolicy, DeleteTablePolicy |
| Table maintenance | PutTableMaintenanceConfiguration, GetTableMaintenanceConfiguration |
Tables must use ICEBERG format. UpdateTableMetadataLocation implements
optimistic concurrency: supply the table's current versionToken; a stale
token returns ConflictException.
Example
export AWS_ENDPOINT_URL=http://localhost:4566
export AWS_DEFAULT_REGION=us-east-1
export AWS_ACCESS_KEY_ID=test
export AWS_SECRET_ACCESS_KEY=test
bucket_arn=$(aws s3tables create-table-bucket --name local-warehouse --query arn --output text)
aws s3tables create-namespace --table-bucket-arn "$bucket_arn" --namespace analytics
aws s3tables create-table \
--table-bucket-arn "$bucket_arn" \
--namespace analytics \
--name events \
--format ICEBERG
Configuration
| Variable | Default | Description |
|---|---|---|
FLOCI_SERVICES_S3TABLES_ENABLED |
true |
Enables the S3 Tables REST JSON service. |
FLOCI_STORAGE_SERVICES_S3TABLES_MODE |
Global storage mode | Optional per-service storage-mode override. |
FLOCI_STORAGE_SERVICES_S3TABLES_FLUSH_INTERVAL_MS |
5000 |
Persistence flush interval for hybrid storage. |