* 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).
Query and Scan now reject an ExclusiveStartKey whose attribute set does not
exactly match the paged key schema (table primary key, plus index keys when an
IndexName is given), with the distinct messages each operation returns. Closes
5 conformance failures.
* fix(dynamodb): reject redundant parens, contains() dup operand, begins_with non-string
Add ExpressionEvaluator.validateExpression for structural/semantic checks
DynamoDB rejects at parse time, wired into Put/Delete/Update/Query/Scan
handlers with the correct Invalid <ExprType> prefix. Closes 11 conformance
failures across tier1 paren tests and tier3 exact error-message tests.
* test(dynamodb): expect ValidationException for redundant double parens
scanFilterDoubleNestedParens asserted that ((category = :a)) returns 200,
but real AWS DynamoDB rejects redundant (doubled) parentheses with a
ValidationException at parse time. The new validateExpression() check now
correctly returns 400, so update the test to assert the rejection.
Verified against moto/AWS DDB parity: ((a < b)) fails while
((a = :b) OR (c = :d)) is allowed.
The /_floci/ui/status endpoint returned HTTP 500 under the native image
because Jackson could not serialize UiController.StatusResponse (no
reflection metadata was registered). The interstitial page served by
GET /_floci/ui polls /status and only redirects to the floci-ui sidecar
once it reads {ready:true,url:...}, so a 500 there left the UI stuck on
the loading page even though the floci-ui container was up and healthy.
Register the record for reflection, matching the existing pattern used
by other controller response types (e.g. AwsErrorResponse).
* fix(lambda): redrive failed SQS ESM messages to the DLQ
When an SQS event source mapping invocation failed, the poller left the
message in-flight for the full execution-cover visibility window
(fn.timeout + 30s) instead of returning it to the queue. The message was
therefore never re-received, so ApproximateReceiveCount never crossed
maxReceiveCount and the queue's RedrivePolicy never moved it to the DLQ.
On a failed invocation (and for reported partial-batch failures) reset the
affected messages' visibility to 0 so the next poll re-receives them,
letting the existing redrive machinery move them to the DLQ.
Closes#1416
* fix(lambda): return failed ESM messages using the queue visibility timeout
Address PR review: resetting a failed message's visibility to 0 made it
immediately eligible for redelivery, which spins a tight retry loop for a
persistently failing function (far more aggressive than AWS). Reset to the
queue's configured VisibilityTimeout instead (falling back to the AWS
default of 30s when unset), matching AWS's redelivery cadence while still
letting ApproximateReceiveCount climb so the RedrivePolicy moves the
message to the DLQ.
Also document pollAndInvoke's package-private visibility as test-only.
* feat(auth): parse X-Amz-Credential from query params in AccountResolver and RegionResolver
* fix(auth): fall back to X-Amz-Credential query param in AccountContextFilter
* fix(s3): use request-scoped account ID in PreSignedUrlGenerator credential string
* test(s3): add presigned URL account isolation integration test
* fix(lambda): return {"status":"OK"} ack body from runtime invocation endpoints
The /response, /error and /init/error Runtime API endpoints replied with
HTTP 202 and an empty body. Runtime clients that deserialize the
acknowledgement (e.g. the .NET Amazon.Lambda.RuntimeSupport client) throw
"Could not deserialize the response body" on an empty body, crashing the
runtime process after every failed invocation. Return the AWS-documented
{"status":"OK"} JSON body instead.
* test(lambda): assert Content-Type and parse ack body in runtime tests
Cover the Content-Type: application/json header introduced by sendStatusOk
and parse the acknowledgement as JSON (asserting status == OK) instead of
comparing the raw body string, so harmless formatting changes don't break
the tests.
Reject create/update requests whose MixedInstancesPolicy lacks a usable
LaunchTemplate (no LaunchTemplateId or LaunchTemplateName) with a
ValidationError, instead of persisting a group the reconciler can never
scale out. Also update the missing-launch-source message to mention all
valid sources (LaunchTemplate, LaunchConfigurationName, InstanceId,
MixedInstancesPolicy), matching AWS wording.
Follow-up to #1437.
* fix(sqs): use account-aware queue lookup in doReceiveMessage
The Lambda SQS ESM poller runs on a Vert.x timer thread with no CDI
request scope. doReceiveMessage() used queueStore.get(storageKey) which
falls back to defaultAccountId via AccountAwareStorageBackend, causing
queues under non-default accounts to be invisible to the poller. Switch
to getQueueByUrl(storageKey, queueUrl) for URL-derived, context-free
account resolution, matching sendMessage/deleteMessage.
* fix(sqs): persist messages with account-aware storage in GuardedMessageQueue
GuardedMessageQueue.persist() called messageStore.put() which goes
through AccountAwareStorageBackend.put() and falls back to
defaultAccountId when invoked off the CDI request scope (Lambda ESM
poller on a Vert.x timer thread). This persisted visibility-timeout and
deletion state changes under the wrong account prefix, corrupting
message state for non-default-account queues.
Extract the 12-digit account from the storage key (region::/accountId/
queueName) and call putForAccount(accountId, ...) when the store is an
AccountAwareStorageBackend, with a safe fall-through to put() otherwise.
* test(lambda): add ESM multi-account poller regression test
End-to-end regression for the SQS ESM poller account-aware lookup fix
(M1+M2). Creates a queue, Lambda function, and event source mapping
under non-default account 000000000001 (via a 12-digit AKID SigV4
credential), sends a message, and asserts the poller claims it
(ApproximateNumberOfMessagesNotVisible > 0) within the poll interval.
Before the fix the poller resolved the queue under defaultAccountId and
never fired; this test would have failed. Self-contained with unique
resource names and best-effort cleanup in finally.
* fix(cloudformation): record REVIEW_IN_PROGRESS event on change-set creation
A CREATE change set puts a brand-new stack into REVIEW_IN_PROGRESS, but
createChangeSet recorded no stack event, so DescribeStackEvents returned an
empty list for it. AWS and LocalStack return at least the REVIEW_IN_PROGRESS
stack event; tooling that reads StackEvents[0] right after change-set creation
(e.g. the AWS SAM CLI's get_last_event_time) therefore fails on floci with
"list index out of range" before any resources are deployed.
Record the REVIEW_IN_PROGRESS stack-level event when a CREATE change set
creates a new stack, scoped to that path (nested stacks and update change sets
are unaffected). Adds an integration test.
Fixes#1429
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Vishal Goyal <vishal.goyal@home24.de>
* fix(cloudformation): address review — atomic new-stack detection + CREATE gate
Detect first stack creation via the computeIfAbsent mapping function (runs at
most once per key, so it's atomic and won't double-record the event under
concurrent CreateChangeSet calls) instead of a non-atomic containsKey pre-check,
and only record the REVIEW_IN_PROGRESS event for CREATE-type change sets
(null defaults to CREATE, matching createChangeSet).
* fix(apigateway): support SQS query-protocol integrations (path-style URI)
API Gateway → SQS AWS integrations use a path-style integration URI
(arn:aws:apigateway:{region}:sqs:path/{account}/{queue}) and a VTL request
template that renders the SQS query protocol (form-urlencoded,
"Action=SendMessage&QueueUrl=...&MessageBody=..."). This is the canonical AWS
recipe, also supported by LocalStack.
Two gaps blocked it:
- AwsServiceRouter.parseIntegrationUri only accepted the action/{Action} form
and returned null for path/{resourcePath}, failing with "Cannot parse AWS
integration URI" (500). It now also parses the path form, leaving the action
null (the action comes from the rendered body).
- invokeAwsIntegration always parsed the rendered body as JSON and dispatched
to the JSON handlers. For a path-style target it now parses the body as
form-urlencoded and dispatches via the new AwsServiceRouter.invokeQuery,
which routes to the existing SqsQueryHandler.
Also fixes request-template selection: AWS selects the template by the
incoming request Content-Type, but the integration.request.header.Content-Type
override (set to application/x-www-form-urlencoded for these integrations) was
clobbering it before selection, causing spurious 415s. The incoming
Content-Type is now captured before parameter mapping runs.
Closes#1384
* fix(apigateway): align MissingAction message with AwsQueryController and AWS
The MissingAction error message in invokeQuery drifted from the rest of
Floci and from AWS. AwsQueryController and real AWS use
"The request must contain the parameter Action" — match it exactly.
* fix(secretsmanager): 🐛 honor ListSecrets MaxResults and NextToken pagination
ListSecrets ignored MaxResults and always returned every secret. Page the
(stably sorted) secret list by MaxResults, emit an opaque NextToken offset
when more results remain, and validate MaxResults (1-100) and NextToken.
Closes#1358
* fix(secretsmanager): 🐛 use InvalidParameterException and CreatedDate order for ListSecrets
Address review on #1383:
- ListSecrets does not model ValidationException; return the modeled
InvalidParameterException for an out-of-range MaxResults so the SDK maps it
to a typed exception.
- Sort by CreatedDate (AWS default SortBy) with name as a tiebreaker instead
of by name only.
* feat(ec2): support Spot Instance request actions
- Implement requestSpotInstances, describeSpotInstanceRequests, and cancelSpotInstanceRequests in Ec2Service
- Implement RequestSpotInstances, DescribeSpotInstanceRequests, and CancelSpotInstanceRequests XML serialization and request routing in Ec2QueryHandler
- Add LaunchSpecification and SpotInstanceRequest models
- Add spotInstanceLifecycle integration test to cover the full lifecycle
* fix(ec2): fix ResourceType value and default productDescription for Spot Instances
---------
Co-authored-by: mansiverma897993 <vmansi756@gmaail.com>
Sign/Verify with MessageType=DIGEST and an RSASSA_PKCS1_V1_5_* algorithm fed
the bare digest to NONEwithRSA, which PKCS#1-pads only the bytes it is given.
Real KMS (and any external verifier) signs DigestInfo{hashOID, digest} per
RFC 8017 9.2, so floci's DIGEST signatures verified internally but failed with
openssl / python cryptography.
Wrap the digest in the ASN.1 DigestInfo structure before NONEwithRSA on both
sign and verify. ECDSA DIGEST (no DigestInfo) and the RAW path are unchanged.
Closes#1345
In a native image, Jackson could not serialize ReplicationGroup.configurationEndpoint because the Endpoint record lacked reflection metadata, so HybridStorage threw every flush and never wrote elasticache-groups.json. Annotate Endpoint with @RegisterForReflection (matching its sibling models) so persistence works.
Refs #1268
The AWS SDK v2 serialises Instant values via DateUtils.formatUnixTimestampInstant(),
producing decimal epoch-second strings (e.g. "1750000000.123"). The JSON handler
was using parseInstant(node.asText()), which failed for these values: Instant.parse()
rejects them (not ISO-8601) and Long.parseLong() rejects the decimal point.
This caused two silent failures:
- GetMetricStatistics: StartTime/EndTime parsed as null, defaulting the filter to
0..MAX_VALUE and returning all datapoints regardless of the requested time range
- PutMetricData: MetricDatum.Timestamp parsed as null, causing metrics to be stored
with the current time instead of the caller-supplied timestamp
Fix by switching to parseInstantNode(JsonNode), the existing helper that calls
node.asLong() for numeric nodes and already handles this correctly for GetMetricData.
AWS::ApiGateway::Deployment accepts an inline StageName; previously the deployment was created but the stage was not, so get-stages returned empty and invoking .../{stage}/_user_request_/... returned Stage not found. Now create the stage (with StageDescription.Description when present) bound to the new deployment.
Refs #1163
Inject FirehoseService and add provision + delete handling for AWS::KinesisFirehose::DeliveryStream. Maps DeliveryStreamName and the S3/ExtendedS3 destination configuration (BucketARN, Prefix, BufferingHints) plus Tags. Ref returns the delivery stream name; Fn::GetAtt Arn returns the stream ARN.
Move the UI service classes (FlociUiManager, UiPages) into services.floci.ui and the DuckDB helper (FlociDuckClient, FlociDuckManager) into services.floci.duck, with tests mirrored. Pure package move: importers updated, no behavior change.
Inject AutoScalingService and add provision + delete handling for
AWS::AutoScaling::LaunchConfiguration and AWS::AutoScaling::AutoScalingGroup.
Launch configurations map ImageId, InstanceType, KeyName, SecurityGroups,
UserData and IamInstanceProfile; groups map the launch configuration or launch
template, sizes, availability zones, target groups, load balancers, health check
and tags. Ref returns the resource name; Fn::GetAtt Arn returns the resource ARN.
Docker-free integration test: CreateStack -> DescribeAutoScalingGroups shows the
group referencing the launch configuration.
* feat(cognito): align CreateUserPoolClient and DescribeUserPoolClient with AWS behavior
* feat(cognito): align user pool client config APIs with AWS behavior
* fix(ses): canonicalize only the domain of suppression-list emails
The previous change lower-cased the whole EmailAddress, but real AWS SES V2
(verified 2026-06-15) is case-sensitive on the local-part and case-insensitive
only on the domain: PutSuppressedDestination for Foo@Example.COM stores and
reads back Foo@example.com, Foo@x and foo@x are two distinct entries, and a
GET/DELETE whose local-part case differs returns NotFound. Full lower-casing
wrongly merged local-part variants and altered the address on read-back.
normalizeSuppressionEmail now lower-cases only the part after the last '@'
and preserves the local-part. The integration tests are rewritten to pin the
verified behavior: domain-case-insensitive match and de-dup, local-part
case-sensitive (distinct entries), latest Reason wins on a domain-only
collision.
Suppression entries persisted by a pre-canonicalization Floci (trim-only key)
would otherwise become unreachable once the domain is normalized. All five
suppression lookups — PUT / GET / DELETE / send-time check / event resolution —
fall back to the legacy raw-trimmed key via existingSuppressionKey, and PUT
migrates the entry onto the canonical key, so older entries stay readable,
deletable, and still suppress sends, without a re-PUT leaving a stuck
duplicate. A unit test seeds a legacy-keyed entry directly to pin these paths.
* refactor(ses): single-read suppression lookup and safe legacy migration
Address review on the suppression-list case fix:
- existingSuppressionMatch returns the resolved entry with its storage key,
so GET/DELETE/send-time/event lookups read the store once instead of
probing with isPresent() and re-fetching (was 2 reads on a canonical hit,
3 on a legacy hit; per-address in collectSuppressedReasons).
- PutSuppressedDestination writes the canonical key before deleting the
legacy one it migrated from, so a failed write can't drop the entry.
- The domain-case GET test seeds its own entry, removing the dependency on
an earlier ordered test.
This commit addresses the XML parser error on clients when requests are made without the 'Action' parameter. Previously, it returned a 204 No Content response with an empty body; now it returns a 400 Bad Request status and a structured XML 'MissingAction' error. It also adds missing EC2 volume actions ('CreateVolume', 'DescribeVolumes', 'DeleteVolume') to the unauthenticated fallback list in the query controller.
Closes#1333
Inject EksService and add provision + delete handling for AWS::EKS::Cluster and
AWS::EKS::Nodegroup. Clusters are created via the EKS createCluster API
(RoleArn, ResourcesVpcConfig, version); node groups via createNodegroup under
their cluster. Ref returns the resource name; Fn::GetAtt exposes Arn (and the
cluster Endpoint). Stack deletion removes the cluster/node group.
ScheduleInvoker routed solely by substring-matching the target ARN, so a
universal target (arn:aws:scheduler:::aws-sdk:sns:publish) matched the
":sns:" branch and passed the universal-target ARN itself to SnsService as
the topic, failing at fire time with "Topic does not exist". The real
TopicArn carried in the target Input was never read.
Detect the aws-sdk:<service>:<action> form before the ARN routing and
dispatch sns:publish / sqs:sendMessage using the parameters parsed from
Input. Also add Target.SqsParameters so templated FIFO SQS targets honor
MessageGroupId instead of failing with "The request must contain the
parameter MessageGroupId".
Closes#1265
Inject RdsService and add provision + delete handling for AWS::RDS::DBInstance,
DBCluster, DBSubnetGroup, DBParameterGroup and DBClusterParameterGroup.
DBInstance/DBCluster start real RDS containers (same path as the direct API).
Ref returns the resource identifier; Fn::GetAtt exposes Endpoint.Address,
Endpoint.Port and the resource ARN (plus ReadEndpoint.Address for clusters).
Stack deletion removes each resource so create/delete is symmetric.
Add provision + delete handling for AWS::EC2::Instance: CreateStack runs a real
instance via Ec2Service.runInstances (ImageId, InstanceType, KeyName,
SecurityGroupIds, SubnetId, UserData, IAM instance profile, Tags) and stack
deletion terminates it. Ref returns the instance id; Fn::GetAtt exposes
AvailabilityZone, PrivateIp/PublicIp and PrivateDnsName. Docker-free integration
test isolated to ap-southeast-2 to avoid shared in-memory EC2 state.
Implements the Fn::GetAZs and Fn::Cidr (IPv4) intrinsic functions in
CloudFormationTemplateEngine. Fn::GetAZs returns the region's availability zones;
Fn::Cidr carves a CIDR block into equally sized subnets. A resolveList helper
lets Fn::Select compose with these list-returning intrinsics. Adds an end-to-end
test that drives subnet provisioning through Fn::Select(Fn::GetAZs)/Fn::Cidr.
Ec2Service kept all VPC/subnet/security-group/instance state in plain in-memory
maps, so in persistent storage mode it was lost on restart while CloudFormation
reloaded its stacks and exports. The persisted exports/stack then referenced EC2
ids that no longer existed: describe-subnets returned nothing and ELBv2 failed
with SubnetNotFound.
Migrate the in-memory maps to StorageBackend via StorageFactory (mirroring
RdsService) so all EC2 networking and instance metadata persists and reloads on
startup. In-place mutations (security group rules, routes, gateway attachments,
EIP associations, tags, instance state) put the entity back so changes persist
immediately. Default-resource seeding is skipped when a region already has
persisted resources to avoid duplicates after reload. Adds an ec2 per-service
storage override for parity with rds.
Closes#1297
* feat(docdb): add DocDbCluster model
* feat(docdb): add DocDbInstance model
* feat(docdb): add DocDbContainerHandler
* feat(docdb): add container manager and service config
* feat(docdb): add DocDbService with cluster and instance lifecycle
* feat(docdb): add DocDbQueryHandler
* feat(docdb): Register the service in ResolvedServiceCatalog and Dispatch in AwsQueryController
* test(docdb): add integration test for cluster and instance lifecycle
* fix(docdb): probe MongoDB readiness with a TCP connect instead of a Gremlin HTTP request
* fix(docdb): stop persisting the cluster master password at rest
* fix(docdb): return a generic AWS error envelope for unexpected failures
* feat(docdb): add mock mode to return responses without starting a container
* feat(ui): serve a landing page and launch the floci-ui console on demand
A browser hitting the Floci endpoint (GET / with Accept: text/html) now gets a
small embedded landing page; SDK/CLI traffic falls through to S3 ListBuckets
unchanged. The 'Open Floci UI' button hits /_floci/ui, which lazily starts the
floci-ui sidecar container, injects FLOCI_ENDPOINT so its API can reach Floci,
and serves an interstitial that polls /_floci/ui/status and redirects to the UI
once ready.
The sidecar is a single instance on one configured host port
(floci.services.ui.port, default 8080) and is adopted if already running. A
missing or unavailable image is reported as a friendly message instead of a 500.
Embedded ui/*.html is registered in quarkus.native.resources.includes so it is
present in the native image.
* feat(ui): branded landing dashboard, port 4500, reachable endpoint
Reskin the landing page to floci.io branding and surface live data from
/_floci/* (version, ready state, services grid). Publish the UI sidecar on a
fixed 4500 host+container port. Inject a self-discovered FLOCI_ENDPOINT via
DockerHostResolver so the UI reaches Floci over the Docker network instead of
hardcoded host.docker.internal logic; add FlociUiManagerTest.
* fix(s3): keep ListBuckets Content-Type as application/xml for non-HTML callers
The landing-page content negotiation listed text/html first in @Produces and
returned the ListBuckets XML without an explicit media type, so RESTEasy
negotiated Accept: */* (SDK/CLI default) to text/html and stamped that on the
response. Put application/xml first and pin the XML response type so non-browser
callers always receive application/xml; browser (Accept: text/html) callers
still get the landing page.
AWS::EC2::VPC and AWS::EC2::Subnet (and related networking resources) had no
provisioner case, so they fell through to the stub branch: CloudFormation
reported CREATE_COMPLETE and exported a fake "logicalId-<random>" physical id,
but the subnet was never created in EC2. ec2 describe-subnets did not return it
and elbv2 create-load-balancer failed with "The subnet ID '...' does not exist".
Inject Ec2Service into CloudFormationResourceProvisioner and add cases for VPC,
Subnet, SecurityGroup, InternetGateway, RouteTable, SubnetRouteTableAssociation,
Route, NatGateway and EIP. Each delegates to the existing Ec2Service create
methods and sets the physical id to the real vpc-/subnet-/... id so Ref/exports
resolve to resources EC2 and ELBv2 can use. Topological ordering already
guarantees parents are provisioned before children.
Adds a CloudFormation+EC2+ELBv2 integration test plus AWS CLI and CDK
compatibility coverage.
Closes#1297