Commit Graph
241 Commits
Author SHA1 Message Date
edwintian 7d79bedbd9 feat(appconfig): implement resource tagging and predefined deployment strategies (#533)
* feat(appconfig): implement resource tagging and predefined deployment strategies

Add AppConfigTagHandler to handle ListTagsForResource/TagResource/UntagResource
for AppConfig ARNs, and seed built-in strategies (AppConfig.AllAtOnce etc) so
Terraform's aws_appconfig_* resources provision without errors.

* feat(appconfig): match AWS AppConfig built-in strategy values:
Set correct FinalBakeTimeInMinutes (AllAtOnce: 10, Linear50: 1) and
descriptions for predefined deployment strategies. Fix test @Order gap.
2026-04-21 07:16:26 -05:00
Kenshin Okinaka c69580764e feat(ses): SMTP relay for SendEmail and SendRawEmail (#534)
* feat(ses): add SMTP relay configuration to EmulatorConfig

Add smtp-host, smtp-port, smtp-user, smtp-pass, and smtp-starttls
settings to SesServiceConfig. smtp-host is Optional — when absent or
empty, relay is disabled and emails are stored only (existing behavior).

* feat(ses): implement SMTP relay with Vert.x MailClient and Mime4j

Add SmtpRelay that forwards SES emails to a configured SMTP server
using a dedicated Vert.x MailClient built from EmulatorConfig settings.

Simple emails are sent as MailMessage with From/To/Cc/Bcc/ReplyTo/
Subject/Text/Html. Raw MIME emails are parsed with Apache Mime4j to
extract headers and body, then sent via the same MailClient. When SES
Destinations is provided, it is used as the authoritative envelope
recipient list (MIME Cc headers do not add extra SMTP recipients).

Relay is dispatched asynchronously on a dedicated daemon thread with
a 30-second send timeout. Failures are logged with stack traces but
never affect the API response. The executor and MailClient are only
created when smtp-host is configured and ses.enabled is true, and
shut down in @PreDestroy.

SesService calls SmtpRelay.relay/relayRaw after storing emails so
the inspection endpoint always has the data regardless of relay.

Tests: SmtpRelayTest (12 cases) covers simple/raw relay, disabled
path, error swallowing, base64 decoding, HTML content type, envelope
fallback. SesServiceSmtpTest (5 cases) verifies relay integration
and store persistence.

* docs(ses): document SMTP relay configuration

Add SMTP Relay section to docs/services/ses.md with configuration
example, docker-compose snippet with Mailpit, and behavioral notes.
Add SMTP settings to the YAML sample and environment variable table
in docs/configuration/application-yml.md.

* fix(ses): preserve body against attachment overwrite and extract Bcc from raw MIME

- extractBodyFromEntity now only sets text/html when not already set, so a
  text-typed attachment in multipart/mixed cannot clobber the body picked up
  from multipart/alternative.
- doRelayRaw now reads Bcc from MIME headers alongside To/Cc when the caller
  did not supply Destinations.

* fix(ses): initialize Vert.x NTLMEngineImpl at run time for native image

The vertx-mail-client dependency brings in io.vertx.ext.mail.impl.sasl.NTLMEngineImpl,
whose static state embeds a SecureRandom instance. GraalVM native-image rejects
build-time Random/SecureRandom objects because the cached seed makes runtime
behavior unpredictable. Mark the class for run-time initialization, matching the
existing entry for the Apache HttpClient NTLM engine.
2026-04-20 22:47:06 -05:00
Hector Ventura b7774d17b2 fix: release 1.5.5 2026-04-19 23:45:27 -05:00
TiM 79a7a04287 fix(lambda): wake blocked /next poller and drain queue on RuntimeApiServer.stop() (#531)
* fix(lambda): wake blocked /next poller and drain queue on RuntimeApiServer.stop()

RuntimeApiServer.stop() had two independent shutdown bugs:

1. Blocked /next handler not woken. The long-poll loop
   `while (invocation == null && !stopped)` only checks `stopped` after
   `pendingQueue.poll(30s)` returns. stop() sets stopped=true but never
   nudges the queue, so a blocked worker holds a Vert.x thread for up
   to 30s per container tear-down.

2. Queued invocations dropped without completing futures. stop() ended
   with `pendingQueue.clear()`, silently discarding any invocation that
   was enqueued but not yet consumed by /next. LambdaExecutorService
   was already awaiting that resultFuture; the caller hung until its
   own timeout fired.

Fix:
- Add SHUTDOWN_SENTINEL, offered AFTER the drain so it cannot be
  discarded by clear(). /next recognises it by identity, exits the
  loop, returns 204.
- Replace `pendingQueue.clear()` with a drain loop that completes each
  queued invocation's future with ContainerStopped.
- Harden enqueue() to short-circuit when stopped, with a post-offer
  recheck closing the check-then-offer race.
- Add a post-loop `stopped` check in the /next handler so an invocation
  polled just before stop() gets completed locally rather than parked
  in inFlight after cleanup.

Keeps `poll(30s)` rather than `take()` as a belt-and-braces timeout if
the sentinel is ever missed.

Tests: three new RuntimeApiServerTest cases cover sentinel wake,
queue-drain completion, and enqueue-after-stop short-circuit.

Related: #485 (worker-pool RCA), #504 (original, closed), #529 (rebase),
#530 (interrupt follow-up).

* ci: retrigger (SecretsManagerServiceTest flake on main, not related to this PR)
2026-04-19 23:44:24 -05:00
sf-jin-ku 2efb483390 feat(s3): preserve explicit object SSE headers (#515)
* feat(s3): preserve explicit object SSE headers
* refactor(s3): validate and encapsulate SSE write options
* fix(s3): make notification filter parsing deterministic
* fix(ses): harden identity deletion lookups
* fix(ses): reject padded identities literally
* fix(secretsmanager): keep a single previous stage
2026-04-19 23:36:36 -05:00
TiM 1b53e53dba fix(lambda): destroy container handle on interrupt and generic exception (#530)
Closes #525.

Extends #529's timeout-path fix to the two remaining paths in
LambdaExecutorService.executeSync that were still returning a
potentially-dirty container to the warm pool.

- InterruptedException: the container may still be processing the
  previous request, so the response from the old invocation could be
  returned to a new one. Destroy the handle instead of releasing it.
- Exception (e.g. runtime API communication failure): container state
  is unknown. Destroy rather than trust it for reuse.

Matches AWS Lambda behavior where a container is discarded after any
internal error, not reused.

Tests mirror the existing timeoutInvocation_destroysHandle_doesNotRelease
pattern, one for each path.
2026-04-19 19:33:09 -05:00
Daniel Abeledo 571d6d7a0d feat: add version stages handling in ASM put-secret-value (#527) 2026-04-19 19:23:05 -05:00
Hector Ventura ee08d3ad44 feat(opensearch): add real os with docker image (#528)
* feat(opensearch): add real os with docker image
* fix: fix opensearch network issue
2026-04-19 19:04:31 -05:00
TiMandRicardo Lima f837be0051 fix(lambda): fix container lifecycle on timeout (rebase of #504) (#529)
* fix(lambda): release container handle on timeout instead of draining warm pool

* fix: fix container lifecycle on timeout

* fix(lambda): correct /next poll loop condition and restore response handling

Flip while loop to `invocation == null && !stopped` so the poll actually
runs (previous condition was unreachable because invocation starts null).
Restore the 204 response on null return and the 500 response on
InterruptedException so the handler never leaves the response open.

Without this fix, every RIC call to /next hangs, which also broke the
existing LambdaReactiveSyncIntegrationTest with SocketTimeout.

---------

Co-authored-by: Ricardo Lima <ricardo.hrlima@gmail.com>
2026-04-19 18:34:48 -05:00
iam-ssrivastav 4955537de2 feat(cognito): implement AdminResetUserPassword action (#516)
- Add adminResetUserPassword method to CognitoService
- Add handler routing in CognitoJsonHandler
- Set user status to RESET_REQUIRED and clear credentials on reset
- Enforce PasswordResetRequiredException across all auth flows
- Add integration tests for reset password lifecycle
2026-04-19 17:40:19 -05:00
TiM 0642a28e78 feat(kinesis): support AT_TIMESTAMP shard iterator type (#520)
Implement ShardIteratorType=AT_TIMESTAMP so consumers can resume a shard
from a specific arrival time. Previously AT_TIMESTAMP fell through the
type switch and silently behaved like TRIM_HORIZON.

- Bump iterator encoding to 6 parts (adds timestampMillis slot).
  5-part legacy iterators still decode via split(-1) compat.
- handleGetShardIterator parses and validates Timestamp (numeric,
  epoch seconds with fractional ms, converted via Math.round to long
  millis to avoid 1ms drift).
- AT_TIMESTAMP scan in getRecords uses inclusive >= match against each
  record's ApproximateArrivalTimestamp.
- Continuation iterator remains type=TRIM_HORIZON + resume-at-nextIndex
  to preserve the existing "resume by index" convention; inline comment
  documents the apparent contradiction.
- Reject AT_TIMESTAMP without Timestamp (or with non-numeric Timestamp)
  as InvalidArgumentException at the handler boundary.
2026-04-19 17:31:04 -05:00
Kenshin Okinaka bc951bf4bf fix(lambda): restore create-copy-start ordering for provided runtimes (#524)
* fix(lambda): restore create-copy-start ordering for provided runtimes

The refactor in #466 changed ContainerLauncher from create → copy →
start to createAndStart → copy, breaking provided.* runtimes whose
entrypoint execs /var/runtime/bootstrap immediately on start — before
the file has been copied in.

Split ContainerLifecycleManager into create(spec) and
startCreated(containerId, spec) so ContainerLauncher can copy code and
the bootstrap file into the container filesystem before starting it.
Other services (ECS, ECR, EKS, MSK, ElastiCache, RDS) continue using
createAndStart since they have no pre-start file copy requirement.

Fixes #494

* test(lambda): verify create-copy-start ordering for provided runtimes

Update ContainerLauncherTest to use the new create/startCreated API
and add two ordering tests:

- launchFunction_createsBeforeCopyAndStartsAfter: verifies the
  create → copy → startCreated sequence for any runtime using
  Mockito InOrder.
- launchProvidedRuntime_copiesBootstrapBeforeStart: verifies the same
  ordering specifically for provided.al2023 with a bootstrap file,
  and asserts createAndStart is never called. This is the exact
  regression from #466 that caused exit 127.

* refactor: delegate createAndStart to create + startCreated

Eliminate duplicated container-creation logic by making createAndStart
a thin delegate to create(spec) + startCreated(containerId, spec).
Future fixes to either step now apply to both call paths automatically.

* test(lambda): add SDK compatibility test for provided runtime invoke

Create and invoke a provided.al2023 function using the shell-based
bootstrap from LambdaUtils.providedRuntimeZip(). Asserts the response
contains the expected payload without timeout or FunctionError.

This test fails on 1.5.4 (Read timed out after 120s due to the
create-start ordering regression in #466) and passes on the fix.

* docs: add @param to create() and rename misleading test

- Add missing @param spec tag to ContainerLifecycleManager.create()
  for consistency with surrounding methods.
- Rename launchFunctionCopiesCode to launchFunction_createsWithoutBindMounts
  to reflect what the test actually asserts. Remove the getDockerClient
  verify that didn't prove code copying.

* test(lambda): stub Docker copy chain and add cleanup for provided runtime test

- Stub dockerClient.copyArchiveToContainerCmd → withRemotePath →
  withTarInputStream so copy operations execute against the mock
  instead of throwing silently. Ordering tests now verify actual
  Docker copy invocations between create and startCreated.
- Provided runtime test asserts both /var/task and /var/runtime
  remote paths were targeted.
- Add sdk-test-provided-fn to @AfterAll cleanup in LambdaTest so
  assertion failures don't leak the function across test runs.

* test(lambda): drain tar InputStream in copy mock to prevent thread leaks

Each copy mock now returns a fresh CopyArchiveToContainerCmd that
drains the PipedInputStream on exec(), so the background tar writer
thread can complete instead of blocking when the pipe buffer fills.
Remote paths are captured via the mock's withRemotePath answer and
asserted from the shared list.

Also adds sdk-test-provided-fn to @AfterAll cleanup in the compat
test to prevent function leaks on assertion failure.

* refactor(lambda): drop unused ContainerInfo variable from launch

The return value of startCreated() was assigned but never read.
Remove the variable and its now-unused import.

* test(lambda): include getDockerClient in InOrder verification

Add the getDockerClient() call between create() and
copyArchiveToContainerCmd() in both ordering tests so the verified
sequence matches the actual call flow in ContainerLauncher.launch().

* style: remove redundant doAnswer import

The wildcard import already covers it.
2026-04-19 09:33:54 -05:00
TiM b37f4c71e0 fix(kinesis): return real ShardId in PutRecord and PutRecords responses (#518)
PutRecord and PutRecords were hardcoding "shardId-000000000000" in responses
regardless of which shard the record was routed to. Storage-side routing
(selectShard) was already picking the correct shard; only the handler response
was wrong.

Add PutRecordResult record and putRecordWithShardId method that exposes the
resolved shard to handlers. Keep the existing putRecord(...) String overload
for internal callers (KinesisStreamingForwarder, tests) to avoid churn.

Fixes cross-shard distribution assertions in downstream SDK tests.
2026-04-19 08:07:54 -05:00
iam-ssrivastav 6e8127c0e8 feat(cognito): implement AdminEnableUser and AdminDisableUser (#514)
- Add adminEnableUser/adminDisableUser methods to CognitoService
- Add handler routing in CognitoJsonHandler
- Enforce isEnabled check across all auth flows (Password, SRP, Refresh)
- Add comprehensive unit tests for enable/disable lifecycle
2026-04-19 08:01:48 -05:00
TiM 6f12f78201 fix(lifecycle): run shutdown hooks before HTTP server stops (#431) (#519)
Shutdown hooks could not reach Floci's HTTP endpoint (e.g.
`aws --endpoint-url http://localhost:4566 ...`) because they ran in
the ShutdownEvent observer, which Quarkus fires only AFTER the HTTP
server has already stopped.

Split the lifecycle:
- onPreShutdown(@Observes ShutdownDelayInitiatedEvent) runs stop hooks
  while the HTTP server is still accepting connections.
- onStop(@Observes ShutdownEvent) handles resource cleanup only.

Enable the pre-shutdown phase via `quarkus.shutdown.delay-enabled:
true`. No `delay` value is set, so observers run synchronously with
no artificial sleep introduced.

Swallow all hook failures (including InterruptedException) without
restoring the interrupt flag, so the subsequent ShutdownEvent cleanup
phase always runs with a clean thread state and resource shutdown is
guaranteed even when hooks fail.

Fixes floci-io/floci#431
2026-04-19 07:49:00 -05:00
Kenshin Okinaka 4719269df4 fix(ses): align /_aws/ses inspection endpoint with LocalStack behavior (#512)
* fix(ses): store text and html body separately and return raw as RawData

The inspection endpoint (/_aws/ses) previously collapsed bodyHtml and
bodyText into a single field, making both text_part and html_part
identical. Split SentEmail.body into bodyText and bodyHtml so the
inspection response correctly distinguishes the two, with null for the
absent part — matching LocalStack 4.14.0 behavior.

Raw emails now use a dedicated rawData field and constructor. The
inspection endpoint returns RawData (the full MIME message) without
Destination, Subject, or Body fields, matching LocalStack's shape.

Tests: 4 new integration tests covering text+html separation, text-only
(html_part=null), html-only (text_part=null), and raw email (RawData
without Body/Subject/Destination).

* fix(ses): parse and store ReplyToAddresses

ReplyToAddresses was silently dropped on both SES v1 (Query) and v2
(REST JSON) send paths. Parse it from the request, store it on
SentEmail, and return it in the inspection endpoint (/_aws/ses) for
non-raw emails. The field is omitted when empty, matching LocalStack
behavior.

* fix(ses): return all regions in inspection endpoint

LocalStack's /_aws/ses returns emails from all regions regardless of
request headers, with each message carrying its own Region field.
Floci previously filtered by the default region, hiding emails sent
to other regions.

- Add region field to SentEmail, set on send.
- SesInspectionController GET now calls getAllEmails() (no region
  filter) and reads region from each email.
- DELETE clears all regions.

* refactor(ses): remove unused RegionResolver and use putNull for region

SesInspectionController no longer filters by region, so the injected
RegionResolver is dead code. Remove it and align the null-region
handling with other optional fields (putNull instead of empty string).

* fix(ses): use bulk clear and add v1 ReplyToAddresses test

- clearAllEmails() now calls emailStore.clear() instead of deleting
  entries one-by-one, avoiding N disk writes on persistent backends.
- New SesIntegrationTest covering the SES v1 Query path for
  ReplyToAddresses: sends via SendEmail with ReplyToAddresses.member.1
  and verifies round-trip through the /_aws/ses inspection endpoint.

* refactor(ses): simplify getEmails/clearEmails to region-agnostic

The inspection endpoint now returns all regions unconditionally, so
the region-scoped getEmails(region) and clearEmails(region) are dead
code. Replace them with parameter-less getEmails() and clearEmails(),
and drop the intermediate getAllEmails/clearAllEmails aliases.

* fix(ses): add backward-compat alias for legacy Body field and multi-region test

- @JsonAlias("Body") on bodyText so persisted SentEmail objects from
  before the text/html split still deserialize their body into bodyText
  rather than silently losing it.
- New test: send emails in two different regions (us-east-1 and
  ap-northeast-1) and verify /_aws/ses returns both with correct
  per-message Region values.

* refactor(ses): move region and replyToAddresses into SentEmail constructors

Both fields were set via setters immediately after construction, which
is inconsistent with the other fields that are constructor arguments.
Add them to the Simple and Raw constructors so all required state is
established at creation time.

* refactor(ses): align sendEmail parameter order with SentEmail constructor

Move region to the first parameter position so the argument order
matches the SentEmail constructor (messageId, region, source, to, cc,
bcc, replyTo, subject, bodyText, bodyHtml). No functional change.

* refactor(ses): remove unused RegionResolver and validate rawMessage

- SesService no longer uses RegionResolver (region is always passed as
  a parameter from controllers). Remove the field, constructor parameter,
  and import.
- sendRawEmail now rejects null/blank rawMessage with
  InvalidParameterValue, preventing a stored email that would appear
  as non-raw in the inspection endpoint.

* fix(ses): validate source in sendRawEmail

sendRawEmail lacked the null/blank check on source that sendEmail
already had, allowing stored messages with Source=null and a 200
response. Add the same guard for consistency.

* refactor(ses): remove unused EmulatorConfig from SesService constructor

The config parameter was injected but never referenced.

* revert: restore EmulatorConfig in SesService constructor

Removing the unused EmulatorConfig parameter caused an awscli compat
test failure (SES: verify identities deleted). The parameter likely
influences Quarkus CDI initialization ordering — StorageFactory may
depend on EmulatorConfig being resolved first. Restore with
@SuppressWarnings("unused") to document intent.

* fix(ses): omit empty CcAddresses and BccAddresses from inspection response

LocalStack omits these keys when the list is empty rather than returning
an empty array. Apply the same !isEmpty() guard already used for
ReplyToAddresses.

* fix(ses): omit empty ToAddresses and restore region parameter order

- Apply the same !isEmpty() guard to ToAddresses so it is omitted from
  the inspection response when empty, consistent with CcAddresses,
  BccAddresses, and ReplyToAddresses.
- Revert sendEmail parameter order: move region back to the last
  position to match the convention used by all other SesService methods
  (verifyEmailIdentity, deleteIdentity, listIdentities, etc.).

* refactor(ses): remove unused EmulatorConfig from SesService constructor

The config parameter was injected but never referenced. A previous
attempt to remove it (76d6c22) was reverted due to a CI failure, but
that failure may have been flaky (S3 Notifications queue filter
round-trip, a known pre-existing issue). Retrying after rebase onto
latest main.
2026-04-19 01:05:08 -05:00
TiM 677bad0e16 fix(storage): make scan() return mutable list for non-InMemory backends (#517)
PersistentStorage, HybridStorage, and WalStorage used Stream.toList(),
which returns an unmodifiable list in Java 16+. InMemoryStorage built an
ArrayList, so callers that mutate the scan result work in unit tests
(all using in-memory backend) but fail at runtime on persistent backends.

This was the root cause of #482: CloudWatchLogsService.describeLogGroups
calls result.sort(...) on the scan result, which throws
UnsupportedOperationException when running against any non-memory store.
Same latent bug at CloudWatchLogsService.getLogEvents and
CognitoService.listGroups (callers copy into ArrayList first, so they
happen to work).

Rather than patch the two call sites, align all StorageBackend
implementations on a documented "returns a new mutable list" contract.
Tests added to each backend to lock in the behavior.
2026-04-18 18:36:20 -05:00
iam-ssrivastav 65063144c9 security(s3): harden path traversal defenses in S3Service and S3Controller (#508)
- Add normalize() + startsWith(bucketDir) guards to resolveObjectPath
  and resolveVersionedPath in S3Service (primary defense)
- Add controller-level validateKeyNoTraversal mirroring the service
  pattern with try/catch for InvalidPathException (null bytes → 400)
- Add validateRawUri to catch percent-encoded traversal (%2e%2e)
  before Vert.x normalization strips it
- Strip leading slashes from keys before filesystem resolution to
  allow legitimate S3 keys like /file.txt without escaping the bucket
- Add integration tests for %2e%2e, %00, and %2E%2E vectors
  asserting 400 InvalidKey
- Add unit tests for service-layer traversal rejection
2026-04-18 11:24:35 -05:00
Christine Nguyen 247c62cd19 fix(dynamodb): validate sort key in buildItemKey to prevent item collisions (#506) 2026-04-18 11:14:10 -05:00
Hector Ventura 63ed81c59d feat(eks): implement EKS service with real k3s data plane support (#493)
* feat(eks): implement EKS service with real k3s data plane support
* fix: adjusting eks volume issues
2026-04-18 01:35:25 -05:00
iam-ssrivastavandShivam Srivastav b013588037 feat: implement S3 static website hosting with index document redirection (#507)
Co-authored-by: Shivam Srivastav <shivamsrivastav@192.168.1.6>
2026-04-18 01:34:38 -05:00
rbelakapytski-aet f4ce6ef445 fix(kms): support ECC_SECG_P256K1 via BouncyCastle JCA (#502)
* fix(kms): support ECC_SECG_P256K1 via BouncyCastle JCA
use BC for EC keygen, KeyFactory, and Signature on ECC_* specs. Add test.
* fix(kms): support ECC_SECG_P256K1 via BouncyCastle JCA
2026-04-17 21:54:40 -05:00
Christine Nguyen 8ac4cdcd94 fix(cloudformation): forward Lambda environment variables during stack provisioning (#510) 2026-04-17 20:29:00 -05:00
Hector Ventura 114fade129 feat(lambda): implement reactive S3-to-Lambda sync for hot-reloading (#509)
* feat(lambda): implement reactive S3-to-Lambda sync for hot-reloading
* fix: clean unused hotreload properties
2026-04-17 19:04:47 -05:00
bkindersleytrulioo 9b5f364e47 feat: DynamoDB support ReturnValuesOnConditionCheckFailure (#505) 2026-04-17 18:45:52 -05:00
Mario Slatinac 7f82a28abb fix(sqs): include MD5OfMessageAttributes in SendMessageBatch JSON response (#496) 2026-04-17 18:37:36 -05:00
Christine Nguyen 01c544006c feat: add EventBridge PutPermission and RemovePermission support (#499) 2026-04-17 18:21:38 -05:00
Stas Burnashev b899f177e4 fix(dynamoDB): support arithmetic in DynamoDB SET expressions (#480)
* fix: support arithmetic in DynamoDB SET expressions

SET expressions like `SET cnt = cnt + :inc` or
`SET cnt = if_not_exists(cnt, :start) + :inc` silently ignored
the arithmetic operator - only the left operand was assigned.

Add `findArithmeticOperator()` to locate `+`/`-` outside function
parentheses, and evaluate both operands via `evaluateSetExpr` with
BigDecimal arithmetic.

Closes #479

* fix: address review - path-aware evaluateSetExpr, proper error handling

- Make evaluateSetExpr use hasValueAtPath/getValueAtPath for nested
  path support (e.g. SET a.b = a.b + :inc)
- Throw ValidationException for non-numeric operands instead of
  silent no-op
- Catch NumberFormatException on BigDecimal parsing

* fix: add integration and compatibility tests for SET arithmetic

- Add DynamoDbIntegrationTest for if_not_exists + arithmetic (repro from #479)
- Add Java SDK compatibility test covering increment, consecutive
  increments, and subtraction
2026-04-17 18:17:02 -05:00
TiM cb4424842d fix(s3-control): accept URL-encoded ARNs and return XML errors (#435) (#491)
The Go AWS SDK v2 (used by Terraform AWS provider v6.x) percent-encodes
the colons and slashes of the resource ARN in the request path. Our
path param matcher left the value encoded, so extractBucketName's
lastIndexOf(":bucket/") never matched and every tag call returned 400.

On top of that, S3 Control is a REST-XML protocol but AwsExceptionMapper
emits JSON. The Go SDK's XML deserializer choked on the JSON body with
"XML syntax error on line 1: unexpected EOF", masking the real error.

Fix:
- URL-decode the ARN path param before parsing; malformed percent-
  encoding is turned into an InvalidRequest 400 instead of propagating
  IllegalArgumentException to the JSON mapper
- Catch AwsException in each S3 Control handler and serialize it as an
  S3-style <Error> XML body (mirrors the pattern S3Controller already
  uses)

Fixes the regression #341/#363 missed because the Java SDK compat test
sends literal colons and slashes.
2026-04-17 00:21:00 -05:00
Kenshin Okinaka d8243b8803 feat(lambda): support ScalingConfig.MaximumConcurrency on SQS event source mappings (#490)
* feat(lambda): support ScalingConfig.MaximumConcurrency on SQS event source mappings

Wire-level support for ScalingConfig on CreateEventSourceMapping,
UpdateEventSourceMapping, GetEventSourceMapping, and
ListEventSourceMappings:

- New ScalingConfig model carrying MaximumConcurrency (Integer, nullable).
- Create and Update parse ScalingConfig from the request, validate range
  (2-1000), reject non-SQS event sources with InvalidParameterValueException.
- Response includes ScalingConfig only when a cap is set; omitted when
  null, matching AWS behavior.
- Update with an empty ScalingConfig clears the cap (AWS reset semantics).

The value is persisted on the EventSourceMapping but not yet enforced at
invocation time — the SQS poller today serializes to one concurrent
invocation per ESM regardless. Real parallel dispatch capped by
MaximumConcurrency is a follow-up (Scope B).

Tests:
- EsmIntegrationTest: 6 new cases covering round-trip, below/above range
  rejection, non-SQS rejection, omission when unset, add-then-clear via
  update.
- LambdaEsmScalingConfigTest (SDK compat): 5 cases verifying SDK typed
  ScalingConfig round-trips, InvalidParameterValueException on range
  violations, and add/clear lifecycle via update.

* fix(lambda): reject non-integer MaximumConcurrency and ScalingConfig on non-SQS sources

- parseScalingConfig now detects fractional values (e.g. 2.5) and
  returns InvalidParameterValueException instead of silently truncating.
- Empty ScalingConfig ({}) on a non-SQS event source is now rejected.
  Previously the non-SQS check only fired when MaximumConcurrency was
  non-null, so an empty ScalingConfig on Kinesis / DynamoDB Streams
  slipped through.
- Two new integration tests cover both cases.

* fix(lambda): tighten ScalingConfig input validation

- Reject non-object ScalingConfig (e.g. "foo", []) with 400 instead of
  silently treating it as absent. In update paths this previously cleared
  an existing cap unintentionally.
- Reject non-numeric MaximumConcurrency (e.g. string "7"). AWS expects a
  JSON number on the wire; the previous toString + parseInt path accepted
  strings that real AWS would reject.
- Use longValue() before range-checking to avoid intValue() overflow on
  large inputs (e.g. 5000000000) that would produce a negative value and
  a misleading error message.
- Two new integration tests: string MaximumConcurrency and non-object
  ScalingConfig.

* fix(lambda): add NaN/Infinity guard and expand ScalingConfig test coverage

- parseScalingConfig now explicitly rejects NaN and Infinity rather than
  letting them fall through to longValue() with a misleading error.
- The post-range non-SQS guard was flagged as dead code by the reviewer
  but is in fact reachable (non-SQS + valid numeric MaximumConcurrency).
  Retained and confirmed by the existing @Order(43) test.
- New tests: update range validation (below/above on PUT), and list
  with mixed ScalingConfig presence across ESMs.
2026-04-17 00:16:55 -05:00
TiM ca2e5d4153 feat(kinesis): implement UpdateStreamMode (#488)
* feat(kinesis): implement UpdateStreamMode

UpdateStreamMode previously returned 400 UnsupportedOperation. The
terraform-provider-aws calls UpdateStreamMode unconditionally on every
refresh of an aws_kinesis_stream resource, so the second `terraform
apply` errored even though the stream was functional.

Changes:
- Add UpdateStreamMode handler. Resolves the stream by StreamARN (the
  AWS API does not accept StreamName here), validates StreamMode is
  PROVISIONED or ON_DEMAND, requires the stream to be ACTIVE, and
  treats same-mode requests as a no-op so terraform refresh succeeds.
  Same-mode no-op mirrors the IncreaseStreamRetentionPeriod behaviour
  introduced in #342 for the same reason.
- Honor StreamModeDetails.StreamMode in CreateStream.
- Emit StreamModeDetails on DescribeStream and DescribeStreamSummary
  responses so terraform refresh observes the actual mode and stops
  re-planning the resource.

Closes #440

* chore: retrigger CI (flaky S3 notifications test)
2026-04-17 00:15:09 -05:00
TiM 12cf29571d fix(logging): pass throwable to errorf so stack traces are logged (#487)
LOG.errorf(String, Object...) treats trailing args as format params,
so the catch-all exception handler in AwsJson11Controller silently
dropped the stack trace. Switch to errorf(Throwable, String, Object...)
so unexpected failures surface with their cause attached, matching
the pattern used in AwsJsonController and AwsJsonCborController.

Refs floci-io/floci #482
2026-04-16 21:42:55 -05:00
Hector Ventura e9f6417713 fix(ecr): fixing port and network issues on ecr (#483)
* fix(ecr): fixing port and network issues on ecr
* fix: issue on merge with main
* fix(ecr): connect containers to network after start only when port bindings exist
2026-04-16 21:34:26 -05:00
bkindersleytrulioo 3ebff5a701 feat: support DynamoDB UPDATED_OLD and UPDATED_NEW ReturnValues (#477) 2026-04-16 17:20:24 -05:00
edwintian 5f07c77237 feat(lambda): add support for UpdateFunctionConfiguration AWS API (#472) 2026-04-16 17:16:13 -05:00
Trevin Chow 9a9be34cba fix(sqs): honor queue-level DelaySeconds on FIFO queues (#476)
FIFO sendMessage silently dropped the queue-level DelaySeconds
attribute: messages were stored and then made immediately receivable,
regardless of the queue's configured default (issue #475).

Resolve the effective delay from the DelaySeconds queue attribute
before the FIFO/standard split. FIFO always uses the queue-level
value (AWS does not accept per-message DelaySeconds on FIFO queues);
the standard path keeps its existing per-message behavior. Apply
the resolved delay via Message.setVisibleAt in both branches.

Known limitation out of scope for this patch: Message.visibleAt is
@JsonIgnore, so delayed visibility does not survive a restart -- same
constraint the standard path already had. Tracking for a follow-up.

Fixes #475
2026-04-16 17:14:20 -05:00
TiM c565398beb feat(bedrock-runtime): stub Converse and InvokeModel for #87 (#486)
Adds a bedrock-runtime service stub so AWS SDK and CLI clients can target
Floci for local development of Bedrock Runtime callers. Dummy responses
only: no real model inference.

- Register bedrock-runtime in ResolvedServiceCatalog under both "bedrock"
  and "bedrock-runtime" credential scopes (boto3 signs with signingName
  "bedrock" while some clients use the endpoint id)
- POST /model/{modelId}/converse returns a fixed assistant message plus
  synthetic usage and latency metrics matching the AWS Converse contract
- POST /model/{modelId}/invoke returns an Anthropic-shaped body for
  anthropic.* and *.anthropic.* model ids, generic {"outputs": [...]}
  otherwise. Request body is passed through as opaque bytes
- {modelId:.+} path regex accepts full ARNs (inference profiles,
  provisioned throughput) in addition to plain ids
- converse-stream and invoke-with-response-stream return 501 so SDKs
  get a clear error instead of 404
- Response building uses JsonNode rather than typed POJOs, avoiding
  native-image reflection registration

13 new integration tests (Converse + InvokeModel happy paths, validation,
inference-profile ids and ARNs, 501 streaming responses). Full suite
remains green: 2263 tests, 0 failures.
2026-04-16 17:13:17 -05:00
Conor Heine c0e4af32f7 fix: add log rotation by default to all floci-launched containers (#466) 2026-04-16 12:46:15 -05:00
Christine Nguyen 25905187b3 fix(lambda): include LastUpdateStatus in function configuration responses (#463) 2026-04-15 16:06:15 -05:00
Dmitriy Polomoshnov 25f360002e fix: DynamoDB expression evaluation, UpdateExpression paths, and ConsumedCapacity (#197)
* fix: replace regex-based DynamoDB expression evaluation with AST parser
* feat: add ConsumedCapacity in DynamoDB responses and GSI throughput in DescribeTable
* test: add DynamoDB expression compatibility tests and fix rebase conflicts
2026-04-15 09:55:58 -05:00
Navaneesh Kumar 2c25c108c1 feat(tagging): implement Resource Groups Tagging API (#459)
Adds the Resource Groups Tagging API as a new JSON 1.1 service
(X-Amz-Target: ResourceGroupsTaggingAPI_20170126.*).

New service files:
- ResourceTagMapping model (resourceArn + LinkedHashMap tags)
- ResourceGroupsTaggingService — in-memory store keyed by
  region::arn, implements TagResources, UntagResources,
  GetResources (with ResourceARNList, TagFilter, and
  ResourceTypeFilter support), GetTagKeys, GetTagValues
- ResourceGroupsTaggingJsonHandler — dispatches all five actions,
  builds JSON responses matching the AWS wire format

Pagination uses a Base64-encoded offset token for all list
operations. ResourceTypeFilters support both "service:type" and
bare "service" formats parsed from ARN structure.

Wiring:
- EmulatorConfig: ResourceGroupsTaggingServiceConfig (enabled=true)
- ResolvedServiceCatalog: descriptor with target prefix
  ResourceGroupsTaggingAPI_20170126., credential scope "tagging"
- AwsJson11Controller: injected handler, case "tagging"

Tests:
- 14 integration tests: tag multiple ARNs, get all / by ARN list /
  by tag filter / by tag key only / by resource type / by service
  type, pagination, GetTagKeys, GetTagValues, UntagResources,
  verify removal
- HealthControllerIntegrationTest updated to include "tagging"
2026-04-15 07:54:17 -05:00
TiM c2653db2e7 fix(kinesis): accept AWS SDK v2 CBOR content type (#457)
* fix(kinesis): accept aws sdk v2 cbor content type
* test(kinesis): move sdk v2 coverage to compatibility suite
2026-04-15 07:50:37 -05:00
Hector Ventura ea597c67d6 feat: implement local Data Lake stack (Athena, Glue, and Firehose) (#429)
* feat: implement local Data Lake stack (Athena, Glue, and Firehose)
* fix: adding athena, firehose and glue documentation
* fix: updating dataLateTest
2026-04-15 01:22:10 -05:00
TiM 3cdb9b0ded fix(dynamodb): support continuous backups PITR actions (#458) 2026-04-15 01:12:50 -05:00
TiM ca0395a9e0 fix: implement s3 bucket ownership controls (#456) 2026-04-15 01:08:57 -05:00
Navaneesh Kumar c030af9a0d feat(ec2): implement CreateVolume, DescribeVolumes, DeleteVolume (#455)
Adds EBS volume support to the EC2 service — the minimum viable
volume API needed to unblock AWS metadata workflows.

New model classes:
- Volume (volumeId, volumeType, size, state, availabilityZone,
  encrypted, iops, snapshotId, createTime, tags, attachments)
- VolumeAttachment (instanceId, device, state, attachTime,
  deleteOnTermination, volumeId)

Service changes (Ec2Service):
- In-memory ConcurrentHashMap store keyed by region::volumeId
- createVolume() with TagSpecification support
- describeVolumes() with ID list + filter support
- deleteVolume() with InvalidVolume.NotFound on missing ID
- Filter support: volume-id, status, volume-type,
  availability-zone, encrypted, tag:*, tag-key, tag-value

Handler changes (Ec2QueryHandler):
- CreateVolume, DescribeVolumes, DeleteVolume cases in switch
- volumeXml() serializer matching AWS EC2 Query Protocol wire
  format (volumeSet/item, attachmentSet, nextToken)
- TagSpecification.N.ResourceType=volume parsing on create

Integration tests (Ec2IntegrationTest):
- create → describe by ID
- filter by status and volume-type
- delete → NotFound on subsequent describe
- InvalidVolume.NotFound error case
2026-04-15 01:06:41 -05:00
Daniel Abeledo b9ddb8ee5d feat(cognito-idp): adding create/list/delete user pool client secret cognito-idp actions (#345)
* feat: add Cognito IDP list/add/delete user pool client secrets functionality
* feat: add Cognito IDP list/add/delete user pool client secrets functionality - addressing comments
* feat: add Cognito IDP list/add/delete user pool client secrets functionality - addressing comments
2026-04-14 23:11:58 -05:00
Christine Nguyen 022c214f6f fix(cognito): add aud claim to ID tokens (#454) 2026-04-14 22:35:23 -05:00
Navaneesh Kumar 79ce5220bf feat(cloudwatch): implement GetMetricData (#451)
Replaces the stubs in both the query and JSON protocol handlers with a
full implementation that delegates to the existing getMetricStatistics
storage and aggregation logic.

- Add MetricStat, MetricDataQuery, and MetricDataResult records to
  CloudWatchMetricsService
- getMetricData() iterates queries, buckets by period, resolves the
  requested statistic (Average/Sum/Min/Max/SampleCount/p*), and
  returns Complete results
- Query handler: parseMetricDataQueries walks the deeply nested
  MetricDataQueries.member.N.* form encoding
- JSON handler: parseInstantNode handles numeric epoch timestamps sent
  by AWS SDK v2 (GetMetricData uses the JSON protocol); previously the
  time filter silently failed, returning all stored data
2026-04-14 22:26:16 -05:00
bkindersleytrulioo bf67c61d60 filter esms in sqs poller (#447) 2026-04-14 22:23:05 -05:00