Commit Graph
177 Commits
Author SHA1 Message Date
kotov228 97b64a1d3b feat: add AWS Lightsail emulation (#1583)
* feat(lightsail): add AWS Lightsail emulation

* fix(lightsail): align error responses with AWS

* fix(lightsail): address review edge cases

* fix(lightsail): reject attached disk reattach

* fix(lightsail): reject static ip reattach

* fix: register lightsail docs handler
2026-07-10 20:43:42 -05:00
TiM 13772fb5f8 feat(ecs): resolve containerDefinitions[].secrets at task launch (#1687)
RegisterTaskDefinition now parses and stores containerDefinitions[].secrets
(name + valueFrom) and round-trips them on register/describe as references,
matching AWS (the resolved values are never returned).

At RunTask launch, EcsContainerManager resolves each secret to an environment
variable through the in-process SsmService / SecretsManagerService (the same
local resolution CodeBuildRunner already uses, no extra HTTP hops):

- SSM parameter by name or full ARN -> Parameter.value
- Secrets Manager full ARN -> SecretString
- a full ARN's own region is used, so cross-region references resolve correctly
- env precedence: task-def environment < resolved secrets < RunTask container
  override environment (override still wins on a name collision)

When a referenced secret/parameter cannot be resolved the launch fails the way
AWS does: no container is started and the task goes STOPPED with a
ResourceInitializationError stoppedReason, rather than silently starting the
container without the variable.

Deferred (noted in floci-io/floci#1624): the Secrets Manager valueFrom selector
suffix (:json-key:version-stage:version-id) is not yet parsed; such a valueFrom
is resolved as the plain secret.

Adds handler round-trip tests, container-manager resolution / override /
cross-region unit tests, a stopped-task failure test, and Java SDK
compatibility coverage.
2026-07-10 20:41:43 -05:00
Kenshin Okinaka efc9453fd7 fix(ses): populate VerificationStatus in v2 ListEmailIdentities (#1722)
* fix(ses): populate VerificationStatus in v2 ListEmailIdentities

ListEmailIdentities built each item with only IdentityType / IdentityName /
SendingEnabled, so VerificationStatus always serialized as null and clients had
to call GetEmailIdentity per identity. Populate it from the identity's stored
status (mapped to the v2 enum via toV2Status), and refresh each identity's
state the same way GetEmailIdentity does so the list stays consistent (e.g. a
domain that transitioned to SUCCESS via its DKIM records).

* fix(ses): derive SendingEnabled from verification status in v2 ListEmailIdentities

SendingEnabled was hard-coded to true, so a not-yet-verified identity was
reported as sendable, which is inconsistent now that VerificationStatus is
populated. AWS returns SendingEnabled=true only when the identity is verified
(VerificationStatus SUCCESS) and false otherwise (PENDING/FAILED), matching the
VerifiedForSendingStatus logic already used by GetEmailIdentity. Derive it the
same way here.
2026-07-09 23:54:43 -05:00
Kenshin Okinaka 312fe377fc feat(ses): implement PutEmailIdentityConfigurationSetAttributes for SES v2 (#1698)
* feat(ses): implement PutEmailIdentityConfigurationSetAttributes for SES v2

Add the v2 PutEmailIdentityConfigurationSetAttributes API and wire an email
identity's default configuration set into the send path so its event
destinations fire. This includes Raw sends with no explicit FromEmailAddress:
the configuration set is re-resolved from the MIME "From" header once parsed,
so an omitted-sender Raw send still routes through the identity default.
Unknown identities surface the AWS-matched error message.

* test(ses): log instead of swallowing cleanup failures in the identity config-set compat test

* docs(ses): clarify default config-set precedence and clear-on-null semantics

* fix(ses): fail send when an identity's default configuration set was deleted

Per the SES Developer Guide, sending through an identity whose default
configuration set has been deleted fails with a bad-request error. The default
resolution was silently dropping the stale association; make it throw
BadRequestException ("Configuration set <name> does not exist.") to match AWS.
2026-07-08 23:23:28 -05:00
Jason van Zyl c3980ebab0 feat(scheduler): dispatch ECS targets to RunTask (#1733)
* feat(scheduler): dispatch ECS targets to RunTask

* fix(scheduler): preserve ECS target parameters
2026-07-06 21:40:24 -05:00
Jason van Zyl 3a31439a84 fix(ec2): honor launch template default version updates (#1704) 2026-07-06 21:39:37 -05:00
Jason van Zyl ab32758cfe fix(autoscaling): align active instance refresh behavior (#1598)
* fix(autoscaling): reject active refresh config updates

* fix(autoscaling): align active refresh SDK error shape

* fix(autoscaling): reject version-only launch template updates

* fix(autoscaling): match refresh config validation message
2026-07-06 21:00:50 -05:00
Jason van Zyl c233eb4891 feat(ec2): add instance metadata catalog and architecture parity (#1596)
* fix(ec2): expose instance processor architectures

* feat(ec2): add instance type metadata catalog

* fix(ec2): enforce instance architecture parity

* fix(ec2): tighten instance metadata parity
2026-07-05 09:26:38 -05:00
Beytullah GunduzandBeytullah Gunduz 89fadbad81 feat(cloudwatch): add Logs Insights query support (#1448)
* feat(cloudwatch): add Logs Insights query support

Implement StartQuery/GetQueryResults/StopQuery for CloudWatch Logs so
clients using Logs Insights (e.g. boto3 start_query + get_query_results)
work against Floci instead of receiving UnsupportedOperation.

LogsInsightsQuery is a minimal engine covering the common subset: fields,
filter (= / !=), sort, dedup, limit; it resolves @timestamp/@message and
dotted JSON paths (e.g. params.job_id, level). StartQuery times are epoch
seconds while event timestamps are millis, scaled accordingly.

Queries follow a time-driven lifecycle: results are computed eagerly, but
a query reports Running until a configurable completion delay elapses
(FLOCI_SERVICES_CLOUDWATCHLOGS_QUERY_COMPLETION_DELAY_MS, default 0 =
instant for local dev), then Complete; StopQuery cancels a running query
and otherwise returns AWS-faithful errors (InvalidParameterException when
already ended, ResourceNotFoundException for an unknown id). Status is
computed on read from an injectable clock, with no background threads.
GetQueryResults returns ResourceNotFoundException for unknown ids,
reports recordsMatched independent of the Running/Cancelled row masking,
hands out a defensive copy of result rows, and drops rows once cancelled.
Results are cached by queryId with LRU eviction.

Covered by unit tests and an AWS SDK v2 compatibility test exercising the
full StartQuery/GetQueryResults/StopQuery lifecycle (stable against both
instant and delayed completion).

* test(cloudwatch): cover Logs Insights search across multiple log groups

Verify a single StartQuery spanning several log groups finds the same
params.id wherever it was logged (results merged and globally sorted by
@timestamp), and that a matching event in an un-queried group is excluded.

* test(cloudwatch): cover Logs Insights query-language edge cases

Add unit tests for limit (applied after sort), ascending sort on a nested
JSON field, the default @timestamp/@message projection, missing-field
handling (empty projection plus null-safe inequality filtering), graceful
ignoring of unsupported commands (parse/stats), and the recordsScanned vs
recordsMatched statistics.

* fix(cloudwatch): deterministic Logs Insights ordering for same-ms events and dedup

Tie-break the @timestamp/@ingestionTime sort comparators by ingestion sequence
then eventId (matching the event store's EVENT_ORDER), and apply the AWS-documented
default @timestamp desc sort when a dedup stage has no preceding sort — so the
surviving duplicate is the newest, deterministically, rather than depending on
storage-scan order.

* fix(cloudwatch): validate log groups and harden Logs Insights query parsing

StartQuery now de-duplicates the requested log groups (the same group can
arrive via multiple selectors) so it is scanned and counted once, and it
returns ResourceNotFoundException for a log group that does not exist
instead of a successful empty query — matching real AWS. The stage parser
splits on pipes only outside quotes, so a filter value containing '|'
(e.g. filter x = 'a|b') is no longer broken into fragments.

StartQuery still accepts multiple selectors and de-duplicates group names
service-side; strict AWS mutual-exclusivity rejection (InvalidParameterException
for more than one of logGroupName/logGroupNames/logGroupIdentifiers) is deferred
to a handler-side follow-up, since the handler collapses all three selectors
into one service argument.

* fix(cloudwatch): reject empty StartQuery selectors and parse quoted filter operators

StartQuery now rejects a request with no usable log-group selector
(InvalidParameterException) instead of returning a successful empty query.
parseFilter finds the equality/inequality operator outside quoted values,
so a value that itself contains '=' / '==' / '!=' (e.g. filter x = 'a==b')
is no longer misparsed.

* fix(cloudwatch): reject StartQuery requests with more than one log-group selector

AWS requires exactly one of logGroupName, logGroupNames, or logGroupIdentifiers.
The handler now rejects a request that provides more than one selector type with
InvalidParameterException, instead of silently querying the union. The
zero-selector case is already rejected by the service.

* fix(cloudwatch): count serialized StartQuery selector fields, not just non-empty ones

The mutual-exclusivity guard counted a selector only when its value was non-blank,
but the merge path added any present field — so a blank logGroupName alongside a
real logGroupNames slipped past the guard. Count serialized fields uniformly (has),
so a blank or empty selector field can't bypass the check; a lone empty selector
still yields no groups and is rejected by the service.

---------

Co-authored-by: Beytullah Gunduz <beytullah-gunduz@users.noreply.github.com>
2026-07-05 08:48:43 -05:00
Ahmed khaled 188854f2df feat(amazonmq): add Amazon MQ broker control plane backed by RabbitMQ (#1642)
* feat(amazonmq): add Amazon MQ broker control plane for RabbitMQ

* feat(amazonmq): provision RabbitMQ container with rollback

Back a broker with a real rabbitmq:3-management container, following the
MSK/ElastiCache container-manager pattern.

- RabbitMqManager starts the container, publishes AMQP (5672) and
  management (15672) ports, and resolves the broker endpoints
- Service branches on the mock flag; real brokers stay
  CREATION_IN_PROGRESS until a readiness poller observes the management
  API answering, then flip to RUNNING
- Rollback on failed provisioning: the manager removes the half-built
  container and the broker is persisted as CREATION_FAILED
- @PreDestroy stops containers on shutdown; DeleteBroker stops and
  removes the container and its storage

Readiness probes the management UI root (no auth) to avoid RabbitMQ's
loopback-only guest user over Docker port mapping.

* feat(amazonmq): seed broker admin user and reject ActiveMQ-only User API

Amazon MQ's standalone User API (CreateUser/DescribeUser/ListUsers/
DeleteUser) applies only to ActiveMQ brokers; AWS rejects it for RabbitMQ
and directs callers to the RabbitMQ web console. CreateBroker now requires
exactly one broker user (validated against AWS password rules) which is
seeded into the container via RABBITMQ_DEFAULT_USER/PASS, sidestepping
RabbitMQ's loopback-only guest restriction.

* test(amazonmq): SDK compatibility test against live RabbitMQ broker

Adds AmazonMqTest exercising the real container path via the AWS SDK MqClient:
CreateBroker provisions a rabbitmq:3-management container, the broker
transitions to RUNNING once its management API answers, endpoints are
published, the ActiveMQ-only User API is rejected, and DeleteBroker tears the
container down. Uses JUnit Assumptions to skip cleanly when Docker is absent.

* fix(amazonmq): harden error handling, persistence, and shutdown teardown

- Redact the provisioning failure 500: log the cause, return a generic AWS
  error envelope instead of leaking e.getMessage() (which can be null).
- Add @JsonIgnoreProperties(ignoreUnknown = true) to Broker, MqUser, and
  BrokerInstance so old persisted snapshots survive field changes.
- Wire RabbitMQ container teardown into EmulatorLifecycle.onStop() via
  RabbitMqManager.stopAll(), alongside the other container managers; the
  service @PreDestroy now only stops the readiness poller.

* docs(amazonmq): add Amazon MQ service page and bump service count to 66

Adds docs/services/amazonmq.md, lists Amazon MQ in the services overview and
README service tables, and updates the "65 -> 66 AWS services" count across
docs/index.md, docs/services/index.md, and README.md.

* fix(amazonmq): reject RebootBroker unless the broker is RUNNING

RebootBroker unconditionally set the broker to RUNNING, so a non-RUNNING
broker (e.g. CREATION_FAILED, which has no backing container) was silently
promoted to RUNNING and never reconciled by the readiness poller. AWS allows
RebootBroker only on a broker in the RUNNING state; guard it and return a 400
otherwise, matching the Amazon MQ API ("You can reboot only a broker with the
RUNNING status").

* fix(amazonmq): close readiness-probe connection and log tolerated failures

isReady() opened an HttpURLConnection but never disconnected it; since the
probe runs every 2s per pending broker this leaked sockets. Disconnect in a
finally block, and log the tolerated failure at debug with broker/URL context
(AGENTS.md: no empty catch; avoid noise in hot paths) instead of swallowing it.

* fix(amazonmq): tear down broker container by deterministic name after restart

containerId is in-memory bookkeeping (intentionally not persisted, since the
Broker model is serialized straight to DescribeBroker and must not leak it).
After an emulator restart it is null, so stopContainer() previously returned
early and left the container running. It now falls back to the deterministic
container name (floci-amazonmq-{brokerId}) so an explicit DeleteBroker still
removes a container left over from a previous run. Documented the field and
added RabbitMqManagerTest covering both the id and name-fallback paths.

* fix(amazonmq): keep admin password in-memory only and fail loudly if absent

The admin password is a secret used solely to seed the RabbitMQ container at
create time. Persisting it (to make it survive a restart) would write the
credential in cleartext to amazonmq-brokers.json, which the project's security
rule prohibits. It stays in-memory only via @JsonIgnore; startContainer (the
only consumer, called from CreateBroker) now throws if the password is absent
rather than seeding a null credential. Added MqUserTest asserting the password
is never serialized and round-trips to null.

* fix(amazonmq): persist broker volumeId/accountId/containerId without leaking them

These internal fields were @JsonIgnore'd, so they were absent from
amazonmq-brokers.json. After a restart in persistent mode volumeId was null
(removeBrokerStorage could not locate the named volume, leaking it) and
accountId was null (the readiness poller wrote brokers via the non-account-aware
path). Unlike the admin password, these are not secrets, so they should persist.

Remove @JsonIgnore so they round-trip through storage, and build the
DescribeBroker response explicitly in the controller so they are still never
exposed to clients (matches MskCluster, which persists volumeId/containerId).
Adds BrokerTest (round-trip) and asserts the describe response omits them.
2026-07-03 00:01:54 -05:00
Hector Ventura b3c54c1854 feat(firehose): return ExtendedS3DestinationDescription and support UpdateDestination (#1710)
* feat(firehose): return ExtendedS3DestinationDescription and support UpdateDestination

The Terraform/Pulumi provider creates delivery streams with
ExtendedS3DestinationConfiguration and reads ExtendedS3DestinationDescription
back after create; Floci parsed the config lossily and only ever emitted
S3DestinationDescription, breaking the provider read. Store the full config
(RoleARN, ErrorOutputPrefix, CompressionFormat, EncryptionConfiguration),
emit it under both wire keys like real AWS, add the required output members
(VersionId, DeliveryStreamType, HasMoreDestinations, DestinationId), and
implement UpdateDestination with version checking.

Refs #1043

* fix(firehose): reject empty destination updates and guard version parse

* fix(firehose): reject partial BufferingHints instead of absorbing defaults

AWS requires SizeInMBs and IntervalInSeconds to be specified together
(firehose service-2.json: "if you specify a value for it, you must also
specify a value for IntervalInSeconds, and vice versa"). The primitive
fields with initializers made a partial payload indistinguishable from a
full one, silently persisting a default over an existing value. Members
are now null-honest boxed Integers, create and update reject one-sided
hints with the declared InvalidArgumentException before any mutation,
and defaults apply only when the whole object is absent.
2026-07-02 23:59:11 -05:00
Robert Stupp 4f4e7be90e fix(iam): enforce STS session policies (#1636)
* test(iam): expose STS session policy S3 deny gap

* fix(iam): enforce STS session policies

## Summary

STS session policies were recorded on temporary credentials but IAM enforcement evaluated only the caller's identity policies. As a result, an assumed role with broad role permissions could still perform an action even when the inline `AssumeRole` session policy should have denied or narrowed it.

This changes enforcement to evaluate the full caller context, including identity policies, session policies, and permission boundaries. It also keeps temporary-credential lookup account-independent so assumed-role sessions can be resolved after account routing moves the request into the role account, and it uses the resolved request account when building resource ARNs for policy evaluation.

## Type of change

- [x] Bug fix (`fix:`)

## AWS Compatibility

Incorrect behavior: STS `AssumeRole` accepted the standard inline `Policy` parameter, but later requests signed with those temporary credentials did not have that session policy applied by IAM enforcement.

The fix matches AWS policy evaluation semantics: explicit denies in session policies participate in the deny pass, and a present session policy must also explicitly allow the request for the role's permissions to be effective. This preserves the existing Floci bypass behavior for unknown local credentials and the `test` root credential.

## What changed

- `IamEnforcementFilter` resolves a `CallerContext` and evaluates the complete IAM context instead of identity-policy documents only.
- `IamService` resolves STS sessions across account namespaces for caller context, caller ARN, account routing, and temporary secret lookup.
- Enforcement resource ARN construction uses the request account already resolved by `AccountContextFilter`, so assumed-role credentials evaluate account-scoped resources against the role account.
- IAM and multi-account docs now describe session-policy intersection and temporary-credential resolution accurately.
- Java SDK compatibility coverage now checks that an assumed-role session policy deny overrides a role allow.

## Checklist

- [x] `./mvnw test` passes locally - attempted; only failures were unrelated LambdaReactiveSyncIntegrationTest container startup Broken pipe errors
- [x] Selected Java SDK compatibility tests pass locally - in `compatibility-tests/sdk-test-java`: `mvn -q -Dtest=IamEnforcementTest,IamTest,StsTest,S3Test test`
- [x] New or updated integration test added
- [x] Commit messages follow Conventional Commits

* fix(iam): tighten cross-account session lookup
2026-07-02 23:29:23 -05:00
Kenshin Okinaka 3304184bd3 feat(ses): implement ContactList CRUD for SES v2 (#1638)
Add the SES v2 contact list management APIs (CreateContactList, GetContactList,
ListContactLists, UpdateContactList, DeleteContactList) under
/v2/email/contact-lists. A contact list holds subscription topics with
OPT_IN/OPT_OUT defaults. Matching real AWS, an account may hold at most one
contact list per region; a second create is rejected with BadRequestException
("A maximum of 1 Lists allowed per account."), a duplicate name with
AlreadyExistsException, and unknown lists with NotFoundException.

Covered by a RestAssured integration test and an AWS Java SDK v2 compatibility
test.
2026-07-02 23:23:38 -05:00
Hector Ventura 8b39ead1a4 fix(ec2): return groupSet from DescribeInstanceAttribute (#1709)
* fix(ec2): return groupSet from DescribeInstanceAttribute

Ansible's amazon.aws ec2_instance module reads value['Groups'] from
DescribeInstanceAttribute(Attribute=groupSet) in diff_instance_and_params;
Floci returned only instanceId for that attribute, producing the reported
KeyError. DescribeInstances group shapes were already correct.

Refs #1644

* test(ec2): give describeInstanceAttributeGroupSet a unique order slot
2026-07-02 19:13:20 -05:00
Maciej 6dfdd892aa fix(dynamodb): return a null Message for non-failed item cancellation reason (#1623)
* fix(dynamodb): return a null Message for non-failed item cancellation reason

* fix(ec2): fix flaky launchInstanceUserDataStreamToCloudWatch test

* fix: address PR review feedback for TransactWriteItems and revert unrelated imports
2026-07-02 18:23:02 -05:00
shrimptails-f 0ac1a01884 fix(ses): align CreateEmailIdentity DKIM behavior with AWS (#1620)
* fix(ses): align CreateEmailIdentity DKIM behavior with AWS

* test(ses): verify tracking domains via route53 in sdk compatibility tests

* fix(ses): cache pending DKIM Route53 lookups

* test(ses): log cleanup failures in tracking options test
2026-07-02 18:09:36 -05:00
Maciej 6c5f533f34 fix(cognito): do not return optional blocks in CreateUserPoolClient when they are not set (#1615)
* fix(cognito): do not return optional blocks in CreateUserPoolClient when they are not set

* fix(cognito): fix test order in file

* fix(cognito): improve bats assertions
2026-07-02 00:11:41 -05:00
Alex Banna 058e02630a feat(cloudformation): add StackSets with account-aware provisioning (#1551)
* feat(cloudformation): add StackSets with account-aware provisioning

Implement CloudFormation StackSets so a template can be deployed across
target accounts and regions, and make CloudFormation provisioning land
resources in the correct account.

Provisioning previously ran on a background executor thread with no request
scope, so the downstream service calls fell back to the default account — a
stack created by account B materialised its resources under 000000000000.
executeChangeSet/deleteStack now run the provisioning under a synthetic
request scope bound to the deploying account (the caller's account for a
single stack, the target account for a StackSet instance), mirroring the
pattern other background workers already use. Single-stack resources now
land in the caller's account.

StackSet actions are wired through CloudFormationQueryHandler and
AwsQueryController: CreateStackSet, DescribeStackSet, ListStackSets,
UpdateStackSet, DeleteStackSet, CreateStackInstances, ListStackInstances,
DeleteStackInstances, ListStackSetOperations. CreateStackInstances drives
the existing single-stack engine once per target (account, region),
provisioning each instance into that account's namespace; the stack set,
its instances and its operation history live in the administration account.

Tests: an integration test deploying a StackSet from an admin account into
accounts B and C asserts the resources materialise in B and C and are
invisible to the admin/default account, exercises describe/list/operations
and instance deletion, and covers the not-found / already-exists /
not-empty error paths. A single-stack test asserts resources now land in
the caller's account.

Design aligned with maintainers in floci-io/floci#1550.

* fix(cloudformation): await StackSet instance deletion; test UpdateStackSet

Make the account-scoped deleteStack overload return its Future so
DeleteStackInstances completes synchronously before the operation returns,
rather than racing the async resource removal. Add integration coverage for
UpdateStackSet re-applying the template to existing instances.

* test(cloudformation): add SDK compatibility test for StackSets

Adds an sdk-test-java compatibility test exercising StackSets through the real
AWS SDK CloudFormationClient (CreateStackSet, CreateStackInstances,
DescribeStackSet, ListStackInstances, ListStackSetOperations,
DeleteStackInstances, DeleteStackSet). It asserts the management responses
unmarshal cleanly and that instances provision into each target account's
namespace (verified via per-account SQS clients), per the project's policy of
validating management APIs with AWS SDK clients. Runs in the compatibility CI
on pull requests.

* feat(cloudformation): add DescribeStackInstance and DescribeStackSetOperation

Complete the StackSets API surface with the singular describe operations:
DescribeStackInstance (used by orchestration that polls a single instance's
status) and DescribeStackSetOperation (companion to ListStackSetOperations).
Covered by the integration test and the SDK compatibility test, which confirm
the StackInstance / StackSetOperation response shapes unmarshal through the
real AWS SDK.

* feat(cloudformation): resolve TemplateURL and report StackInstanceStatus.DetailedStatus for StackSets

StackSet create/update now resolve a TemplateURL (fetched from S3) in addition
to an inline TemplateBody, matching how orchestration tools reference templates
staged in S3. DescribeStackInstance and ListStackInstances now also report the
nested StackInstanceStatus.DetailedStatus that AWS returns and that pollers read
to determine when an instance operation has completed.

* feat(cloudformation): derive StackSet operation status and honor RetainStacks

Address review feedback on #1551:

- Operation status is now derived from instance outcomes: CreateStackInstances
  and UpdateStackSet report FAILED if any instance fails to deploy, instead of
  always SUCCEEDED. deployInstance also recognizes a rolled-back create
  (ROLLBACK_COMPLETE, not *_FAILED) as a failed/INOPERABLE instance, which was
  previously mis-reported as SUCCEEDED.
- DeleteStackInstances honors RetainStacks: when true, the instance is detached
  from the stack set but its underlying stack and resources are left in place.
- UpdateStackSet now persists the refreshed instance records.

Tests: RetainStacks retention and the FAILED-operation path; docs updated.

* fix(cloudformation): restore account on active scope; log StackSets test teardown

Greptile review on #1551:
- runUnderAccount now saves and restores the previous account ID when it runs
  inside an already-active request scope, so it can't leave the overridden
  account behind on a reused thread. (Background workers normally have no active
  scope, so this only hardens the synchronous-caller path.)
- CloudFormationStackSetsTest teardown no longer swallows exceptions silently;
  it logs them, per the AGENTS.md no-empty-catch rule.

* fix(cloudformation): report a failed StackSet instance delete as FAILED

deleteStackInstances awaited the underlying deleteStack via a helper that
swallows the failure, then removed the instance record unconditionally and
hardcoded the operation status to SUCCEEDED. A failed non-retained delete was
therefore reported as a success with the instance silently dropped.

await() now returns whether the future completed cleanly. On a non-retained
delete failure the instance record is retained (marked INOPERABLE/FAILED) and
the operation status is derived via deriveOperationStatus, so it reports FAILED
— matching AWS, which does not detach an instance whose stack delete failed.

Adds StackSetServiceDeleteFailureTest covering the failure, success, and
RetainStacks paths.

* fix(cloudformation): reject templateless CreateStackSet and restore interrupt in await

CreateStackSet now rejects a request with neither TemplateBody nor TemplateURL (ValidationError,
matching AWS) instead of storing a null template — which would otherwise make a later
CreateStackInstances deploy empty stacks into every target account. Also handle
InterruptedException separately in await(Future) and restore the thread's interrupt flag, so a
shutdown signal to the backing ExecutorService propagates instead of being swallowed. Adds a
CreateStackSet-without-template integration test.
2026-07-01 23:11:16 -05:00
Jason van Zyl 94468ba56f fix(elbv2): publish resolvable local ALB DNS names (#1492) 2026-06-28 21:02:44 -05:00
nblomquistandnathan 326b495496 feat(iot) Feature/issue 1038 iot core (#1359)
* feat: add IoT endpoint and thing registry

* feat: add IoT thing tagging

* feat: add IoT certificates and shadows

* feat: add IoT MQTT broker

* feat: upgrade IoT MQTT broker to Moquette 0.18

* feat: restore IoT reserved MQTT topics

* feat: add IoT topic rules engine

* feat: improve IoT thing registry compatibility

* feat: complete IoT MVP 1 compatibility

* feat: complete IoT MVP 2 compatibility

* feat: finish IoT MVP 2 coverage

* fix: disable IoT MQTT broker persistence

* fix(docker): include vendored Maven artifacts in source builds

* fix(iot): stabilize MQTT integration test sockets

* fix(iot): verify MQTT test connections

* fix(iot): use Paho for MQTT integration tests

* fix(iot): use Vert.x MQTT broker

---------

Co-authored-by: nathan <nathan@debian-dev-small.localdomain>
2026-06-25 22:58:44 -05:00
Kenshin Okinaka 54ba15c218 feat(ses): implement PutConfigurationSetDeliveryOptions for SES v1 (#1553)
* feat(ses): implement PutConfigurationSetDeliveryOptions for SES v1

The classic SES Query API action was unhandled — only the v2 REST path
reached the existing setConfigurationSetDeliveryOptions service logic.
Route the v1 action through SesQueryHandler and register it in the
AwsQueryController SES action set.

The v1 DeliveryOptions structure carries only TlsPolicy (Require/Optional);
Floci stores the v2 canonical REQUIRE/OPTIONAL, so the handler normalizes
the value before delegating to the shared, already-validated service. An
all-null payload passes null to clear the block, mirroring the v2 path
rather than persisting an empty object.

Tests: v1 Query integration coverage (success, unknown set, invalid TLS
policy) and an AWS Java SDK v1 compatibility test that writes Require via
the v1 SesClient and reads it back as the canonical REQUIRE through v2
GetConfigurationSet, asserts an empty put clears the block, and asserts
the modeled ConfigurationSetDoesNotExistException for an unknown set.

* fix(ses): return v1 ValidationError for an invalid delivery-options TlsPolicy

The v1 PutConfigurationSetDeliveryOptions surfaced the shared service's
v2-style BadRequestException for an invalid TlsPolicy, so a v1 SDK could only
map it to a generic exception. Validate Require/Optional (case-sensitive) in
the v1 handler and throw the Smithy enum ValidationError AWS actually returns.

Verified against real AWS: an invalid or wrong-case TlsPolicy returns
ValidationError "1 validation error detected: Value at
'deliveryOptions.tlsPolicy' failed to satisfy constraint: Member must satisfy
enum value set: [Optional, Require]". The v1 integration test now asserts that
shape; valid Require/Optional still normalize to the canonical value for the
shared service.
2026-06-25 22:49:14 -05:00
AgustinBertagna e20f7d83d2 feat(appsync): Phase 3 — $util runtime library for VTL resolvers (#1223)
* test(appsync): add remaining SDK tests and fix listDomainNames field name

- Add 4 SDK tests: getIntrospectionSchema, listDomainNames, getFunction, listResolversByFunction
- Fix listDomainNames response field from 'domainNames' to 'domainNameConfigs' (AWS SDK v2 expects domainNameConfigs)
- Update integration test assertion to match corrected field name

* feat(appsync): add $util runtime library for VTL resolvers

Standalone utility library matching AWS AppSync $util namespace.
Validated against official AWS AppSync documentation.

Classes:
- VtlErrorSignal: exception for $util.error() and $util.unauthorized()
- AppSyncUtil: top-level $util with error/validate/type-check methods
- StrUtil: $util.str (toUpper, toLower, toReplace, normalize)
- TimeUtil: $util.time (12 methods, epochMilliSeconds-based per AWS)
- MathUtil: $util.math (roundNum, minVal, maxVal, randomDouble, randomWithinRange)
- DynamoDbUtil: $util.dynamodb (24 methods: value + JSON variants)
- TransformUtil: $util.transform (DynamoDB filter, Elasticsearch DSL, subscription filter)
- ListUtil: $util.list (copyAndRetainAll, copyAndRemoveAll, sortList)
- MapUtil: $util.map (copyAndRetainAllKeys, copyAndRemoveAllKeys)

* test(appsync): add unit tests for $util runtime library

234 test cases covering all $util methods with edge cases:
- AppSyncUtilTest: root methods, error, validate, type checks (85 tests)
- DynamoDbUtilTest: DynamoDB attribute value conversion (47 tests)
- StrUtilTest: string operations (21 tests)
- TimeUtilTest: time operations (21 tests)
- MathUtilTest: math operations (19 tests)
- ListUtilTest: list operations (17 tests)
- TransformUtilTest: filter/DSL conversion (12 tests)
- MapUtilTest: map operations (12 tests)

* fix(appsync): fix DynamoDbUtil *Json methods and refactor utils

- Fix 10 *Json methods to return JSON String instead of Map
- Add private helpers: toJson(Map), base64Encode(String) to DynamoDbUtil
- Extract parseInput(Object) helper in TransformUtil to remove duplication
- Chain qr() to quiet() in AppSyncUtil
- Chain validate() overloads in AppSyncUtil
- Update tests to verify *Json methods return correct JSON strings

* fix(appsync): address review feedback on $util methods

- toMapValues: return inner map without M wrapper (matches AWS: toMapValues = toMap.get("M"))
- toBinary/toBinarySet: wrap input as-is, don't re-encode base64
- str.normalize: use Unicode normalization (NFC/NFD/NFKC/NFKD) instead of whitespace collapse
- typeOf: return exact AWS values (Null/Number/String/Map/List/Boolean/Object)
- unauthorized: errorType 'Unauthorized' not 'UnauthorizedException'
- nowISO8601: always include 3 fractional digits per AWS format
- Mark transform.* methods as not-yet-implemented (complex expression building)
- Update all affected tests

* fix(appsync): change default errorType from UnknownError to Unknown

Research confirms AWS AppSync uses 'Unknown' as default errorType when
$util.error(message) is called without errorType argument.

* chore(appsync): remove dead base64Encode helper from DynamoDbUtil
2026-06-25 20:38:58 -05:00
kotov228 efacb37130 feat: Adds initial Elastic Beanstalk Query API support to Floci. (#1362)
* feat: add Elastic Beanstalk query API support

feat: add Elastic Beanstalk query API support

* fix(elasticbeanstalk): configure native-image runtime initialization

* fix(elasticbeanstalk): align missing parameter errors and add application ARN

* test(elasticbeanstalk): add Java SDK compatibility coverage
2026-06-25 19:16:51 -05:00
shrimptails-f ad1cc22c19 fix(rds): align subnet group placement handling with AWS behavior (#1295)
* fix(rds): align subnet group placement handling with AWS behavior

* fix(rds): align DB subnet group wire responses with AWS model

* fix(rds): align subnet group placement validation with AWS

* fix(rds): tighten subnet group placement validation

* chore: rerun ci
2026-06-25 17:54:50 -05:00
shrimptails-f 82170dd081 fix(codebuild): stabilize compatibility tests (#1565) 2026-06-25 17:54:36 -05:00
Abhishek Dubey ab6d7feb9d fix(elbv2): omit terminal SSL policy marker (#1522) 2026-06-24 22:37:15 -05:00
Maciej 72146eeb02 fix(athena): serialize timestamps as epoch seconds in GetWorkGroup and GetTableMetadata responses (#1524) 2026-06-24 22:10:17 -05:00
Jason van Zyl 0870f993a4 fix(ssm): reject send-command timeouts below AWS minimum (#1511) 2026-06-23 00:39:12 -05:00
Konda Balaji Rao f725a38969 feat(secretsmanager): implement automatic secret rotation lifecycle (#1467)
* fix: return XML error for missing action and add volume action fallbacks

* fix(eventbridge): sync EventBridge tags to ResourceGroupsTaggingService

EventBridge stored tags on rules, buses, and archives in its own stores but never propagated them to the central ResourceGroupsTaggingService. This caused GetResources with --resource-type-filters events:rule to return an empty list.

Inject ResourceGroupsTaggingService into EventBridgeService (following the existing GlueService pattern) and sync tags during putRule, tagResource, untagResource, and deleteRule operations.

Closes #1343

* feat(secretsmanager): implement automatic secret rotation lifecycle

* fix(secretsmanager): correct RotationLambdaARN validation in tests and rotation rules parsing

* fix(secretsmanager): avoid implicit unboxing NPE when parsing rotation rules

* fix: remove debug print, drop camelCase rotation parameters fallback, and revert unrelated eventbridge changes

* fix: align PutSecretValue error code and resolve NPE in JSON handler tests

* fix(test): create Lambda function before rotateSecret to fix ResourceNotFoundException

rotateSecretStub failed because SecretsManagerService validates the
rotation Lambda exists synchronously. The test was passing an ARN for a
function that had never been created in the emulator.

Create a real Lambda function via LambdaClient before calling
rotateSecret, and clean it up afterwards. Uses
Runtime.fromValue(nodejs20.x) for SDK compatibility.

* fix: non-immediate rotation runs testSecret only

Per AWS RotateSecret docs, when RotateImmediately is false Secrets
Manager tests the rotation configuration by running only the testSecret
step. Remove the createSecret invocation from the non-immediate path.

* fix(test): align rotateSecretNotImmediate with non-immediate rotation path

The non-immediate rotation path only invokes testSecret (not createSecret),
so the test should expect 1 lambda invocation instead of 2.
2026-06-22 23:18:16 -05:00
Kenshin Okinaka 7c04e8824c feat(ses): support v1 ConfigurationSet tracking and reputation-metrics options (#1479)
* feat(ses): support v1 ConfigurationSet tracking and reputation-metrics options

Implement the SES v1 (Query) ConfigurationSet option operations that previously
returned UnsupportedOperation: CreateConfigurationSetTrackingOptions,
UpdateConfigurationSetTrackingOptions, DeleteConfigurationSetTrackingOptions, and
UpdateConfigurationSetReputationMetricsEnabled.

Tracking options require a verified domain identity, matching real AWS: an
unverified CustomRedirectDomain yields InvalidTrackingOptions, checked before
configuration-set existence. The domain-verification check is shared with the v2
PutConfigurationSetTrackingOptions path so the two surfaces stay aligned. Lifecycle
conflicts surface as TrackingOptionsAlreadyExistsException /
TrackingOptionsDoesNotExistException, matching the AWS SDK error mapping.

A v1-created configuration set now defaults reputation metrics to disabled, matching
real AWS (the v2 create path leaves them enabled). DescribeConfigurationSet now
returns ReputationMetricsEnabled and the trackingOptions block.

Add integration and AWS SDK v2 compatibility tests.

* fix(ses): match AWS errors for missing/blank tracking-options redirect domain

CreateConfigurationSetTrackingOptions / UpdateConfigurationSetTrackingOptions now
distinguish the two AWS validation outcomes instead of returning a single
InvalidParameterValue: an absent CustomRedirectDomain (no TrackingOptions member on
the wire) yields a framework ValidationError ("Member must not be null"), while a
present-but-empty CustomRedirectDomain yields InvalidTrackingOptions ("At least one
field of TrackingOptions must contain a value."). The Smithy member is optional, so
the previous required-field rejection was incorrect.

Add integration coverage for both cases.

* test(ses): renumber tracking-options test order to match source order

Align the @Order values so file order equals execution order (the missing/blank
domain validation cases now run at 11-12, the reputation-metrics cases at 13-14),
making the intended sequence easier to follow.
2026-06-21 09:57:45 -05:00
Jason van Zyl e8b54e45e9 fix(autoscaling): reject launch templates without image ids (#1451) 2026-06-21 09:40:33 -05:00
kotov228 3f314dcb4e feat(codepipeline): add AWS CodePipeline emulation (#1469)
* feat(codepipeline): add AWS CodePipeline emulation

* fix(codepipeline): align webhook and rollback response shapes
2026-06-21 09:01:44 -05:00
MarkandMark Hayen c2cd31216b refactor(kms): use enums for type-safety. add algorithms to keymetadata (#1430)
* refactor(kms) use enums for type-safety. add algorithms to keymetadata

Signed-off-by: Mark Hayen <mark.hayen@edsn.nl>

* refactor(kms): use enums for type-safety. add algorithms to keymetadata

Signed-off-by: Mark Hayen <mark.hayen@edsn.nl>

* refactor(kms): update missing algorithms handling and add tests to cover all combinations of keySpec,KeyUsage

Signed-off-by: Mark Hayen <mark.hayen@edsn.nl>

---------

Signed-off-by: Mark Hayen <mark.hayen@edsn.nl>
Co-authored-by: Mark Hayen <mark.hayen@edsn.nl>
2026-06-21 01:02:01 -05:00
Prakhar Kapoor 93782c0142 feat(s3vectors): add S3 Vectors service support (#1435)
* feat(s3-vector-store): add S3Vectors service support with storage configuration and integration testing

* feat(s3-vector-store): implement S3 Vectors service API with controller, service, and integration tests
2026-06-21 00:55:10 -05:00
Kenshin Okinaka 1ffa9a4e21 feat(ses): support v2 dedicated IP pools and configuration-set option groups (#1412)
* feat(ses): support v2 dedicated IP pool APIs

Add SES v2 dedicated IP pool management — CreateDedicatedIpPool,
GetDedicatedIpPool, ListDedicatedIpPools and DeleteDedicatedIpPool — backed by
a per-region store.

Validation matches real AWS SES V2 (verified 2026-06-18): ScalingMode defaults
to STANDARD and must be STANDARD or MANAGED; a duplicate pool returns
AlreadyExistsException; an unknown pool returns NotFoundException.

Add integration tests, an AWS SDK v2 compatibility test, and document the
endpoints.

* feat(ses): support v2 configuration-set option groups

Add SES v2 ConfigurationSet support for the ReputationOptions, TrackingOptions,
DeliveryOptions, ArchivingOptions, and VdmOptions option groups. Each group can
be set through its dedicated Put...Options endpoint or supplied inline to
CreateConfigurationSet (validated before the set is stored), and is read back
through GetConfigurationSet.

Validation matches real AWS SES V2:

- TrackingOptions: HttpsPolicy enum; a present CustomRedirectDomain must be
  non-blank and a verified domain identity, is required when HttpsPolicy is set,
  and is checked before the enum.
- DeliveryOptions: TlsPolicy enum; MaxDeliverySeconds must be an integer in
  [300, 50400]; any SendingPoolName is rejected since Floci models no
  dedicated-IP pools, with distinct blank vs non-existent messages.
- ArchivingOptions: ArchiveArn must match the Mail Manager archive ARN pattern
  (existence/ownership not modelled).
- ReputationOptions: always returned by GetConfigurationSet (enabled by
  default); an empty-body PUT disables it.
- VdmOptions: nested DashboardOptions/GuardianOptions [ENABLED, DISABLED] enums;
  accepted independently of account-level VDM.

Option members are type-checked, an all-null block clears the options, and the
response blocks are shaped via Jackson. Add integration tests and an AWS SDK v2
compatibility test, and document the endpoints.

* feat(ses): validate SendingPoolName against dedicated IP pools

Now that dedicated IP pool management is available, DeliveryOptions
SendingPoolName is validated against the pool store instead of being rejected
unconditionally: a pool created via CreateDedicatedIpPool is accepted (and
echoed by GetConfigurationSet), while an unknown pool still returns
'SendingPool <name> doesn't exist' and a blank one 'sendingPoolName can't be
blank.' (verified against real AWS).

Add integration and SDK compatibility tests for referencing an existing pool.

* fix(ses): stop validating ArchiveArn format

Floci does not model Mail Manager archives, so the ArchiveArn format is not
validated — any provided value is stored and echoed (matching the store-only
behaviour of other local AWS emulators). The JSON-string type check is kept.

Replace the malformed-ARN rejection test with one asserting an arbitrary
ArchiveArn round-trips.
2026-06-20 11:47:36 -05:00
José Miguel González Guzmán b4ee4ca489 fix(ec2): omit empty stateReason element in DescribeInstances (#1410)
* fix(core): use self-closing tags for empty XmlBuilder values

XmlBuilder.elem(name, "") produced <name></name> for empty string values, which caused some XML consumers (e.g. Terraform AWS provider) to crash with nil pointer dereference.

Now empty string values render as self-closing <name/> instead, which is semantically identical but avoids the parser crash. Null values remain skipped entirely.

* fix(ec2): conditionally omit stateReason instead of self-closing empty tags

The previous approach (self-closing tags for empty XmlBuilder values)
was wrong for two reasons:
1. AWS emits <tag></tag> (paired tags), not <tag/> — verified against
   botocore rest-xml protocol fixtures (XmlEmptyStrings, XmlEmptyBlobs).
2. Go's encoding/xml tokenizes both forms identically (StartElement +
   EndElement, no CharData), so the Terraform crash persisted either way.

Real fix: stop hardcoding <stateReason><code></code><message></message>
in Ec2QueryHandler for every instance. AWS omits stateReason entirely
when there is none (e.g. a running instance). Now it is only emitted
when stateReasonCode or stateReasonMessage is present.

XmlBuilder.elem() reverted to its original paired-tag behavior.
Added Instance.stateReasonCode/stateReasonMessage model fields.
Updated Ec2InstanceResponseShapeTest to assert null for running
instances (matching real AWS behavior).
2026-06-19 19:03:50 -05:00
Jason van Zyl 0cb90bc739 feat(aws): expand EC2 and RDS availability catalogs (#1391) 2026-06-17 00:56:35 -05:00
Jason van Zyl 660a8bceb3 feat(ssm): execute run commands in EC2 containers (#1387) 2026-06-16 22:51:21 -05:00
Jason van Zyl 3acab2bf27 Add IAM provisioning preflight support (#1250)
* fix(iam): seed provisioning managed policies

* feat(iam): support policy simulation preflight

* fix(iam): address provisioning preflight review feedback

* fix(iam): normalize condition context in evaluator
2026-06-15 17:13:01 -05:00
David Phillips cf761a9698 fix: reject missing Glue table deletes (#1323) 2026-06-13 19:41:57 -05:00
David Phillips 5a964e516d fix: support Glue table statistics deletion (#1324) 2026-06-13 19:34:42 -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
David Phillips 59a2659e41 fix: support Glue partition APIs (#1315) 2026-06-13 09:28:58 -05:00
Hector Ventura 33cb72e341 feat(wafv2): add AWS WAF v2 management API (Phase 1) (#1327)
Add the wafv2 (AWSWAF_20190729) JSON 1.1 service: Web ACLs, IP sets, regex
pattern sets, and rule groups, plus resource association, logging and permission
policies, and tagging. Uses LockToken optimistic concurrency and isolates the
CLOUDFRONT and REGIONAL scopes.

Covered by an in-repo RestAssured integration test and an AWS SDK v2
compatibility test.
2026-06-13 09:25:55 -05:00
Hector Ventura 8b5adea915 feat(emr): add Amazon EMR management API (Phase 1) (#1321)
Add the elasticmapreduce (ElasticMapReduce) JSON 1.1 service: cluster lifecycle
with a simulated state machine, job-flow steps, instance groups and fleets,
security configurations, and tags. Honours the ActionOnFailure legacy alias and
EMR's distinct error shapes.

Operations: RunJobFlow, DescribeCluster, ListClusters, TerminateJobFlows,
SetTerminationProtection, SetVisibleToAllUsers, SetKeepJobFlowAliveWhenNoSteps,
SetUnhealthyNodeReplacement, ModifyCluster, AddJobFlowSteps, DescribeStep,
ListSteps, CancelSteps, AddInstanceGroups, ListInstanceGroups, AddInstanceFleet,
ListInstanceFleets, ListInstances, CreateSecurityConfiguration,
DescribeSecurityConfiguration, DeleteSecurityConfiguration,
ListSecurityConfigurations, AddTags, RemoveTags.

EmrService holds a static SecureRandom, so it is registered under
quarkus.native.resources additional-build-args --initialize-at-run-time to keep
the GraalVM native build working.

Covered by an in-repo RestAssured integration test and an AWS SDK v2
compatibility test.
2026-06-13 09:01:48 -05:00
Jason van Zyl 33eac5f79e test(s3): cover ranged get object through SDK (#1293) 2026-06-12 22:55:32 -05:00
Jason van Zyl 9a244a6964 Add CloudTrail trail lifecycle support (#1256)
* feat(cloudtrail): add trail lifecycle operations

* test(cloudtrail): cover provisioning integration

* test(cloudtrail): add SDK compatibility coverage

* fix(cloudtrail): harden trail lifecycle state
2026-06-11 01:57:18 -05:00
nblomquistandnathan 92f4ff1ccf Feature/issue 1130 glue database tags (#1248)
* fix(glue): register database tags with tagging API (#1130)

* test(glue): add database tagging compatibility coverage (#1130)

* test(tagging): allow additional tagged resources (#1130)

---------

Co-authored-by: nathan <nathan@debian-dev-small.localdomain>
2026-06-11 00:47:00 -05:00
Hector Ventura f669116908 feat(eks): support managed node groups (create/describe/list/delete) (#1226)
* feat(eks): support managed node groups (create/describe/list/delete)

aws eks create-nodegroup returned a 400 S3 error ("POST requires ?uploads
parameter") because EksController declared no route for
/clusters/{name}/node-groups, so the request fell through to S3's path-style
catch-all. Add the nodegroup REST routes (which outrank S3's templated path)
plus management-plane node group CRUD.

Node groups are emulated as catalog records that become ACTIVE immediately,
mirroring mock-mode cluster creation; no real worker nodes are provisioned
(k3s schedules pods on its built-in node in real mode).

Closes #1137

* refactor(eks): drop unused nextToken/maxResults params from listNodegroups
2026-06-09 02:09:16 -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