Commit Graph
159 Commits
Author SHA1 Message Date
Hector Ventura 3b4e73ca5a docs(lambda): document Podman rootless support and Runtime API host override (#1340)
Adds a 'Running on Podman (rootless)' section to the Docker configuration
docs with the known-working container config, and documents the existing
FLOCI_SERVICES_LAMBDA_DOCKER_HOST_OVERRIDE escape hatch for when Runtime
API host auto-detection picks an unreachable address.

Closes #876
2026-06-14 20:34:43 -05:00
devansh-jain-18 022436eaae feat(batch): add AWS Batch service support (#1332) 2026-06-14 19:45:15 -05:00
Prakhar Kapoor 702d71d604 fix(SQS): max message size should be 1MB, not 256KB (#1339) 2026-06-14 09:49:52 -05:00
Jason van Zyl 22a50b3c80 Add RDS provisioning support (#1253)
* feat(rds): add subnet groups and orderable options

* feat(rds): support subnet group modification

* feat(rds): return managed master user secrets

* fix(rds): preserve instance tags

* fix(rds): honor requested engine versions

* fix(rds): return routable proxy endpoints

* fix(rds): accept PostgreSQL SSL negotiation

* fix(rds): initialize PostgreSQL IAM role

* fix(rds): include PostgreSQL 18 orderable option

* fix(rds): address provisioning support review feedback
2026-06-13 18:46:42 -05:00
Lorenzo Galassi ceb4d84431 fix(athena): 🐛 align GetWorkGroup with AWS behavior (#1301)
GetWorkGroup previously returned a hardcoded default response for any
workgroup name, ignoring workgroups created via CreateWorkGroup and
never failing for non-existent ones.

- Return stored Name, State, Description, CreationTime and
  Configuration for created workgroups, scoped by region
- Throw InvalidRequestException (400) when the workgroup is not found,
  matching the AWS error shape and message
- Keep the default view for the primary workgroup
- Make DeleteWorkGroup actually remove the entry from the store so a
  deleted workgroup is no longer returned and its name can be reused
- Document DeleteWorkGroup in the supported actions table

Closes #1128
2026-06-13 01:43:26 -05:00
devansh-jain-18 e063ac18ee feat(rds-data): add RDS Data API support (#1262)
* feat(rds-data): add RDS Data API support

* fix(rds-data): harden Data API validation

* fix(rds-data): harden review findings
2026-06-12 23:39:05 -05:00
Jason van Zyl d8d70bfd48 Improve ELBv2 target resolution and persistence (#1254)
* fix(elbv2): resolve instance target addresses

* fix(elbv2): persist load balancer state

* fix(elbv2): preserve listener sockets on updates

* test(elbv2): cover persisted state reload

* fix(elbv2): restore target health after reload

* fix(elbv2): address persistence review feedback

* test(elbv2): align subnet-backed zone coverage
2026-06-12 17:46:18 -05:00
Jason van Zyl 79bf0d39a6 Stream S3 range responses (#1255)
* fix(s3): stream object range responses

* test(s3): cover streamed object reads

* fix(s3): harden streamed range responses
2026-06-11 01:48:39 -05:00
Jason van Zyl f9c305b7c6 Add EC2 provisioning primitives (#1252)
* feat(ec2): load AMI catalog metadata

* feat(ec2): add Ubuntu 24.04 AMI metadata

* feat(ec2): add launch template APIs

* feat(ec2): add launch template version APIs

* feat(ec2): add VPC endpoint CRUD

* feat(ec2): add NAT gateways and instance offerings

* fix(ec2): add t4g.medium instance offering

* fix(ec2): preserve launch template version data

* fix(ec2): align subnet helper references

* fix(ec2): keep VPC endpoint services empty
2026-06-11 01:32:17 -05:00
Jason van Zyl 6e4087b0f4 Add KMS key state and description operations (#1251)
* feat(kms): support disabling keys

* feat(kms): support key description updates

* fix(kms): tighten key description update coverage
2026-06-11 01:19:09 -05:00
Kenshin Okinaka e981a7b81b docs: update references after AGENT.md → AGENTS.md rename (#1272) 2026-06-10 07:53:01 -05:00
TomDav28andTomer David 076afb3ebd feat(parity): emit LocalStack-compatible "Ready." log line on startup (#1284)
Co-authored-by: Tomer David <tomer.david+catonian@catonetworks.com>
2026-06-10 07:52:15 -05:00
Kenshin Okinaka 35f597addd feat(ses): publish events to Firehose, EventBridge, CloudWatch (#1188)
* feat(ses): publish events to Firehose, EventBridge, and CloudWatch destinations

Extend SES V2 configuration set event publishing so destinations beyond
SnsDestination actually deliver. Previously KinesisFirehoseDestination,
EventBridgeDestination, and CloudWatchDestination were stored but the
publisher logged a warning and skipped. PinpointDestination still skips.

- KinesisFirehoseDestination → single Firehose PutRecord per event;
  S3-backed streams flush accumulated records as NDJSON once the default
  count threshold is reached.
- EventBridgeDestination → PutEvents entry with Source=aws.ses,
  DetailType="Email <EventTypeLabel>", payload as Detail. Region is
  stamped on the entry (so matchesPattern + envelope agree on a
  non-default region) and Resources is always present (empty when
  sourceArn is null — matchesPattern's resources-filter branch casts
  entry.get("Resources") unconditionally).
- CloudWatchDestination → MetricDatum to AWS/SES with Unit=Count.
  Dimensions resolved from DimensionConfigurations against EmailTags
  (MESSAGE_TAG / messageTag), email headers (EMAIL_HEADER / emailHeader),
  or ses:configuration-set, falling back to DefaultDimensionValue.
  Timestamp left to putMetricData's epoch-seconds default.

Tests
- SesEventPublishingV2IntegrationTest @Order 14-28: per-destination
  setup → send → assert, plus a cross-region (eu-west-1) EventBridge
  case pinning region propagation end-to-end.
- SesEventPublisherTest (Mockito ArgumentCaptor): the EB PutEvents
  entry always carries Resources as an ArrayNode — integration tests
  cannot pin this because EventBridgeService.buildEventEnvelope
  defaults a missing key via getOrDefault.

Docs
- docs/services/ses.md: replace the SNS-only claim with the four
  supported destination types.

* fix(ses): use AWS past-tense detail-type for EventBridge SES events

The EventBridge publisher was emitting "Email Send", "Email Delivery",
etc — derived from the SNS notification eventType vocabulary by
prepending "Email ". AWS uses a separate past-tense vocabulary on
EventBridge: "Email Sent", "Email Delivered", "Email Bounced", "Email
Complaint Received", "Email Rejected", "Email Opened", "Email Clicked",
"Email Rendering Failed", "Email Delivery Delayed", "Email Subscribed"
(see https://docs.aws.amazon.com/eventbridge/latest/ref/events-ref-ses.html).

A customer rule pattern keyed on the AWS value
({"source":["aws.ses"],"detail-type":["Email Delivered"]}) would
silently fail to match Floci events.

Changes:
- Add SesEventPayload.eventBridgeDetailType returning the past-tense
  EventBridge vocabulary. Kept separate from eventTypeLabel (which
  remains correct for SNS notifications and CloudWatch metric names).
- SesEventPublisher.publishEventBridge uses the new mapping.

Tests
- SesEventPayloadTest.eventBridgeDetailType_matchesAwsPastTenseVocabulary:
  pins all 10 mappings against AWS docs.
- SesEventPublishingV2IntegrationTest @Order 29
  (eventBridge_detailTypePattern_keyedOnAwsSentValue_matches):
  structural pin — creates a rule with EventPattern
  {"source":["aws.ses"],"detail-type":["Email Sent"]} and asserts the
  SQS target receives the SEND envelope. A regression to "Email Send"
  would cause the rule to silently drop the event, failing the test
  without relying on any hard-coded assertion string.
- Existing tests updated to assert the AWS values:
  SesEventPublishingV2IntegrationTest 4 assertions; sdk-test-java
  SesEventPublishingTest 3 assertions.

* fix(ses): emit CloudWatch metric name "RenderingFailure" without space

AWS CloudWatch metric publishing for SES uses "RenderingFailure" (no
space) for the RENDERING_FAILURE event type — verified against real
AWS by configuring a CW event destination on a configuration set,
sending a templated email with a missing TemplateData key to trigger
the rendering failure path, and capturing the new metric name from
`aws cloudwatch list-metrics --namespace AWS/SES`.

Floci's publisher was previously sourcing the CW MetricName from
SesEventPayload.eventTypeLabel, which returns "Rendering Failure" (with
space). That spelling is correct for the SNS notification's eventType
field but wrong for CloudWatch — customer dashboards / alarms keyed on
the AWS-correct "RenderingFailure" never see Floci's metric.

Changes:
- Add SesEventPayload.cloudWatchMetricName returning the CW spelling.
  Mirrors eventTypeLabel for every other case so the two stay aligned
  in shape; only RENDERING_FAILURE differs.
- SesEventPublisher.publishCloudWatch uses the new mapping.
- SesEventPayloadTest.cloudWatchMetricName_matchesAwsCwSpelling pins
  all 10 mappings; RENDERING_FAILURE expectation comes from the live
  AWS capture rather than an AWS docs guess.

DELIVERY_DELAY remains as "DeliveryDelay" in this commit — it could
not be triggered conveniently from the SES sandbox (needs genuine SES
backoff), so leaving the existing value rather than guessing. Flagged
in code comments as needing future verification.

The other simple metric names (Send, Delivery, Bounce, Complaint) were
also verified against the same AWS capture and match Floci's existing
spelling byte-for-byte — no change needed for those.
2026-06-09 00:36:28 -05:00
Hector Ventura 446697ec71 docs: add AWS Cloud Map service docs, fix service count, add analytics (#1221)
Document AWS Cloud Map (servicediscovery), which was implemented but never
documented, and reconcile related documentation drift:

- Add docs/services/cloudmap.md covering all 22 operations, config, examples
- Bump headline service count from 52 to 53 across README and docs
- Add Cloud Map to the canonical service matrix, README tables, and docs index
- Backfill mkdocs nav with Cloud Map and 7 existing-but-unlisted service docs
- Backfill condensed tables with services missing from them (Transcribe,
  Resource Groups Tagging, Neptune, EventBridge Pipes, CloudFront)
- Add Umami analytics tracking via a Material theme override (overrides/main.html)
2026-06-07 10:44:37 -05:00
Ben Younes e3c19461db feat(iam): seed standard EKS cluster and node group managed policies (#1216)
EKS cluster creation and managed node groups attach a set of AWS managed
policies that floci did not seed, so GetPolicy / AttachRolePolicy failed with
NoSuchEntity (e.g. AmazonEKSClusterPolicy, AmazonEKSVPCResourceController),
breaking the terraform-aws-modules/eks module and the EKS console flow.

Add the standard set to the seeded catalog (all path "/"):
AmazonEKSClusterPolicy, AmazonEKSServicePolicy, AmazonEKSVPCResourceController,
AmazonEKSWorkerNodePolicy, AmazonEKS_CNI_Policy. Documented in the IAM managed
policy catalog (docs/services/iam.md).

Closes #1092
2026-06-07 00:41:48 -05:00
AgustinBertagna 4446404288 feat(appsync): Phase 2 — Schema Registry, Model Fixes, CRUDL completion & AWS Scalars (#1185)
* build: add graphql-java dependency

* feat(appsync): add and extend data models for Phase 2

- Add AdditionalAuthenticationProvider, DomainName, ChannelNamespace, ApiAssociation models
- Add 14 fields to GraphqlApi (apiType, visibility, owner, etc.)
- Change additionalAuthenticationProviders from raw maps to typed list
- Add 6 fields to Resolver (resolverArn, cachingConfig, maxBatchSize, etc.)
- Add dataSourceArn to DataSource
- Rename FunctionConfiguration.arn to functionArn

* feat(appsync): add service and controller changes for Phase 2

* feat(appsync): add service and controller changes for Phase 2

* test(appsync): add Phase 2 integration tests

Add ~60 new tests for:
- Model completeness (new fields, ARNs, functionArn rename)
- Domain names CRUDL + associate/disassociate
- Channel namespaces CRUDL + update
- Merged API associations CRUDL
- Enhanced metrics
- Schema registry parsing with AWS scalars and extensions
- Directive registration (aws_api_key, aws_subscribe, deprecated, unknown)
- Edge cases (null auth providers, maxBatchSize 0, cleanup on delete)

* test(appsync): add AWS scalar unit tests

Test all 17 AWS scalars:
- All registered in AppSyncScalarRegistry
- AWSDateTime, AWSJSON, AWSEmail parse valid/invalid values
- AWSTimestamp and AWSShort range validation
- AWSURL and AWSPhone format validation

* test(appsync): add SDK compatibility tests for Phase 2

Validate that the AWS SDK Java v2 can read:
- dataSourceArn() on CreateDataSource response
- resolverArn() on CreateResolver response
- functionArn() on CreateFunction response
- BadRequestException on invalid schema creation

* docs(appsync): add Phase 2 operations, schema registry, and AWS scalars documentation

- Add Domain Names, Channel Namespaces, Merged API Associations, Enhanced Metrics
- Document AWS scalar types (17 scalars with validation rules)
- Document AppSync directives (8 directives with locations)
- Update Not Implemented section with future phase references
- Add CLI examples for domain names and channel namespaces
- Update cascade delete to include channel namespaces and domain associations

* docs: add AppSync to service tables, env vars, storage config, and SDK README

- README.md: add AppSync to category table, detailed notes, and architecture diagram
- docs/index.md: add AppSync to supported services table, fix count to 52
- docs/configuration/environment-variables.md: add FLOCI_SERVICES_APPSYNC_ENABLED
- docs/configuration/advanced/application-yml.md: add appsync config block
- docs/configuration/storage.md: add AppSync per-service storage override
- compatibility-tests/sdk-test-java/README.md: add AppSyncTest to services table

* fix(appsync): reuse ObjectMapper and fix AWSJSON serialize for non-string values

AWSJSON scalar was creating a new ObjectMapper on every parseValue() call. serialize() used toString() which produces invalid JSON for Map/JsonNode results.

* fix(appsync): strip string literals and comments before unknown directive validation

The regex @(\w+) incorrectly flagged @ mentions inside GraphQL string literals and comments as unknown directives.

* fix(appsync): prevent silent overwrite on creates, validate required fields and input values

- Add existence checks on createDataSource, createResolver, createType,
  createChannelNamespace, createMergedApiAssociation (→ ConflictException 409)
- Validate authenticationType is required on createGraphqlApi
- Validate typeName is required on createResolver
- Validate dataSourceName exists on createResolver and createFunction
- Prevent associateApi from silently overwriting existing association
- Enforce API key limit (max 2 per API)
- Fix expires parsing to accept ISO 8601 strings, throw on invalid values
- Fix castInt overflow detection
- Fix updateApiKey expires validation (was silently swallowing errors)
- Change InvalidNextTokenException to BadRequestException (AWS standard)
- Fix maxResults=0 to return empty page
- Fix getIntrospectionSchema to throw 404 instead of returning null
- Fix tags with null values (was producing literal string "null")

* test(appsync): fix cascade delete test to create data source before function, align with new validation

* refactor(appsync): remove dead code and unused hasSchema()

- Delete AppSyncDirectiveRegistry.java (100 lines, never used)
- Delete DirectiveValidator.java (45 lines, never called)
- Remove hasSchema() from SchemaRegistry (never called)

* fix(appsync): scalar null-safety, type validation, and DNS resolution

- Add null checks to 5 serialize() methods (AWS_TIMESTAMP, AWS_LONG,
  AWS_INTEGER, AWS_BOOLEAN, AWS_FLOAT) to prevent NPE
- Fix AWS_TIMESTAMP parseValue() ClassCastException on String input
- Replace InetAddress.getByName() with regex in AWS IPAddress to
  prevent DNS resolution (SSRF concern)
- AWSBoolean now rejects non-boolean values (matches AppSync behavior)

* refactor(appsync): centralize directive definitions in AppSyncDirective enum

- Add AppSyncDirective enum as single source of truth for directive
  names and SDL definitions
- Update AppSyncSchemaParser to use enum instead of duplicated strings
- Eliminates 3 sources of truth (validateNoUnknownDirectives Set,
  injectDirectiveDefinitions SDL, and formerly AppSyncDirectiveRegistry)

* perf(appsync): cache scalarMap in AppSyncScalarRegistry

- Initialize scalarMap once in constructor as unmodifiableMap
- Avoids recreating HashMap on every call (was called twice per
  schema parse)

* test(appsync): add tests for scalar fixes and behavior changes

- Add tests for null-safety in serialize() (5 scalars)
- Add test for AWSTimestamp parseValue with String input
- Add tests for AWSIPAddress regex validation (IPv4, IPv6, invalid)
- Add tests for AWSBoolean rejecting non-boolean values
- Add test for scalarMap caching

* test(sdk): add AWS scalars schema creation test

Verifies that schemas with AWS scalar types (AWSDateTime, AWSJSON,
AWSIPAddress, AWSBoolean) parse correctly via the SDK.

* fix(appsync): correct API paths to match AWS documentation

- Channel namespaces: /v1/ → /v2/, channelnamespaces → channelNamespaces
- Domain association: /apis → /apiassociation
- Remove ListApiAssociations (not a real AppSync operation)
- Remove GetEnhancedMetricsConfig (not a real AppSync operation)
- Rename Merged API Association to Source API Association with correct paths:
  - AssociateSourceGraphqlApi: POST /v1/mergedApis/{id}/sourceApiAssociations
  - GetSourceApiAssociation: GET /v1/mergedApis/{id}/sourceApiAssociations/{id}
  - ListSourceApiAssociations: GET /v1/apis/{apiId}/sourceApiAssociations
  - DisassociateSourceGraphqlApi: DELETE /v1/mergedApis/{id}/sourceApiAssociations/{id}

* feat(appsync): add SourceApiAssociation models

Add SourceApiAssociation, SourceApiAssociationConfig, and
SourceApiAssociationSummary models to support merged/source API
association operations per AWS AppSync API Reference.

* feat(appsync): add ChannelNamespace support models

Add AuthMode, HandlerConfig, HandlerConfigs, Integration, and
LambdaConfig models for ChannelNamespace handler configuration
per AWS AppSync API Reference.

* fix(appsync): fix ApiAssociation and ChannelNamespace models

ApiAssociation: remove source/merged API fields, keep only domain
association fields (apiId, associationStatus, deploymentDetail,
domainName) per AWS AppSync API Reference.

ChannelNamespace: add missing fields (channelNamespaceArn,
codeHandlers, created, handlerConfigs, lastModified,
publishAuthModes, subscribeAuthModes, tags) per AWS docs.

* feat(appsync): add missing service methods and fix response models

- associateApi now returns full ApiAssociation object
- createMergedApiAssociation returns SourceApiAssociation
- createSourceApiAssociation returns SourceApiAssociation
- getSourceApiAssociation validates mergedApiId
- listSourceApiAssociations returns SourceApiAssociationSummary
- Add updateSourceApiAssociation method
- Add deleteMergedApiAssociation method
- ChannelNamespace: populate arn, timestamps on create/update

* feat(appsync): fix response formats and add missing endpoints

- associateMergedGraphqlApi: response key apiAssociation → sourceApiAssociation
- disassociateSourceGraphqlApi: returns 200 + body (not 204)
- associateApi: returns full ApiAssociation from service
- Add POST /v1/mergedApis/{id}/sourceApiAssociations/{assocId} (UpdateSourceApiAssociation)
- Add DELETE /v1/sourceApis/{id}/mergedApiAssociations/{assocId} (DisassociateMergedGraphqlApi)

* test(appsync): fix and add integration tests for new endpoints

- Fix associateSourceGraphqlApi: use mergedApiId and sourceApiAssociationStatus
- Fix deleteSourceApiAssociation: expect 200 with body (not 204)
- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test

* test(appsync): add SDK tests for missing operations

- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test
- Fix test ordering for new domain tests
2026-06-07 00:05:51 -05:00
Kenshin Okinaka e36576c2a4 feat(ses): per-configuration-set sending toggle (v1 + v2) (#1193)
Add UpdateConfigurationSetSendingEnabled (SES v1 Query) and
PutConfigurationSetSendingOptions (SES v2 REST, PUT
/v2/email/configuration-sets/{name}/sending) to toggle email sending
on a single configuration set, complementing the existing
account-level UpdateAccountSendingEnabled / PutAccountSendingAttributes
toggle. The two APIs share state: both write
`ConfigurationSet.sendingEnabled` (Boolean, null/true = enabled).

Enforcement is centralized in SesService.validateConfigurationSet,
which is called by SendEmail, SendRawEmail, and SendBulkTemplatedEmail
(v1 and v2 paths). When the CS's sendingEnabled is false, the send is
rejected with SendingPausedException + "Sending is paused for
configuration set <name>" — matching the exact wire shape AWS returns
in production (verified via `aws sesv2 send-email` against an AWS
account with a disabled CS; both ErrorCode and Message reproduce as-is).

Read-back paths:
  - v2 GetConfigurationSet returns SendingOptions: {SendingEnabled}
  - v1 DescribeConfigurationSet with `reputationOptions` attribute
    returns ReputationOptions/SendingEnabled (matches the AWS v1 wire
    contract where SendingEnabled lives under ReputationOptions)

The v1 action is also added to AwsQueryController.SES_ACTIONS so that
action-name-based service routing recognizes it.

Tests
- SesConfigurationSetSendingOptionsV2IntegrationTest (13 cases): toggle
  via both APIs, cross-API state sharing, SendEmail rejection with
  SendingPausedException when disabled, read-back via Get/Describe,
  bad-request validation, unknown CS returns 404 via v2.
- SesConfigurationSetSendingTest (SDK compat, 9 cases): AWS Java SDK
  v2 marshalling of both APIs, with sendEmail rejection asserted as
  `SendingPausedException` (the AWS SDK class corresponding to the
  matched server-side error code).

Docs
- docs/services/ses.md: list both APIs in their respective tables.
2026-06-06 08:16:39 -05:00
David Phillips 10e28f33c2 feat: support Glue DeleteDatabase (#1181) 2026-06-05 23:38:34 -05:00
David Phillips 6089d8ddc7 feat: support Glue user-defined functions (#1187) 2026-06-05 23:20:42 -05:00
Kenshin Okinaka 68c9dcc6fb docs(ses): list v1 ConfigurationSetEventDestination actions (#1192)
The v1 Query handler dispatches Create / Update / Delete
ConfigurationSetEventDestination at SesQueryHandler.java:85-90 but the
Supported Actions table in docs/services/ses.md did not list them,
leaving the v1 surface under-documented compared to v2 (which already
has the equivalent REST endpoints listed).
2026-06-04 21:52:08 -05:00
Hector Ventura 2d30641479 fix(dns): resolve public hostnames from spawned containers (#1168)
Lambda/CodeBuild containers get Floci's IP as their only DNS, so all
public-name resolution flows through Floci's embedded UDP/53 forwarder.
The forwarder read responses into a hardcoded 512-byte buffer, silently
truncating larger EDNS0 responses (e.g. CDN-backed hosts), so public
lookups failed inside Lambda with ENOTFOUND/EBUSY.

- Enlarge the forwarder receive buffer to 4096 bytes (EDNS0).
- Forward across an ordered upstream list (resolv.conf + configurable
  public fallbacks), returning the first valid response; warn when all
  upstreams fail instead of dropping the response silently.
- Append configurable fallback resolvers (default 8.8.8.8, 8.8.4.4)
  after Floci's IP on spawned containers' HostConfig.Dns, controllable
  via floci.dns.container-fallback-* / FLOCI_DNS_CONTAINER_FALLBACK_*.

Closes #1110
2026-06-04 00:42:38 -05:00
Hector Ventura 7128758a63 feat(eks): make real-mode clusters reachable and authenticable from the host (#1167)
In real mode `aws eks create-cluster` brought up a k3s container that was
unreachable from the host and rejected every request with 401. This makes the
native AWS workflow work end to end (`aws eks update-kubeconfig` + `kubectl`).

- describe-cluster returns a host-reachable endpoint (https://localhost:<hostPort>),
  configurable via endpoint-mode (host|network), default host
- token-authentication webhook (POST /_floci/eks/token-webhook) validates the
  `aws eks get-token` bearer token and maps it to system:masters; pins the
  apiserver to the v1 TokenReview API and echoes the request apiVersion
- webhook kubeconfig is injected into k3s via the Docker API (create -> copy ->
  start), so it works in native and Docker-in-Docker with no host-path config
- k3s network falls back to the global docker-network, then auto-detected

Closes #1118
2026-06-04 00:42:25 -05:00
Kenshin Okinaka 19b0432b8c feat(ses): apply suppression list during send with per-CS SuppressionOptions override (#1109)
When SendEmail / SendRawEmail is called with a recipient on the
account-level suppression list whose reason matches the effective
SuppressedReasons (the configuration set's SuppressionOptions
override if present, else the account-level reasons), Floci now:

1. Emits a synthetic Bounce or Complaint event (per the suppression
   reason) through the configured event destinations alongside the
   always-emitted Send event.
2. Drops the suppressed recipient from the SMTP relay step, while
   still delivering the message to non-suppressed recipients on the
   same send.

The SendEmail API response (200 + MessageId), the stored SentEmail
(used by the LocalStack-compatible /_aws/ses inspection endpoint),
and the published event's mail.destination all continue to reflect
the original recipient list — matching how AWS reports the message
at the API and event layers.

This PR bundles two related pieces:
- The per-configuration-set SuppressionOptions block (Put endpoint +
  GetConfigurationSet response shape + getEffectiveSuppressedReasons
  helper). Mirrors AWS V2 PutConfigurationSetSuppressionOptions:
  empty list = explicit "no suppression filtering" for this CS,
  unset block = fall back to account-level reasons. The validation
  message for the new endpoint matches the AWS V2 natural-language
  form ("Reason <X> is invalid, must be one of [BOUNCE, COMPLAINT].")
  which is distinct from the V1-style nested message returned by the
  three older suppression endpoints; both forms were verified
  against live AWS on 2026-06-03.
- The send-time filter + synthetic-event partitioning, plumbed
  through getEffectiveSuppressedReasons so the override takes effect
  per-send. collectSuppressedReasons and resolveSuppressionReason
  now both take configurationSetName, hitting the per-CS override
  when present and falling back to the account-level reasons
  otherwise.

Per-recipient: when only some recipients are suppressed, the
non-suppressed ones still reach smtpRelay.relay() / relayRaw().
The relay is skipped entirely only when every recipient is
suppressed.

- Recipient suppressed with reason BOUNCE (and BOUNCE in the
  effective reasons) -> synthetic Bounce event; not relayed.
- Recipient suppressed with reason COMPLAINT (and COMPLAINT in the
  effective reasons) -> synthetic Complaint event; not relayed.
- Reason mismatch or address not on the list -> Send only; relayed
  normally.
- Simulator-address recipients and suppression-listed recipients
  are unioned into the same event's recipient list, deduplicated.

Tests
- SesConfigurationSetSuppressionOptionsV2IntegrationTest (16 cases)
  for the CRUD + helper.
- SesConfigurationSetTest SDK compat (6 V2 cases) using
  SesV2Client.PutConfigurationSetSuppressionOptions and the typed
  SuppressionListReason enum (+ the WithStrings escape hatch for
  the server-side validation path).
- SesServiceSmtpTest grows four cases pinning the send-time
  override behaviour: empty list on the CS disables filtering and
  the relay receives the address; BOUNCE-only override leaves
  COMPLAINT-suppressed addresses unfiltered; a CS without an
  override falls back to account-level (parity with no-CS sends);
  raw-send mirrors the JSON-send path.
- SesEventPayload / SesEventPublishingV2IntegrationTest / further
  send-path coverage from the original suppression PR is preserved.
- All 452 SES tests pass.
2026-06-03 21:57:20 -05:00
AgustinBertagna c8b0048bac docs(appsync): add AppSync service documentation (#1149)
Add documentation for AWS AppSync Management API (Phase 1) covering
33 operations across GraphQL API, Schema, DataSources, Resolvers,
Functions, Types, API Keys, Tags, and Environment Variables.

Includes pagination, cascade delete behavior, CLI examples,
and service matrix entry.
2026-06-03 17:36:32 -05:00
Hector Ventura 59befa3077 docs: add light/dark logo branding, mkdocs theming, and README badges (#1150)
Replicate the floci-gcp light/dark logo treatment with AWS orange dots,
add mkdocs branding/theming with header and logo assets, and add
shields.io badges to the README (release, build, docker, license, stars).
2026-06-02 23:06:36 -05:00
Clément 5dc0664b8b feat(sns): mock mobile push for iOS and Android platform endpoints (#1115) 2026-06-02 01:25:17 -05:00
Kenshin Okinaka 35211adc4a feat(ses): publish SES events to SNS configuration set destinations (#1106)
* feat(ses): publish SES events to SNS configuration set destinations

Add SES V2 event publishing to SnsDestination targets configured on a
ConfigurationSet. When SendEmail / SendRawEmail / SendTemplatedEmail /
SendBulkEmail is invoked with a ConfigurationSetName, Floci builds the
matching AWS-format event payload (a `mail` block plus an event-type-
specific block) and publishes it to each enabled SNS destination whose
MatchingEventTypes includes that event.

Events emitted
- SEND on every successful send.
- DELIVERY / BOUNCE / COMPLAINT / REJECT when a recipient matches the
  corresponding AWS mailbox simulator address (success@ / bounce@ /
  complaint@ / suppressionlist@simulator.amazonses.com).
- Per-event-type recipient lists (delivery.recipients,
  bounce.bouncedRecipients, complaint.complainedRecipients) are
  filtered to only the simulator address that triggered the event and
  emitted in their canonical trimmed form; mail.destination carries
  the full envelope.

Wire-level fidelity
- Event payload mirrors the AWS SES SNS notification format documented
  at https://docs.aws.amazon.com/ses/latest/dg/event-publishing-retrieving-sns-examples.html.
- mail.tags includes user-supplied EmailTags / DefaultEmailTags /
  ReplacementTags (V2) and Tags.member.N / DefaultTags.member.N /
  Destinations.member.N.ReplacementTags (V1 Query). Each tag emits as
  {Name: [Value]}.
- mail.headers[] appends user-supplied Content.Simple.Headers and
  Content.Template.Headers after the auto-emitted From/To/Cc/Subject;
  null/blank Names are rejected with "The header name must be
  specified." (BadRequestException 400).
- V2 SendBulkEmail BulkEmailEntries accept ReplacementTags (merged by
  Name onto DefaultEmailTags) and ReplacementHeaders (merged
  case-insensitively per RFC 5322 onto DefaultContent.Template.Headers).
- mail.sendingAccountId resolves from EmulatorConfig.defaultAccountId().
- ConfigurationSet existence is validated up-front on sendEmail /
  sendRawEmail / sendBulkTemplatedEmail — an unknown name fails fast
  with ConfigurationSetDoesNotExist (V2 controller remaps to
  NotFoundException 404, V1 returns 400) before any message is stored
  or relayed.

Validation errors aligned with live AWS
- EmailTags blank Name: BadRequestException 400 "The tag name must be
  specified." (V2) / InvalidParameterValue 400 same message (V1).
- ConfigurationSetName not found: same error code, status, and message
  as AWS.

Raw email handling
- For V2 SendEmail with Raw content (and V1 SendRawEmail), when the
  caller did not provide Destinations, Floci falls back to To/Cc/Bcc
  parsed from the raw MIME via SmtpRelay.parseRawHeaders (extracted
  from the existing relay logic). MIME parsing is only invoked when
  needed (no explicit Destinations or event publishing active).

Internal shape
- New records: model/MessageTag (Name, Value, for EmailTags) and
  model/MessageHeader (Name, Value, for Content.Headers) — kept
  distinct from the resource-tag Tag (Key, Value).
- SesEventPublisher dispatches to SnsService; non-SNS destination
  types log a warning and are skipped (Firehose / EventBridge /
  CloudWatch / Pinpoint), and missing SnsDestination.TopicArn likewise
  warns instead of silently dropping. Failures preserve the throwable
  in the warn log.

Tests
- SesEventPayloadTest covers mail/commonHeaders/headers/tags shape,
  per-event filtering, and the headers/tags propagation paths.
- SesServiceMergeEmailTagsTest / SesServiceMergeHeadersTest pin Bulk
  Default vs per-entry merge semantics (tags by Name case-sensitive,
  headers by Name case-insensitive per RFC 5322).
- SesEventPublishingV2IntegrationTest exercises Send / Delivery /
  Bounce / SendOnly / mixed-recipient / disabled-destination /
  V1-MIME-fallback / EmailTags / V1-Tags / Simple.Headers paths
  end-to-end through SES -> SNS -> SQS.
- compatibility-tests/sdk-test-java/SesEventPublishingTest validates
  SendEmail with EmailTags/Headers and SendBulkEmail with per-entry
  ReplacementHeaders override using AWS Java SDK V2 clients.

* fix(ses): address Copilot review on upstream PR #1106

- SesService.validateConfigurationSet: clarify the Javadoc — the
  helper always throws with httpStatus = 400, and the V2 controller's
  remapV1Exception is what turns ConfigurationSetDoesNotExist into
  NotFoundException 404. The previous "(404 in V2, 400 in V1)" hint
  read as if the helper itself picked the status, which is misleading.
- SesController.parseEmailTagsArray: reject non-object entries with
  "<fieldName> entries must be JSON objects.", mirroring the existing
  parseHeadersArray check. Previously a string/number element would
  hit the blank-Name path and report a less specific message.
- SesService.mergeHeaders / mergeEmailTags: also skip entries whose
  name is the empty string, not just null. Both parsers reject blank
  names at the boundary, but defending the merge helpers keeps them
  safe for direct callers (e.g., future tests) and matches the intent
  of the boundary validation.
2026-06-01 00:20:37 -05:00
Kenshin Okinaka bd6ec2d5c6 feat(ses): add SES V2 configuration set event destination operations (#1079)
* feat(ses): add SES V2 configuration set event destination operations

Implement CreateConfigurationSetEventDestination, GetConfigurationSetEventDestinations,
UpdateConfigurationSetEventDestination, and DeleteConfigurationSetEventDestination on
the SES V2 REST JSON API. Event destinations are stored on the configuration set;
validation and error messages mirror the real AWS SESv2 responses. Includes REST
integration, service unit, and AWS SDK compatibility tests.

* fix(ses): return defensive copy from event destination getter and preserve order on update

GetConfigurationSetEventDestinations now returns an unmodifiable copy so callers
cannot mutate stored state outside the service. UpdateConfigurationSetEventDestination
replaces the destination in place (by index) instead of remove+add, keeping the
list order stable when a configuration set has multiple event destinations.
2026-05-29 18:08:59 -05:00
Fred PeñaandHector Ventura 76edd1f78b feat: add global CORS filter for browser-based local development (#849)
* feat: add global CORS filter for browser-based local development

Introduces a JAX-RS filter that adds CORS headers for configured origins,
enabling browser clients to call Floci directly during local development.
Service-level CORS configurations take precedence as the filter only fills
missing headers.

Configurable via EXTRA_CORS_ALLOWED_ORIGINS (or floci.security.extra-cors-allowed-origins)
with optional extra allowed/exposed headers and a disable flag.

* feat: fix hit for cors by each request

---------

Co-authored-by: Hector Ventura <hectorvent@gmail.com>
2026-05-29 00:35:50 -05:00
nblomquist 9d1e24a582 feat(kms) Add KMS Grant APIs (#1073)
* test(kms): add grant compatibility contracts

* feat(kms): support empty ListGrants

* feat(kms): add CreateGrant and persisted ListGrants round trip

* test(kms): add create grant round trip coverage

* feat(kms): add grant pagination, filters, and ListRetirableGrants

* test(kms): add pagination, filter, and retirable grant coverage

* feat(kms): add RevokeGrant administrative delete

* test(kms): add RevokeGrant unit and integration coverage

* feat(kms): add RetireGrant with token and key+grant retirement paths

* docs(kms): document grant lifecycle operations and enforcement scope

* fix(kms): include RetiringPrincipal in ListGrants response

The handleListGrants handler was omitting RetiringPrincipal from the
JSON response even when the grant had one set. This meant grants
created with a retiring principal were invisible through ListGrants,
while ListRetirableGrants worked fine. Adds the missing serialization
to match the GrantListEntry AWS spec.
2026-05-28 18:36:02 -05:00
Shubham Srivastava 5a9c30eb58 feat(opensearch): round-trip VPC/security/encryption options and per-family instance type metadata (#1039)
Closes the follow-ups from #1025: domain option blocks now survive
CreateDomain → DescribeDomain, and DescribeInstanceTypeLimits returns
family-appropriate metadata instead of one canned EBS response.

- VPCOptions, AdvancedSecurityOptions, EncryptionAtRestOptions,
  NodeToNodeEncryptionOptions, and DomainEndpointOptions now round-trip
  through the management API. Real SDK clients (Terraform / CDK / Pulumi)
  read these back to detect drift; previously they were silently dropped.
- Master passwords are accepted but never echoed back, matching AWS.
- AdvancedSecurityOptions.Enabled + InternalUserDatabaseEnabled without a
  master user is rejected with ValidationException, as is
  CustomEndpointEnabled without a CustomEndpoint value.
- New OpenSearchInstanceTypes catalog drives DescribeInstanceTypeDetails
  and DescribeInstanceTypeLimits. or1.* now reports s3-backed storage
  with the larger 8-36 TiB ceiling AWS documents; i3.* reports
  instance-store; everything else stays EBS at 3584 GiB. Unknown types
  fall back to a generic EBS spec instead of 404'ing.
- Floci still boots one Docker container per domain regardless of
  instance type, but the management metadata now matches AWS so
  introspection tools work correctly.

Tests: 60 OpenSearch tests pass. New: 6 OpenSearchInstanceTypesTest unit
tests + 6 OpenSearchDomainOptionsIntegrationTest end-to-end + 2
or1 / EBS instance-type-limit integration tests.

Live Docker validation: VPC + Encryption + N2N + Endpoint round-trip
on a real running domain; or1.2xlarge.search returns s3-backed/36864 GiB
while m6g.large.search returns ebs/3584 GiB; FGAC validation fires
correctly when MasterUserName is omitted.
2026-05-28 18:33:26 -05:00
Hector Ventura a0a30a26f8 docs: add Neptune service page and fix missing index entries (#950, #951) (#1056)
- Create docs/services/neptune.md: 8 supported actions, configuration
  table (proxy ports, Docker image, network), Docker Compose snippet,
  AWS CLI + gremlin-python + boto3 examples, and Out of Scope section
- Add Neptune to mkdocs.yml nav (after Glue)
- Add Neptune row to docs/services/index.md service matrix
- Add missing EventBridge Pipes row to docs/services/index.md
2026-05-26 18:08:06 -05:00
Shubham Srivastava 89d405316d feat(opensearch): support OpenSearch 3.x, validate engine versions, real ES 7.10 OSS image (#1025)
Centralizes engine versions in a new OpenSearchVersions catalog and
threads them through CreateDomain / UpdateDomainConfig / UpgradeDomain
validation plus per-version Docker image resolution.

- Adds OpenSearch 3.0–3.6 and 2.15 / 2.17 / 2.19 to the supported list;
  default version is now OpenSearch_2.19 (was 2.11).
- EngineVersion now maps to a concrete image tag at start time, so
  CreateDomain --engine-version=OpenSearch_3.6 actually pulls
  opensearchproject/opensearch:3.6.0 instead of always pulling the
  default 2.x rolling tag.
- Elasticsearch_7.10 / 7.9 / 7.8 now resolve to their OSS images on
  docker.elastic.co; previously these versions were advertised but the
  service silently ran an OpenSearch 2.x container under the hood.
- OpenSearch 2.12+ start scripts require OPENSEARCH_INITIAL_ADMIN_PASSWORD
  even when the security plugin is disabled. Set automatically.
- The Elasticsearch OSS distribution ships without x-pack, so any xpack.*
  setting is rejected as an unknown setting at boot. Don't touch xpack
  env on Elasticsearch_* domains.
- CreateDomain / UpdateDomainConfig / UpgradeDomain now reject unknown
  engine versions and unsupported upgrade hops with ValidationException.
- GetCompatibleVersions returns the full source→targets matrix when
  domainName is omitted and a single domain-scoped row when set, matching
  AWS's documented behavior.
- INSTANCE_TYPES catalog gains Graviton2/3 (m6g, r6g, c6g, m7g, r7g, c7g)
  and or1.* OpenSearch-optimized families that AWS now exposes.

Tests: 44 OpenSearch tests pass (31 integration + 13 new
OpenSearchVersionsTest unit tests). All four engine version paths
exercised live against Docker (OS 3.6, OS 2.11, ES 7.10 OSS, unknown
version rejection).
2026-05-25 11:47:06 -05:00
kyounghoonJang 255b41bca8 feat(kms): add RotateKeyOnDemand support (#990) 2026-05-24 14:34:51 -05:00
Sid be01ee0747 docs(pipes): add documentation and navigation for EventBridge Pipes (#1001) 2026-05-23 09:29:17 -05:00
tatakaisun fa31be9cf9 docs: add resource groups tagging service docs (#976) 2026-05-21 18:20:50 -05:00
tatakaisun 41f69a4f9d docs: add transcribe service documentation (#975) 2026-05-21 18:20:09 -05:00
Hector Ventura b200280a83 feat(cloudfront): implement CloudFront service emulation (#969)
* feat(cloudfront): implement CloudFront service emulation

Adds full CloudFront emulation covering both core and extended operations using the REST XML protocol (2020-05-31 API).

Core resources:
- Distributions (CRUDL, copy, enable/disable, ETag concurrency)
- Cache Behaviors (default + ordered)
- Invalidations (create, get, list)
- Origin Access Controls and Origin Access Identities
- CloudFront Functions (create, update, publish, test, describe)

Extended resources:
- Continuous Deployment Policies
- Public Keys and Key Groups
- Realtime Log Configs (non-standard POST-based get/delete)
- Streaming Distributions (legacy RTMP, enforces disabled before delete)
- Field-Level Encryption Configs and Profiles
- Monitoring Subscriptions

Infrastructure:
- Registers CloudFrontController in ResolvedServiceCatalog as REST_XML
- Adds CloudFrontServiceConfig and CloudFrontStorageConfig to EmulatorConfig
- Adds CLOUDFRONT namespace constant to AwsNamespaces
- Registers CloudFrontService for GraalVM runtime initialization to avoid SecureRandom heap-baking in native builds
- Wires storage through StorageFactory with per-resource JSON files
- Adds cloudfront.md documentation page

* docs: revert docker-compose.yml
2026-05-20 23:12:03 -05:00
Federico Mariani 96a6fa6517 feat(config): add AWS Config service emulation (#934)
* feat(config): add AWS Config service emulation (#913)

* docs: add AWS Config service page and align service counts across all docs

Add docs/services/config.md with all 20 supported actions, CLI examples,
and configuration reference. Add 5 services that had doc pages but were
missing from the service matrix (Textract, Pricing, Cost Explorer, CUR,
BCM Data Exports). Reconcile service count to 51 across README,
docs/index.md, and docs/services/index.md.
2026-05-20 17:15:38 -05:00
Prakhar Kapoor 15720e2ee6 feat(apigateway): implement account management endpoints and models (#867)
* feat(apigateway): implement account management endpoints and models
* feat(apigateway): enhance patch operation validation and update throttle settings defaults
* feat(api-gateway): add account management operations to API Gateway v1
* feat(api-gateway): add compatibility tests for account management and update logic
* feat(api-gateway): add missing import for assertions in account compatibility test
2026-05-17 23:42:09 -05:00
Hector Ventura a1d3c82dfa chore: conventionalcommits enforment (#869) 2026-05-16 14:23:09 -05:00
Kenshin Okinaka 010bbd15cd feat(ses): add v2 PutAccountSuppressionAttributes (#853)
Implements PUT /v2/email/account/suppression so callers can change the
account-level suppression list reasons (BOUNCE / COMPLAINT). Entries
are persisted per region in ses-account-suppression.json via a new
AccountSuppressionAttributes model.

GetAccount's response is extended with a SuppressionAttributes object
that carries the stored SuppressedReasons. The setting itself is
metadata-only — floci does not synthesise bounce/complaint events so
no auto-suppression is triggered; the configuration round-trips for
SDK users and tooling that introspects account-level settings.

Behaviour aligned with real-AWS verification:

- SuppressedReasons accepts BOUNCE / COMPLAINT, validated against the
  AWS-canonical nested "Member must satisfy constraint:
  [Member must satisfy enum value set: [BOUNCE, COMPLAINT]]" wording
  (verbatim match against real AWS).
- SuppressedReasons may be omitted (treated as empty list) or supplied
  as an empty array (clears the reasons) — both return 200.
- Non-textual array members (JSON null, numeric, etc.) are rejected
  with BadRequestException.
- Fresh regions report the AWS-default [BOUNCE, COMPLAINT] via
  GetAccount; an explicit PUT (including an empty list) overrides it.
- The optional ValidationAttributes body field is accepted but not
  parsed (Tier S scope).

Tests:
- SesV2IntegrationTest gains nine cases covering store-and-list,
  clear-with-empty-array, missing field defaulting to empty, invalid
  Reason (with the AWS-canonical nested message asserted), non-array
  SuppressedReasons, JSON null array member, numeric array member,
  optional ValidationAttributes, and the default-on-fresh-region
  assertion in the existing getAccount case.
- SesAccountSuppressionTest exercises the Java SDK round trip and an
  explicit empty list through SesV2Client; @BeforeAll captures the
  caller's existing SuppressedReasons and @AfterAll restores it with
  failures surfaced so a real-AWS run cannot silently leave the
  account with auto-suppression disabled.
2026-05-15 22:59:14 -05:00
Shubham Srivastava 6d36f66e5f feat(cur, bcm-data-exports): add Cost and Usage Reports + BCM Data Exports (#850)
Implements PR 3 of the 3-PR billing-API scope discussed in #791. Adds
two service surfaces that share one underlying export pipeline:

- `cur:*` — legacy Cost and Usage Reports management plane, target
  prefix `AWSOrigamiServiceGatewayService.*`.
- `bcm-data-exports:*` — modern Billing and Cost Management Data
  Exports management plane, target prefix
  `AWSBillingAndCostManagementDataExports.*`.

Both run as JSON 1.1 services dispatched through the existing
`AwsJson11Controller`.

## Operations

CUR (7):

- `PutReportDefinition`, `ModifyReportDefinition`,
  `DescribeReportDefinitions`, `DeleteReportDefinition`
- `TagResource` / `UntagResource` / `ListTagsForResource` (stubs)

BCM Data Exports (7):

- `CreateExport`, `GetExport`, `ListExports`, `UpdateExport`,
  `DeleteExport`
- `ListExecutions`, `GetExecution`

AWS-shaped error codes throughout: `DuplicateReportNameException`,
`ReportLimitReachedException`, `ReportNotFoundException`,
`ResourceNotFoundException`, `ValidationException`,
`UnknownOperationException`. Storage keys are account-scoped
(`<accountId>::<region>::<reportName>` for CUR;
`<accountId>::<exportArn>` and `<accountId>::<exportArn>::<executionId>`
for BCM) so both services participate in Floci's per-account
isolation.

## Parquet emission

The same `ResourceUsageEnumerator` SPI introduced in #832 (Cost
Explorer) backs the Parquet artifact:

1. `EmissionEngine` collects `UsageLine` rows from every
   `@ApplicationScoped` enumerator bean.
2. `FocusRowProjector` projects them into FOCUS 1.2 / CUR 2.0 column
   shape, reusing #821's bundled Pricing snapshot for unit prices.
3. Rows are staged as newline-delimited JSON in
   `s3://floci-cur-staging/...` via Floci's S3 service — escape-safe
   for tags, descriptions, and resource identifiers.
4. The `floci-duck` sidecar runs
   `COPY (SELECT * FROM read_json_auto('s3://...')) TO 's3://...'
   (FORMAT PARQUET)` so Parquet writes happen inside DuckDB, not in
   the Java process. This avoids pulling Apache Parquet / Hadoop /
   Avro into Floci's classpath and keeps the native binary footprint
   unchanged.
5. Staging objects are removed in a best-effort `finally` block; each
   run carries a fresh `runId` (UUID) in both staging and
   destination keys so concurrent emissions cannot clobber each other.

The emission engine is shared between CUR and BCM, but the management
planes are otherwise independent — they each own their own validation,
storage, and JSON dispatch.

## Run modes

`FLOCI_SERVICES_CUR_EMIT_MODE` and
`FLOCI_SERVICES_BCM_DATA_EXPORTS_EMIT_MODE`:

- `synchronous` (default): emit on every report/export mutation
- `daily`: emit once per 24h via a CUR-owned single-thread
  `ScheduledExecutorService` — separate from the EventBridge
  Scheduler dispatcher, so internal billing exports do not surface as
  user-visible Scheduler resources.
- `off`: management plane only

Emission failures never roll back the management mutation. Failures
surface as `ReportStatus.LastStatus = ERROR` on CUR and
`Execution.ExecutionStatus.StatusCode = DELIVERY_FAILURE` on BCM.

## Tests

42 new tests across 5 classes:

- `CurIntegrationTest` (11) — full CRUD on report definitions,
  duplicate / not-found / validation paths
- `BcmDataExportsIntegrationTest` (16) — full CRUD on exports +
  executions, all validation paths
- `FocusRowProjectorTest` (9) — pure-unit projection: usage rows,
  USD-denominated record types (Credit / Refund / Tax), missing
  resource id, tags JSON, billing-period anchoring, region+account
  flow-through, rate cache reuse
- `ParquetEmitterIntegrationTest` (3) — DuckDB readback,
  staging cleanup, concurrent run isolation
- `CurEmissionIntegrationTest` (3) — end-to-end:
  PutReportDefinition -> emit -> Parquet readable through DuckDB;
  ReportStatus updates; CreateExport produces an execution record

Full Floci suite stays green (4194/4194, excluding the pre-existing
local-env flakes documented during PR #821 / #832 and the two
duck-required tests added here that need the `floci-duck` sidecar
and a fixed Floci HTTP port to verify cross-container S3 access).

## Documentation

- `docs/services/cur.md` — operations, validation rules, emission
  pipeline, configuration, examples.
- `docs/services/bcm-data-exports.md` — operations, validation,
  execution lifecycle, configuration, examples.
- README service table updated with rows for both, plus a note that
  CUR / BCM Data Exports share one Parquet engine.

Refs: https://github.com/orgs/floci-io/discussions/791
Refs: #823
Builds on: #821, #832
2026-05-15 22:55:11 -05:00
Marvelous Ikponmwosa cf0db6edc9 add ValidateStateMachineDefinition action (#845)
* add ValidateStateMachineDefinition action
* populate diagnostic.location with /States/<state>/<field>
* addressed review
2026-05-14 23:36:37 -05:00
Hector Ventura e725f38ac7 feat(s3): full SelectObjectContent evaluator with floci-duck integration (#835)
- Add recursive WHERE evaluator: AND, OR, NOT, LIKE, BETWEEN, IN, IS NULL,
  >=, <=, <> — replaces single-regex implementation
- Add JSON Lines and JSON array input support
- Add cross-format output (CSV→JSON, JSON→CSV)
- Emit real BytesScanned / BytesReturned stats
- Route CSV (USE headers) and JSON through floci-duck when available;
  fall back to Java evaluator in standalone mode
- Route Parquet S3 Select through floci-duck (existing)
- Move FlociDuckManager to services/floci/ and introduce FlociDuckClient
  as a shared duck HTTP client for Athena and S3 Select
- Promote CsvParser to core/common and consolidate AthenaService.splitCsv()
- Add compatibility tests: S3SelectTest (19 tests via S3AsyncClient)

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-05-14 20:32:27 -05:00
Marvelous Ikponmwosa b25fcc28a2 feat(eventbridge): add UpdateEventBus action (#834)
* feat(eventbridge): add UpdateEventBus action

* address Copilot review feedback on UpdateEventBus
2026-05-14 20:31:35 -05:00
Shubham Srivastava 6acbf1f2c2 feat(ce): add Cost Explorer service (#832)
Implements the `AWSInsightsIndexService.*` JSON 1.1 surface backed by
synthesizing cost and usage from Floci's existing resource state
multiplied by the bundled AWS Pricing snapshot (#821). Covers the nine
Cost Explorer operations the FinOps tooling ecosystem most commonly
exercises:

- `GetCostAndUsage` / `GetCostAndUsageWithResources` — full
  `TimePeriod`, `Granularity` (DAILY / MONTHLY / HOURLY),
  `Metrics` (UnblendedCost / BlendedCost / AmortizedCost /
  NetUnblendedCost / NetAmortizedCost / UsageQuantity /
  NormalizedUsageAmount), `GroupBy` (DIMENSION / TAG /
  COST_CATEGORY), and the recursive `Filter` expression tree
  (`And` / `Or` / `Not` / `Dimensions` / `Tags` / `CostCategories`).
- `GetDimensionValues` — returns the dimension values present in the
  synthesized data; honors filters and search strings.
- `GetTags` — returns tag keys / values across enumerated resources.
- `GetReservationCoverage` / `GetReservationUtilization` — zero-totalled
  stubs so callers that hit these endpoints during smoke tests don't
  fail on `UnknownOperationException`.
- `GetSavingsPlansCoverage` / `GetSavingsPlansUtilization` — same
  stubbed shape.
- `GetCostCategories` — empty list (cost-category management is
  out-of-scope for this PR).

`GROUP_BY=RECORD_TYPE` distinguishes `Usage`, `Credit`, `Tax`,
`Refund`, `DiscountedUsage`, and the four `SavingsPlan*` variants.
`Tax` / `Refund` / `DiscountedUsage` / `SavingsPlan*` are reserved for
follow-up PRs; `Credit` is emitted when
`FLOCI_SERVICES_CE_CREDIT_USD_MONTHLY > 0`, capped at the synthesized
monthly usage so net cost never goes below zero.

## Architecture

A new SPI lives in `core/common/`:

    public interface ResourceUsageEnumerator {
        Stream<UsageLine> enumerate(Instant start, Instant end, String region);
    }

CDI auto-discovers all `@ApplicationScoped` beans implementing it.
Cost Explorer iterates `Instance<ResourceUsageEnumerator>` per request,
so adding a new Floci service with cost data is a matter of dropping a
new enumerator bean next to the service — zero changes to
`CostExplorerService`. The same enumerators will feed the upcoming CUR
and BCM Data Exports Parquet writer (#823) without duplication.

The bundled enumerators are:

- `Ec2UsageEnumerator` — `BoxUsage:<instanceType>` * hours per running
  instance, priced from the Pricing snapshot.
- `S3UsageEnumerator` — `TimedStorage-ByteHrs` * GB-month per bucket,
  priced from the snapshot.
- `LambdaUsageEnumerator` — catalog-only line per function (zero
  quantity until invocation tracking lands in a follow-up).
- `UnpricedServicesEnumerator` — emits zero-quantity catalog rows for
  the remaining ~30 Floci services so they appear in
  `GetDimensionValues SERVICE` without contributing billed cost.

Each priced enumerator additionally emits a zero-quantity catalog
line so the service shows up in `GetDimensionValues SERVICE` even
when no resources exist.

## Tests

`CostExplorerIntegrationTest` covers all nine operations via
RestAssured wire-format assertions: granularity bucketing,
filter-expression evaluation, group-by combinations, dimension and
tag listings, RI / SP stubs, validation errors. 20 tests, all green.

The full Floci test suite stays green with the additions
(4030 tests run, 0 failures, 0 errors, excluding the pre-existing
local-env flakes documented during PR #821).

Refs: https://github.com/orgs/floci-io/discussions/791
Refs: https://github.com/floci-io/floci/issues/822
2026-05-14 20:29:37 -05:00
Shubham Srivastava e0224e93e6 feat(pricing): add AWS Price List Service support (#821)
Implements the `AWSPriceListService.*` JSON 1.1 surface backed by a
bundled static snapshot on the classpath. Covers the five public
operations: `DescribeServices`, `GetAttributeValues`, `GetProducts`,
`ListPriceLists`, and `GetPriceListFileUrl`, with pagination (Base64
offset tokens) and the array-of-JSON-strings `PriceList` shape the
real AWS SDKs expect.

Rationale: Floci today cannot back FinOps tooling (cost detection,
budget guards, CUR parsers, etc.) because the billing APIs are
absent. Pricing is the stateless prerequisite for the Cost Explorer
and CUR services that follow — cost lines are synthesized as
`resource state x pricing snapshot`, so the snapshot data path is the
foundation.

Snapshot layout on the classpath (and mirrored on the filesystem
when `FLOCI_SERVICES_PRICING_SNAPSHOT_PATH` is set):

    pricing-snapshots/services.json
    pricing-snapshots/attribute-values/<ServiceCode>/<Attr>.json
    pricing-snapshots/products/<ServiceCode>/<Region>.json
    pricing-snapshots/price-lists/<ServiceCode>.json

The bundled snapshot is intentionally minimal — `AmazonEC2`,
`AmazonS3`, and `AWSLambda` in `us-east-1` — to exercise SDK parsing
and filter logic without bloating the image. Users needing broader
coverage point the override env var at a full snapshot generated
from the AWS Price List bulk API.

Wiring follows the existing JSON 1.1 stateless pattern (Textract,
Secrets Manager): descriptor in `ResolvedServiceCatalog`, handler
injected into `AwsJson11Controller`, service config on
`EmulatorConfig.ServicesConfig`. No new protocol, no changes to
existing services, no new runtime dependencies.

Tests: `PricingIntegrationTest` covers all five operations via
RestAssured JSON 1.1 wire-format assertions, including validation
errors, unknown-service errors, filter matching, and pagination
tokens (17 tests, all green).

Refs: https://github.com/orgs/floci-io/discussions/791
2026-05-13 01:34:19 -05:00
Marvelous Ikponmwosa e89777b8a2 feat(eventbridge): add TestEventPattern action (#824)
* feat(eventbridge): add TestEventPattern action

Exposes the existing rule pattern matcher as a public API so callers can
test whether a sample event would match an event pattern without firing
any targets. Adapts the AWS event envelope (lowercase source / detail-type
/ detail / resources) to the internal entry shape and delegates to the
same matchesPattern() helper that powers PutEvents rule dispatch.

Returns {"Result": <bool>} on success, InvalidEventPatternException (400)
on malformed pattern or missing event.

* fix(eventbridge): reject empty EventPattern in TestEventPattern

AWS marks EventPattern as a required field for TestEventPattern. The
previous implementation accepted null/empty values and silently delegated
to matchesPattern(), which returns true for blank patterns — turning the
API into an unintended match-all. matchesPattern()'s blank-is-match-all
behavior is intentional for rule dispatch (rules with no EventPattern are
scheduled rules that fire on every match attempt), but exposing it here
violates the spec.

Now throws InvalidEventPatternException (400) when EventPattern is null
or blank. Verified end-to-end via boto3: the typed exception is raised
client-side. The integration test that asserted the wrong behavior is
flipped, and a new test covers the missing-field case.

* fix(eventbridge): honor account/region from event and reject non-object Events
2026-05-12 20:15:56 -05:00
Kenshin Okinaka 944f82a6a4 feat(ses): add v2 suppression list endpoints (#813)
* feat(ses): add v2 suppression list endpoints

Implements the v2 SES suppression list management plane at
/v2/email/suppression/addresses:

- PUT  /v2/email/suppression/addresses                 PutSuppressedDestination
- GET  /v2/email/suppression/addresses/{EmailAddress}  GetSuppressedDestination
- DELETE /v2/email/suppression/addresses/{EmailAddress} DeleteSuppressedDestination
- GET  /v2/email/suppression/addresses                 ListSuppressedDestinations
                                                       (repeated Reason filter)

Entries are persisted per region in ses-suppression.json. A repeat Put for
the same EmailAddress updates the existing entry's Reason and LastUpdateTime.
List responses are sorted by LastUpdateTime then EmailAddress for stable
output across runs.

Behaviour aligned with real AWS responses:

- EmailAddress is silently trimmed of leading/trailing whitespace on Put
  / Get / Delete; whitespace-only is rejected with BadRequestException.
- Reason validation errors use the AWS-canonical "1 validation error
  detected: Value at '<field>' failed to satisfy constraint: Member must
  satisfy enum value set: [BOUNCE, COMPLAINT]" wording, with the nested
  "Member must satisfy constraint: [...]" wrapping AWS emits for the
  list-typed reasons filter.
- ListSuppressedDestinations accepts a repeated Reason query param (the
  Java SDK's .reasons(...) varargs serialise this way) and applies
  OR-semantics across the supplied values.
- GetSuppressedDestination and DeleteSuppressedDestination return
  NotFoundException with "Email address <X> does not exist on your
  suppression list." for unknown addresses — Delete is not idempotent
  on AWS so floci matches.

SendEmail integration is intentionally out of scope: suppressed addresses
are still delivered locally so that existing send tests remain unaffected.
A follow-up PR can wire suppression checks into the send path along with
the PutAccount/ConfigurationSetSuppressionOptions configuration endpoints.

Tests:
- SesSuppressionV2IntegrationTest covers Put/Get/Delete lifecycle, List
  sort order, single- and multi-Reason filter (with OR semantics), Put
  updates, trim-on-Put, idempotent-Get-on-known, and validation errors.
- SesSuppressionListTest exercises the same surface through the Java SDK
  v2 SesV2Client.

* fix(ses): reject null and non-object bodies on PutSuppressedDestination

Jackson's NullNode.asText("default") returns the literal string "null"
rather than the default, so a body like
  {"EmailAddress": null, "Reason": "BOUNCE"}
silently stored an entry under the email address "null". Validate the
body is a JSON object via requireJsonObject and require both
EmailAddress and Reason to be present and textual via a new
readRequiredStringField helper.

SesSuppressionV2IntegrationTest gains three cases covering null
EmailAddress, null Reason, and a non-object root body.
2026-05-12 19:44:31 -05:00