* fix(apigateway): drop the SigV4 Authorization header before REST integrations
API Gateway drops the inbound Authorization header on its way to a REST
Lambda or HTTP integration when the method is AWS_IAM, or on any method
when the header carries a SigV4 signature. Floci forwarded it into the
AWS_PROXY event and the HTTP_PROXY request, so a function serving both
Bearer-token users and IAM-signed services saw "AWS4-HMAC-SHA256 ..."
where AWS delivers no header at all.
X-Amz-Date, X-Amz-Security-Token and every other header still pass
through, a Bearer token on a non-IAM method is unchanged, and REQUEST
authorizer events keep the header. HTTP API (v2) is unchanged: AWS
documents no such stripping there.
* test(apigateway): cover method.request.header.Authorization mappings on AWS_IAM routes
* test(apigateway): fold the Authorization header tests into ProxyEventIamIdentityTest
* feat(eks): bound cluster node capacity and reserve kubelet resources
* fix(eks): use the large managed node pod cap
* fix(eks): preserve node capacity through restart failures and restores
* fix(eks): retain restored node until capacity replacement starts
* fix(eks): let concurrent node groups share user data execution
* fix(eks): finalize first node group after bootstrap
* fix(eks): retain restored replacement when backup cleanup fails
* fix(eks): stop live node before retrying backup cleanup
* ci: retry transient mqtt port collision
* fix(eks): preserve cluster API port during node capacity change
* test(docker): verify exec attach stream closes on timeout
* fix(eks): keep capacity backup names outside cluster namespace
* fix(stepfunctions): bound a .sync Task by its TimeoutSeconds, not by a poll count
A Task waiting on ecs:runTask.sync or states:startExecution.sync gave up
after 600 polls at 100 ms, about 60 seconds, whatever its TimeoutSeconds
said; that clock was read for a task-token wait alone. The deadline is
now computed once at schedule time and shared by awaitToken and both
.sync loops, which poll until it or the execution's budget fires. The
Task's clock ends the state as States.Timeout with a TaskTimedOut event
and no cause, the shape the token wait already used.
Closes#4518
* fix(stepfunctions): stop the job a timed-out .sync Task was waiting on
Measured on AWS: when a Task's TimeoutSeconds fires around an
ecs:runTask.sync or states:startExecution.sync, Step Functions stops
the ECS task (stopCode UserInitiated) or aborts the child execution,
both with the cause "The Task state in AWS Step Functions execution
[<arn>] which was managing this resource was aborted". Floci left the
job running. Best effort, like AWS: a job already gone is logged and
the timeout is still what the state reports.
* fix(stepfunctions): end a .sync wait on StopExecution and start its clock at schedule time
Review follow-ups on #4519. The Task's TimeoutSeconds is read before the
scheduled event is built, so a large input cannot extend it. A late wake
re-reads the execution's clock, so a spent budget ends the execution
TIMED_OUT rather than the Task. Both .sync loops read the execution back
each poll and, once StopExecution has marked it ABORTED, stop the job and
unwind without writing an event, instead of polling until a clock ran
out. Tests cover .sync:2 under a Catch on States.Timeout and the aborted
parent; the nested test imports its types.
* docs(stepfunctions): drop the two em dashes the .sync timeout change added
* chore(stepfunctions): let sleepOrTimeOutExecution delegate to sleepOrTimeOutTask
With no Task deadline (Long.MAX_VALUE) sleepOrTimeOutTask parks on the
execution's budget alone and ends the execution TIMED_OUT, which is
exactly what sleepOrTimeOutExecution did in its own copy.
---------
Co-authored-by: mitsukado-shinagawa <mitsukado-shinagawa@users.noreply.github.com>
* feat(appsync): authorize data source service roles
* test(appsync): verify service role at dispatch boundary
* fix(appsync): tighten service role authorization checks
* fix(appsync): honor IAM enforcement setting for data sources
* fix(appsync): adapt Lambda resolver test to authorizer dependency
The javadoc on checkListLength said leaving the value out of a list
constraint violation matched how AWS reports one. That is not established:
captured violations elsewhere in AWS do quote the list, such as Lambda's
"Value '[x86_64, arm64]' at 'architectures'", and IAM's own are
inconsistent about it. The wording generalised the helper's existing
behaviour into a claim about AWS that nothing here verified.
The behaviour is unchanged and deliberate, so the comment now says it is
Floci's choice and gives the actual reason: a request that breaks the
limit should not echo every member back in the error message.
Comments only; the emitted message is byte-identical.
* perf(docker): register only the docker-java classes Jackson uses
The native image registered every docker-java class for reflection,
including the command interfaces, the command classes and their executors.
docker-java creates those with new, so the registration only kept code for
commands Floci never runs, like swarm, services and secrets.
Keep the model classes and the Jackson-annotated response, request body
and config file classes. Jackson reads and writes only these.
* perf(docker): register only the docker-java classes Floci's commands reach
Keep the model and Jackson-annotated classes reached from the Docker
commands Floci runs. This drops the swarm, service, secret, config, event
and image list models, and the request bodies of commands Floci never
sends.
* fix(ecs): release a previous run's task containers and registrations at startup
Task state is memory-only, so a restarted Floci knows no task and the
service scheduler starts a replacement for each service. A run that ended
without a graceful shutdown left its task containers serving beside those
replacements, and even a graceful one left their load balancer targets and
Cloud Map instances registered, so a dead task's target followed its
address to whichever container Docker handed it to next.
At startup, before the scheduler runs, ECS now removes the containers this
Floci owns (task containers now carry the floci_owner_port label EC2 and
the security-group helpers already use), deregisters the IP targets in each
service's target groups, and deregisters the Cloud Map instances its tasks
registered. The owner identity is computed by one shared helper.
* fix(ecs): release only the registrations ECS recorded, and retry failed container removal
The startup sweep recognised a previous run's load balancer targets by
their address shape and its Cloud Map instances by their ECS attributes,
so it also removed a target or instance registered by hand into the same
target group or Cloud Map service. Both registrars now persist each
registration they make, keyed by task ARN, drop the record on
deregistration, and at startup release exactly what was recorded.
Removing a leftover container now uses strict removal, and the result
says whether every leftover is gone. Until it is, each reconciliation
tick retries the sweep and starts no service task. The sweep only
considers containers created before this process started, so a retry
never touches a task this run launched.
* fix(ecs): tell a previous run's containers apart by run label, and record registrations before making them
The startup sweep kept every container created in the same second this process started, so a run killed within that second left an orphan the sweep reported as gone. Containers now carry a per-process floci.ecs-run label, also stamped on security-group helpers, and the sweep keeps only the current run's.
Target and Cloud Map registrations are now written to the ledger before they are made, so a process killed in between still leaves a record for the next run to release.
* fix(ecs): leave a target already in its group to whoever registered it
ELBv2 registration is idempotent, so a task whose address and port matched a target registered by hand adopted it: the ledger recorded it, and a task stop or the startup release then removed it. The registrar now skips and never records a target that is already registered.
* fix(ecs): deregister only the targets a task recorded when it stops
A task whose targets were all already in their groups records nothing, and its stop fell back to deregistering the targets its containers resolve to, removing the ones registered by hand. Every task this process knows went through the recording registrar, so the fallback now serves only a task without an ARN, which cannot be recorded.
* fix(ecs): retry the leftover sweep only when a service needs a task, and warn once
With Docker unreachable, the boot sweep failed and every 5 second tick then
logged two WARNs forever, even with no service to run. The retry now runs only
where a service is about to start a task, and both the sweep failure and the
blocked-launch message are WARNs the first time and DEBUG after.
* fix(ecs): log a repeated blocked service launch at DEBUG
* fix(ecs): retry the leftover sweep before RunTask and StartTask launches too
A task started through RunTask or StartTask no longer bypasses a failed sweep:
the common launch path retries it and stops the task with TaskFailedToStart
while a previous run's containers remain. Sweep failures are tracked per kind,
a failed listing and each container that would not go, so a new failure is
still a WARN after an earlier one cleared.
* fix(ecs): evict unrecorded registrations at a starting task's address, and adopt its own target
A target already in its group when a task started was skipped and never recorded, so a registration no task recorded, as one a Floci version without the ledger made, survived every task stop and restart. When a task of the same service came up on its address it left it in place, and when another service's task took the address the target or Cloud Map instance routed the first service's traffic to it.
A target at the task's own address and port is now recorded as the task's, so its stop deregisters it, as ECS does on AWS. When a task starts, every target and Cloud Map instance at one of its addresses that no live task recorded is deregistered from the target groups and Cloud Map services the region's ECS services name, with a warning. A loopback address matches only on the task's host ports.
* fix(ecs): evict only registrations that actually point at a starting task
The eviction matched every unrecorded target at any of a task's addresses on any port, including its ENI address. ECS registers no target at the ENI address, and an ENI address is unique only within its VPC, so an IP target for something in another VPC could be removed; a target on a port the task does not publish sends it nothing either.
Targets are now matched only at a container's Docker address on the ports its bindings declare. Cloud Map instances still match a container address on any port, since a DNS answer carries none, and match the ENI address only in a namespace of the task's own VPC.
PublishPackageVersion silently overwrote a generic-format asset's stored
bytes whenever the same asset name was republished to an Unfinished
package version, with no comparison against what was already there. AWS's
own docs ("Overwriting package assets" in the CodeArtifact packages
overview) say a republish is only rejected when the content actually
differs from what's already stored; byte-identical content succeeds
idempotently. Compares the new upload against the existing asset's real
bytes (read the same way GetPackageVersionAsset does, not the in-memory
PackageAsset.content field, which is @JsonIgnore and unreliable after a
reload) and now returns ConflictException on a genuine mismatch instead of
silently replacing the content.
* fix(cloudformation): keep unchanged AWS::ApiGateway::Resource on update and remove it on delete
UpdateStack runs provision again for every resource, and the Resource
arm called CreateResource unconditionally. For a resource whose
RestApiId points at an API outside the stack, the second CreateResource
under the same parent failed with "Another resource with the same
parent already has this name" and the update rolled back.
The delete side had the same gap. Only AWS::ApiGateway::RestApi had a
delete, relying on its cascade, which never runs when the API is not
part of the stack. DeleteStack left the stack's resources and methods
on the API, and deploying the stack again failed with the same error.
- Resource: RestApiId, ParentId and PathPart are all createOnly, so an
update that keeps them keeps the resource. A changed one creates the
replacement and then removes the old resource. The API a resource was
created on is recorded with it, since a resource id alone does not
name its API, and DeleteStack removes the resource from that API.
- Method: DeleteStack removes the method named by its physical id. An
update that changes RestApiId, ResourceId or HttpMethod removes the
method it replaced.
* fix(cloudformation): leave replaced API Gateway resources to stack cleanup
A Resource or Method whose createOnly properties changed deleted the
entity it replaced while the update was still running. When a later
resource failed, the rollback could not bring it back, and
UpdateReplacePolicy: Retain was ignored.
The displaced entity is now recorded with ReplacementCleanup, like the
other provisioners that replace: it is deleted in the cleanup after
the update commits, kept under Retain, and a rollback deletes the
replacement and restores the previous physical id.
Deleting a method split its physical id on hyphens, which named the
wrong method when the HTTP method itself had one. Resources and methods
now record their API, resource and HTTP method keyed by physical id,
and every delete path uses that record. Splitting the id is kept only
for methods provisioned before the record existed.
* fix(cloudformation): report nothing to roll back for an unchanged API Gateway resource
When an update kept an AWS::ApiGateway::Resource and a later resource
failed, rollbackUpdate returned false because no replacement had been
recorded. The rollback walker then reported "Rollback is not
implemented" for the resource, and the stack ended in
UPDATE_ROLLBACK_FAILED although nothing about it had changed.
RestApiId, ParentId and PathPart are all createOnly, so an update that
kept the resource's physical id left it untouched, and rollback now
reports success for it without calling the API.
AWS::ApiGateway::Method is unchanged: an update rewrites its method,
integration and responses in place, and rolling back an in-place
update belongs with the broader work in #4385.
* feat(dynamodb): add the external Local operation client
Adds DynamoDbLocalClient, which forwards DynamoDB and DynamoDB Streams
wire calls to an external DynamoDB Local over SigV4-signed HTTP/1.1.
The caller's account becomes the access key and its region the signing
region, so Local keeps each account and region apart. Requests are
never retried.
Reply.successBody now owns the AWS error body conversion, which the
API stream reader reuses.
* feat(dynamodb): add the DynamoDB Local backend
Adds DynamoDbLocalBackend, a DynamoDbBackend that forwards every wire
call to an external DynamoDB Local through DynamoDbLocalClient.
- Namespaces: the caller's account and region select the Local
namespace; table and stream ARNs from another account or region are
rejected.
- Identities: table, index and stream ARNs in replies are rewritten
from Local's fixed ddblocal shape to public ARNs, and stream records
carry the caller's region.
- Metadata: tags live in a Floci store because Local keeps none;
replica updates are refused; a global table is its single-region
table; stream enable and disable are idempotent like native.
- Lifecycle: startup waits up to 30s for Local to accept connections,
and emulator resets are refused because the data lives outside
Floci.
DynamoDbBackend groups the four seam interfaces so one object is the
whole engine.
* feat(dynamodb): enable the optional Local backend
floci.services.dynamodb.backend selects the engine: native (default)
or local, which forwards to the DynamoDB Local at local-endpoint.
Both engines are client proxies, so the unselected one is never
constructed. With local selected, the stream reader keeps checkpoints
for the life of the stream, and /_floci/info reports the backend in
dynamodb_backend.
DynamoDbLocalBackendIntegrationTest runs against a real DynamoDB Local
when FLOCI_SERVICES_DYNAMODB_LOCAL_ENDPOINT is set.
* docs(dynamodb): document the DynamoDB Local backend
* fix(dynamodb): harden the Local backend endpoint check, stream paging and startup probe
Reject AWS endpoints in every partition, with a trailing dot, and endpoints with user info.
Translate ListStreams paging ARNs, retry any I/O failure until the startup deadline, and
call DescribeTable outside the tag lock.
* fix(dynamodb): tighten Local ARN ownership, batch table names and global TableId
A table ARN of another account or partition is ResourceNotFoundException, a stream ARN of
another partition is refused, and a batch naming one table twice is a ValidationException
instead of a dropped entry. A global table on Local has an empty TableId instead of a random
one. Document the Resource Explorer limit.
* fix(dynamodb): mark the Local readiness probe region as partition-invariant
* test(dynamodb): pin the table record of an untagged typed Local create
* docs(dynamodb): state the Local readiness bound and stack delete protection
* fix(dynamodb): lift deletion protection on the Local direct delete and cap the readiness probe
- DynamoDbTableAccess.deleteTable is the direct engine delete with no
deletion-protection check. The Local backend now clears
DeletionProtectionEnabled before DeleteTable, so CloudFormation deletes
behave the same on both backends. The wire DeleteTable still enforces it.
- Each readiness probe is bounded by the remaining 30 second budget and never
exceeds the configured request timeout, so startup fails within the budget.
* fix(dynamodb): align Local tag errors with the native wire path
- ListTagsOfResource on a missing table is AccessDeniedException, as on the
native wire path.
- A table ARN whose partition is not an AWS partition is a
ValidationException instead of a foreign resource.
- Tag operations report a table ARN of another region as
ResourceNotFoundException, as native does; TableName fields keep the
region-mismatch ValidationException.
- Document which regions Resource Explorer searches, and note that a failed
direct delete leaves deletion protection off.
* docs(dynamodb): state the tested DynamoDB Local version
* feat(core): vendor the per-region hosted zones, SAML URLs and VPC endpoint prefixes
tools/aws/regen_region_facts.py transcribes the per-region and per-partition constants AWS publishes only as prose tables into src/main/resources/aws/region-facts.json: the Terraform provider's load balancer and S3 website hosted-zone maps, the CloudFront hosted zone per partition (cross-checked against the CDK), and the CDK's SAML sign-on URLs and VPC endpoint service-name exceptions. AwsRegionFacts serves them, as Optionals where a partition publishes nothing (the ISO and EUSC partitions have no hosted zones). make aws-data-check regenerates and compares where the local reference checkouts exist, and verifies the file's shape where they do not.
Behaviour this changes: network load balancers report their own hosted zone per region instead of the Application one, Classic and Application load balancers report their region's zone, API Gateway EDGE domains carry the CloudFront zone of their partition, SAML assertions are checked against the sign-on URL of the provider's partition, and the AWS-managed S3 and DynamoDB prefix lists carry the partition's service-name prefix.
Also carries the follow-ups from the #4494 review: bucketRegionForCreate cites the S3 model for the us-east-1 rules, docs/services/s3.md gains a Bucket Regions section, and the Marketplace files are gated per line with stated reasons instead of being allowlisted by path, so a new region literal there is caught.
Part of #4272
* fix(core): harden the region facts against restarts, partitions without CloudFront, and CI without sources
The source-free data check rejected real twelve-character hosted zone ids such as ap-southeast-1's NLB zone ZKVM4W9LS7TM, which failed the vendored-data job. It now accepts Route 53's id length range and checks substance: every partition has an entry whose VPC endpoint prefix is its reversed DNS suffix, every region is published in partitions.json, SAML URLs are https sign-on URLs, and unknown fields are refused.
Load balancers restored from storage take the hosted zone of their region and type again, so balancers stored before the per-region lookup stop reporting the old fixed zone. An EDGE API Gateway custom domain is refused where the partition has no CloudFront, since it would have no distribution zone to alias to. A customer prefix list may not take the prefix of the AWS-managed lists its region carries, cn.com.amazonaws. in China. The partitions doc now says which ISO hosted zones exist.
* fix(core): hold only a changed endpoint type to the partition, and name malformed region facts
UpdateDomainName checked the partition for EDGE on every patch, so an EDGE custom domain stored in GovCloud before the rule could no longer take a certificate or security-policy update; only a patch that changes the endpoint type is held to the partition now. The source-free region-facts check reports a partition or region entry that is not an object by name instead of failing with a traceback, and its test asserts on computed results rather than on calls that write the fixture.
* fix(core): keep gateway endpoint names on com.amazonaws, allow EDGE only in the commercial partition, and keep SAML working where no sign-on URL is published
The AWS-managed prefix lists belong to the S3 and DynamoDB gateway endpoints, which the CDK names com.amazonaws.<region>.<service> in every partition (GatewayVpcEndpointAwsService); the reversed-suffix table applies to interface endpoints only. The managed lists are back to that name and the cn.com.amazonaws. reservation is gone; DescribeVpcEndpointServices now names the interface services through the table instead, keeping the S3 gateway entry on com.amazonaws.
Edge-optimized API Gateway exists only in the commercial partition: China has CloudFront but no edge-optimized APIs or domains (its API Gateway documentation says so), so EDGE custom domains are refused everywhere else. Where the CDK publishes no SAML sign-on URL (aws-iso-e, aws-iso-f, aws-eusc) assertions keep being checked against the commercial URL, as every partition was before, instead of all being refused. applyEndpointType has its javadoc back.
* fix(lambda): return event source mapping ARN and support tagging mappings
CreateEventSourceMapping now stores Tags, every mapping response carries
EventSourceMappingArn, and TagResource/ListTags/UntagResource route
event-source-mapping ARNs to the mapping instead of rejecting them as
non-function ARNs.
* fix(lambda): address review on event source mapping ARN and tags
- CloudFormation builds EventSourceMappingArn from the region and account
the mapping is stored in, not the stack's, so it matches Lambda's ARN.
- TagResource rejects a non-object Tags or a non-string tag value with
SerializationException instead of persisting it.
- The tag APIs match a mapping ARN exactly, so an ARN in another partition
is reported as ResourceNotFoundException.
- Explain the tolerated teardown failures in LambdaEsmTagsTest.
The shared DockerClient's connection pool was hard-coded to 100. Each live
Lambda container holds two of those connections for its whole lifetime
(the followed log stream and the exit watcher), so about 50 warm
containers exhaust the pool. Create, start, stop and remove then wait for
a free connection, including the idle-container stop that would release
one, and the emulator stalls.
Expose the size as floci.docker.max-connections
(FLOCI_DOCKER_MAX_CONNECTIONS), reject values below 1, and default it to
1024 so that the 500-port Lambda runtime API range, not the Docker pool,
is the ceiling on concurrent Lambda containers.
Refs #2219, #2224
Co-authored-by: Goooooooooody <205637002+Goooooooooody@users.noreply.github.com>
The MaxItems and ServiceNamespaces validation messages added in #4543 did
not read the way IAM's do. AWS leads with the error count, quotes the
offending value, and names only the bound that was actually broken, so a
MaxItems of 1001 says "Member must have value less than or equal to 1000"
and nothing about the minimum.
Both messages now go through the helpers this handler already had for that
shape. tagValidationError builds the scalar form, so it is renamed
validationError now that it serves more than the tag paths, and MaxItems
reports whichever side of the range it fell outside rather than reciting
both. checkListLength builds the list form, which deliberately does not
quote the value, and takes its limit as an argument so ServiceNamespaces
can use it instead of echoing 201 namespaces back in an error message.
The tests asserted only that the response contained "ValidationError",
which is what let the wrong shape through in the first place. They now
assert the whole message, on the parsed Error.Message element rather than
the raw body, since the XML escapes the quotes AWS puts around the value.
GetServiceLastAccessedDetails reports the services an entity can reach, but
a grant that names no namespace could not be expanded: "Action": "*", a
globbed prefix such as s3*, and any NotAction all denote a set no policy
document spells out. A user holding only AdministratorAccess came back with
an empty report. Closes#4487.
The list of namespaces is vendored in aws/iam-service-namespaces.json and
generated by tools/aws/regen_service_namespaces.py from AWS's Service
Reference Information index, whose per-service "service" field is the IAM
namespace itself. botocore is deliberately not the source, even though every
other vendored file here comes from it: a namespace is not any botocore
field, since CloudWatch's endpointPrefix is monitoring and its serviceId is
CloudWatch against an IAM namespace of cloudwatch. A rule over botocore
metadata is wrong for some service, and a wrong namespace is worse than a
missing one because it names something IAM does not have.
That index is a live endpoint rather than a pinned dependency, so unlike
regen_partitions.py a fresh generation is not byte-identical and byte
equality is the wrong gate. What must be guaranteed is that nothing in the
file is invented, which is checked directly: make iam-namespaces-check
validates the file's shape offline, and make iam-namespaces-verify checks
online that every namespace in it still exists upstream, failing on one that
does not. Services AWS has added since the last sync are reported without
failing, since the file being behind makes the report incomplete rather than
wrong.
A namespace a policy names outright is kept whether or not the catalog knows
it, so a catalog trailing an AWS launch still reports an explicitly named
service; only wildcard expansion depends on it being current. A globbed
prefix now expands to the namespaces it matches rather than being treated as
every service and then dropped.
* fix(elbv2): scope SetRulePriorities conflicts to the rule's listener
SetRulePriorities rejected a priority held by any rule in the region, so a
rule on one load balancer could not move to a priority used on another. AWS
scopes rule priorities to a listener ("A listener can't have multiple rules
with the same priority"), as CreateRule already did here.
Conflicts are now checked per listener, against that listener's rules that
are not part of the request. Two rules of the same listener given the same
priority in one request now fail with PriorityInUse instead of both being
applied.
* test(elbv2): keep SetRulePriorities compatibility tests in execution order
* fix(elbv2): check SetRulePriorities collisions against the concurrent rule map
The listener index lists are plain ArrayLists that CreateRule and DeleteRule
mutate without a lock, so iterating them could throw
ConcurrentModificationException. Iterate the region's ConcurrentHashMap and
filter by listener instead.
* fix(elbv2): tunnel WebSocket upgrades to instance and ip targets
The ALB data plane stripped Connection and Upgrade as hop-by-hop headers and
proxied a WebSocket handshake as a plain request, so the target answered it as
a non-upgrade (typically 400) and socket.io clients stayed on long-polling.
Forward the handshake with its upgrade headers, relay the target's 101, then
tunnel bytes both ways until either side closes or the load balancer's
idle_timeout.timeout_seconds passes with no data. A target that refuses the
upgrade has its answer relayed unchanged. Upgrades to Lambda targets are
rejected with 400, as AWS does.
Closes#4516
* fix(elbv2): bracket IPv6 target literals in the proxied Host header
Covers WebSocket upgrades to instance targets as well.
* refactor(ses): model SES sends as an envelope plus content, like the v2 SDK
The five SES send methods took up to 15 positional parameters, and every
new send field cascaded through all of them and their callers. Sends now
follow the v2 SDK shape: a SendEmailRequest envelope carrying a sealed
EmailContent (Simple, Template, InlineTemplate or Raw), and a
SendBulkEmailRequest for bulk. SesService exposes sendEmail, which
switches on the content, and sendBulkEmail.
The controllers keep their validation, error codes and tenant gates;
each maps its wire input onto the envelope and picks the content
variant. The request always carries the content being sent: rendering
and header sanitizing rebuild it rather than holding a second copy.
No wire behaviour changes.
* refactor(ses): share the recipient join between the request and MIME headers
AWS checks IndexName on CreateTable GSIs and LSIs and on every UpdateTable
GSI Create, Update and Delete. It must be present, match [a-zA-Z0-9_.-]+
and be 3 to 255 characters long. The error names the member path, lists
the pattern error before the length error, and comes before the table
lookup. Floci accepted any name, and a malformed name on Update or Delete
was reported as a missing index.
* fix(ssm): support name:version and name:label selectors in GetParameter
- Support name:version and name:label selectors in GetParameter and GetParameters
- Resolve selector against parameter history copies without mutating stored parameters
- Validate labels in LabelParameterVersion per AWS spec (reject numeric and reserved labels)
- Return invalid labels in InvalidLabels response
- Synchronize labelParameterVersion and clone history entries to handle concurrent updates without in-place mutation
- Enforce 10-label maximum limit per parameter version
- Default to latest version only when ParameterVersion is omitted
- Guard against NPE and trailing colons in getParameter selector lookup
Closes#4396
* fix(ssm): enforce label validation constraints in LabelParameterVersion
- Reject empty labels and labels exceeding 100 characters with ValidationException
- Reject empty label lists and lists with more than 10 labels with ValidationException
- Update findSelectedVersion comment to reflect that labels are unique across versions
* refactor(glue): move PartitionProjection from athena to glue package
PartitionProjection resolves Glue table partition layout, not Athena-specific
logic — Athena is only its current caller. Moving it into services/glue gives
the upcoming GlueTableResolver (Redshift Spectrum Phase 2) a home for it
without a glue-depends-on-athena layering inversion.
readPath and assertInjectedColumnsFiltered become public (their callers stay
in services/athena, a different package now); enabled/parameter stay
package-private since nothing outside the class uses them.
* refactor(glue): extract GlueTableResolver from GlueViewDdlBuilder
GlueViewDdlBuilder now delegates table-to-read-plan resolution (read function
inference, read expression, Iceberg detection, column projection) to a new
public GlueTableResolver, so Redshift Spectrum's Glue-backed external tables
can reuse the same logic Athena already proved correct.
* refactor(redshift): extract RedshiftRoleAccess from S3CopySimulator
COPY and UNLOAD's IAM role resolution and S3 authorization now live in a
standalone RedshiftRoleAccess, matching the existing ManifestReader
extraction pattern in this package, so Redshift Spectrum's Glue-backed
external schemas (IAM_ROLE-authorized reads) can reuse it instead of
duplicating role-session and policy-evaluation logic. Adds direct coverage
for the enforced-policy-denial path, which only had implicit
enforcement-off coverage before this extraction.
* fix(redshift): follow RedshiftRoleAccess in native init list and partition baseline
* fix(elasticache): honor top-level user passwords and let ModifyUser change auth and access string
CreateUser read passwords only from AuthenticationMode, so a user created
with the top-level Passwords member (aws elasticache create-user --passwords)
was stored as no-password-required. ModifyUser ignored AuthenticationMode.Type,
NoPasswordRequired, AccessString and AppendAccessString, so a user's auth mode
and permissions could not be changed without deleting it.
Both actions now resolve authentication from AuthenticationMode or from the
top-level Passwords and NoPasswordRequired members, and reject contradictory
combinations with InvalidParameterCombination.
* test(elasticache): use explicit response types in the user auth compat test
* ci: re-run checks after a Docker Hub image pull rate limit
The previous run's shard 3 failed on 'toomanyrequests: Data limit exceeded' while pulling images for three ECS and core Docker integration tests. Nothing in this branch touches those paths.
The last-accessed readers accepted any MaxItems and treated an omitted one
as no limit at all, and ListPoliciesGrantingServiceAccess accepted any
number of service namespaces. The IAM API reference documents all three
bounds, so a client that pages against AWS saw different results here.
GetServiceLastAccessedDetails and GetServiceLastAccessedDetailsWithEntities
both state that the item count "defaults to 100" when MaxItems is omitted,
with a valid range of 1 to 1000. An omitted MaxItems now pages at 100 and
reports IsTruncated with a Marker rather than returning the whole report,
and a value outside the range is a ValidationError instead of being honored.
serviceNamespaceListType allows a maximum of 200 members, which is now
enforced alongside the existing minimum of 1.
The overflow guard on the page arithmetic stays even though the new ceiling
makes a value large enough to overflow unreachable, because the ceiling and
the offset are enforced in different places.
Ten container managers each carried their own copy of the docker exec
round trip: create the exec, attach a frame callback, wait for it, then
read the exit code. The copies disagreed on what a timeout returns, on
whether an attach-stream error throws, and on how output frames are
decoded.
ContainerExec now owns that round trip. MWAA, Flink, Timestream,
Redshift, RDS, EKS, both EC2 managers and the ECS credentials proxy call
it, and the four identical ExecResult records and three
ContainerExecResult variants give way to ContainerExec.Result. The seven
Docker integration tests that hand-rolled the same exec (EKS IMDS, IRSA,
pod identity, Route 53 and VPC route programming, EC2 volumes, RDS
Postgres) use it as well.
A timeout now returns exit code -1 with the output captured so far and a
"Timed out after Ns" note in stderr. MWAA, Flink and EKS still throw on a
timeout, through Result.throwIfTimedOut. Output is decoded once from the
collected bytes, so a multi-byte character split across frames survives,
and an interrupt keeps the thread's interrupt flag. The two EC2 managers
keep reporting a Docker error as a failed result, so an attach error on
one sshd path still falls through to the next. An interrupt is the
exception in Ec2ContainerManager: it still ends the setup step it hits,
as it did before, instead of being retried on the next sshd path.
The ECS credentials proxy's reachability probe waited on its exec with no
timeout at all. It now gives up after 10 seconds and treats that like any
other failed probe, retrying until its verify budget runs out.
GetBucketTagging returned 200 with an empty TagSet when a bucket had no tags, including after DeleteBucketTagging. AWS returns the NoSuchTagSet error instead. S3 Control ListTagsForResource still reports an empty list.
* fix(s3): align generated presigned URLs with SigV4 and request region
* fix(s3): refresh presign credentials after storage reset
* fix(s3): retire expired generated presign sessions
* fix(iam): sweep expired sessions by stored key
* fix(s3): scope generated presign credentials
* fix(s3): authorize conditional generated URLs and slash keys
* test(s3): preserve signed URL semantics in tagging and SES regressions
* fix(s3): reject tag injection on scoped generated PUT URLs
* style(s3): alphabetize presigner Java imports
* fix(s3): deny scoped requests without a raw HTTP path
* fix(s3): authorize proxied presigned URLs by signed path
* fix(s3): use signed path for proxied object requests
* style(s3): order presigned URL test imports
* fix(dynamodb): reject undefined expression attribute placeholders
PutItem/DeleteItem/UpdateItem ConditionExpression, UpdateItem's own
UpdateExpression, Query KeyConditionExpression, Query/Scan FilterExpression,
and TransactWriteItems' ConditionCheck/Put/Delete/Update ConditionExpression
and Update UpdateExpression accepted a #name or :value placeholder with no
matching ExpressionAttributeNames/Values entry, instead of rejecting it with
AWS's ValidationException. Writes fell through to a false
ConditionalCheckFailedException (or, inside a transaction, a
TransactionCanceledException with a false ConditionalCheckFailed reason),
reads silently evaluated the condition as non-matching (Query) or ignored it
entirely (Scan), and an undefined #name in an UpdateExpression's SET clause
was silently stored as an attribute literally named "#n" instead of being
rejected (standalone UpdateItem and inside a transaction alike). An undefined
#name in KeyConditionExpression additionally surfaced the wrong error, "Query
condition missed key schema element", because attribute resolution silently
left the alias unresolved.
Generalizes the pattern already used for UpdateExpression's undefined :value
check and Query's FilterExpression undefined #name check into a shared
requireDefinedTokens helper, applied to the remaining expression/handler
combinations, and built on the same ordered token scanner extractHashTokens
and extractColonTokens already used. The helper reports whichever undefined
token appears first in the text; in UpdateItem the ConditionExpression check
now runs before the unused-EAN/EAV checks rather than after.
ProjectionExpression's undefined #name check and KeyConditionExpression's
undefined :value check were already correct and are untouched.
* fix(dynamodb): check undefined placeholders before semantic validation
ExpressionEvaluator.validateExpression's semantic checks (contains()'s
distinct-operand rule, begins_with()'s operand type, BETWEEN's bound
ordering) ran before requireDefinedTokens at every call site, so an
undefined #name/:value could surface the wrong error, e.g.
contains(#missing, #missing) reported the distinct-operand error instead
of the undefined name. Verified against amazon/dynamodb-local:3.3.1 that
DynamoDB reports the undefined placeholder first for contains(), begins_with()
type mismatch, and BETWEEN bound ordering, while a syntax error or redundant
parentheses still outrank an undefined placeholder.
Splits validateExpression into validateSyntax (tokenize/parse/redundant-
parentheses, unchanged position) and validateSemantics (the checks above),
and reorders each handler to run requireDefinedTokens between them.
validateExpression itself is untouched and still used as-is by
DynamoDbVectorSearch's SearchConditionExpression.
In UpdateItem, ConditionExpression's semantic check must also outrank the
unused-EAN/EAV checks (#2893), not just requireDefinedTokens: moved
validateSemantics to run immediately after requireDefinedTokens(conditionExpression)
in both the UpdateExpression-present and UpdateExpression-absent branches,
ahead of checkUnusedEan/checkUnusedEav. Verified the same ordering already
held in PutItem, DeleteItem, Query and Scan (their unused checks already ran
after validateSemantics), and that TransactWriteItems has no unused-EAN/EAV
check to conflict with.
Also adds braces to the unbraced conditionals in the token scanner added by
the previous commit, per AGENTS.md.
* fix(dynamodb): keep projection validation after filter semantics
The syntax/semantics split moved FilterExpression's undefined-token and
semantic checks below ProjectionExpression's in Query and Scan, so a
Query/Scan with FilterExpression "contains(a, a)" and an undefined #name in
ProjectionExpression now reports the projection error instead of the filter
one. Verified against amazon/dynamodb-local:3.3.1: FilterExpression's checks
outrank ProjectionExpression's, which in turn outrank
KeyConditionExpression's (unchanged, and already correctly ordered).
On AWS, deleting or updating a GSI the table does not have fails with
ResourceNotFoundException "Requested resource not found: Index <index>
for table <table>", with the table name even when TableName is an ARN.
Floci used its own message for a delete and a ValidationException for an
update.
* feat(route53resolver): apply resolver rules to DNS resolution
Resolver rules were stored and ignored. The embedded DNS server now consults them
before resolving a name itself, via two CDI SPIs so core.common.dns imports neither
Route 53 Resolver nor EKS: DnsForwardingRuleSource supplies the rules associated with
one VPC, DnsClientVpcSource maps a query's source address to the VPC it came from.
FORWARD rules forward the raw query to their TargetIps, each on its own port, in a
random order with the next target tried when one does not answer. SYSTEM and RECURSIVE
rules carry no targets and hand the query back to Floci, so a SYSTEM rule carves a
subdomain out of a broader FORWARD. Matching is exact-or-subdomain on label boundaries
and the most specific matching rule wins. A rule takes precedence over a private hosted
zone matching the same name, as AWS documents. Floci's own suffixes and ec2.internal
names resolve locally whatever the rules say, as AWS autodefines system rules for its
internal domains. A rule whose targets are all unreachable answers SERVFAIL for that
query only.
Route53ResolverDnsForwardingRules reads the rule and association stores through
Route53ResolverService across account partitions, since the packet path has no caller.
EksClusterManager claims its cluster node container addresses for the cluster's
resourcesVpcConfig.vpcId.
* fix(route53resolver): scope rule DNS lookups to the querying account
AssociateResolverRule stores whatever VPCId the caller names without proving
ownership of it, so joining associations across account partitions by VPC id let
one account redirect another account's cluster DNS by naming its VPC. The DNS
client VPC now carries the account alongside the VPC id, and the rule source
reads only that account's associations.
Rules are fetched by id instead of scanned for, so a query reads only the rules
an association named rather than the whole rule store, and registration warns
when a running cluster's container addresses cannot be determined instead of
leaving its rules silently inert.
Also stop setting the authoritative bit on the SERVFAIL answer for a forwarded
query: Floci is not the authority for a name a rule sends elsewhere.
* style(route53resolver): import Optional instead of qualifying it inline
* fix(route53resolver): scope rule DNS lookups to the querying region
Route 53 Resolver is regional, so a rule created in one region governs nothing in
another, but the DNS path matched on account and VPC alone. A rule created in
eu-west-1 therefore steered a query from a VPC in us-east-1. The DNS client origin
now carries the region, and a rule is only applied when its own region matches.
The stores carry no region in their keys, so a rule's region is read back from the
ARN the service minted for it rather than reshaping the stores. A stored rule with
no parseable ARN has no region to claim and is treated as belonging to the region
asking, which no create path can produce.
Associations are now read as rule ids rather than as nodes, so a query no longer
deep-copies a record per association when all it needs is which rules to look at.
* test(eks): pin the warning when a cluster's addresses cannot be determined
Inspecting the node container can fail, and when it does the cluster gets no VPC
mapping and its queries quietly ignore every associated resolver rule. Nothing
fails, so the warning is the only way a reader finds out, which makes it worth a
test rather than leaving it to inspection.
Levels are compared by severity rather than identity because JBoss LogManager
has its own Level constants, so its WARN is not java.util.logging's WARNING.
Glue had no workflows: CreateWorkflow, StartWorkflowRun and the rest
answered InvalidAction. Add CreateWorkflow, GetWorkflow, ListWorkflows,
BatchGetWorkflows, UpdateWorkflow, DeleteWorkflow, StartWorkflowRun,
StopWorkflowRun, ResumeWorkflowRun, GetWorkflowRun, GetWorkflowRuns,
GetWorkflowRunProperties and PutWorkflowRunProperties, and let triggers
belong to a workflow.
StartWorkflowRun fires the workflow's starting triggers inside a new
run. The workflow's conditional triggers fire only on job runs and
crawls of that run, evaluate AND within it, and start their actions in
it; job runs get --WORKFLOW_NAME and --WORKFLOW_RUN_ID. A run completes
once nothing in it runs and nothing more fires. GetWorkflow and
GetWorkflowRun report the graph of trigger, job and crawler nodes.
Closes#4380
* fix(dynamodb): reject an unknown BillingMode
CreateTable, UpdateTable and ImportTable accepted any BillingMode and
treated an unknown one as PROVISIONED. AWS rejects it with a
ValidationException before looking up the table. ImportTable reports the
member as tableCreationParameters.billingMode.
* fix(dynamodb): check an import's BillingMode before its ClientToken
On AWS an ImportTable retry with the same ClientToken and an unknown
BillingMode fails with the BillingMode ValidationException, not with
ImportConflictException. The check now runs before the token lookup.
GetLogEvents and FilterLogEvents sorted every stored event in the
stream or group before applying the startTime/endTime (and, for
FilterLogEvents, the filter pattern) window. Apply the cheap per-event
filters first so only the events that survive the window get sorted;
results, ordering, and pagination tokens are unchanged.
* fix(dynamodb): size numbers by base-100 digit pairs
DynamoDB stores a number as base-100 digits paired from the decimal point.
It costs one byte per pair plus one, and one more when negative. Floci
counted the characters of the number text, so items full of numbers hit
the 400 KB limit too early or too late, and capacity was off too.
On AWS, 110 and 0.015 cost 3 bytes, 1100 and 0.0015 cost 2, 3.14159
costs 5 and 1E125 costs 2.
* fix(dynamodb): drop the sign byte at 20 pairs and survive huge exponents
On AWS a negative number of 20 base-100 pairs costs 21 bytes, the same as
a positive one. Below 20 pairs it costs one byte more.
A number whose exponent overflows BigDecimal's scale now falls back to its
text length instead of throwing, and the pair math runs in long.
* fix(dynamodb): brace the number size branch
* fix(dynamodb): charge a number set only for its members
On AWS an NS set costs the sum of its members and nothing per member.
{"NS":["1"]} costs 2 bytes like {"N":"1"}, and ["1","2","3"] costs 6.
A request carrying no Authorization header returned before any policy check, so with enforcement on an unauthenticated caller reached every emulated API by simply omitting the header.
Refuse one whose wire shape names a management operation: a JSON, CBOR or Query claim exists only for a request carrying X-Amz-Target, an rpcv2 path or an Action parameter. AWS answers a credential-less request with MissingAuthenticationToken at 403, returned here in the encoding the request used.
Operations AWS itself serves without credentials stay allowed, taken from the authtype: none trait in its service models: the Cognito user-pool and identity flows and the two web-identity and SAML AssumeRole calls. The list is keyed by service because GetUser needs no credentials on cognito-idp and requires them on iam.
REST is left alone. This filter also sees the API Gateway execute path, Lambda function URLs, CloudFront serving and the Cognito OIDC endpoints, which are unsigned by design, and a REST claim does not say which service will serve the request.
The CBOR error shape moves into CborErrorResponses, shared with the rpcv2 controller so the two cannot drift into answering the same failure differently.
EksIrsaDockerIntegrationTest set up its IAM fixtures over unsigned Query calls and so began failing: CreateRole is not an operation AWS serves without credentials. Its fixture calls now carry the root stand-in credential, which is what every other test does under enforcement. The AssumeRoleWithWebIdentity calls it actually tests stay unsigned, as AWS serves those without credentials.
tagKeyListType members are tagKeyType, so the 1-128 length and the tag
character pattern apply to TagKeys on every untag action, not only to the
keys sent when tagging. extractTagKeys only checked the count, so an untag
with an empty, overlong or malformed key succeeded. The key checks now live
in one helper shared by extractTags and extractTagKeys, and a rejected
untag removes nothing.
* fix(ecs): reconcile persisted services at boot
EcsService is ApplicationScoped, so Quarkus only creates it on the first
ECS request, and creating it is what loads the ECS stores and starts the
reconciler. After a restart every persisted service stayed without tasks,
load balancer targets or Cloud Map instances until something called the
ECS API.
EmulatorLifecycle now calls EcsService.restorePersistedRuntime() after
storage is loaded and the load balancers are restored, the way it already
restores RDS, ElastiCache and ELBv2.
* test(ecs): assert boot starts the ECS reconciler through CDI
A failed restore released the reserved proxy port and persisted the record
with port 0, so the next boot allocated the lowest free port in iteration
order and renumbered the endpoints: an old DSN then reached a different
database and failed auth. The retry path also dereferenced the nulled
endpoint.
Failed instance and cluster restores now keep their port and endpoint
reserved, as proxies already did. Persisted ports are also reserved for
their owners before any restore allocates, so a record without a port
cannot take one that a later record persisted.
Follow-up to #4411, both items raised by hectorvent in that review.
ensureReady checked the pool's reset generation before registering its
new container in the map, not after: a stopAll() landing in the gap
between that check and the registration could still run its own sweep
over the map without finding the container (it was not in the map
yet), then have the registration land afterward with nothing left to
ever stop it, the same leak the generation check was meant to close in
the first place. A second variant let a stopAll() land between the
sweep and the map clear, wiping the entry stopAll() itself never got
the chance to visit.
Registering first and only then comparing the generation, removing and
stopping locally on a mismatch rather than trusting whatever stopAll()
may have already done to the map, closes both: either stopAll()'s own
sweep finds the container because the registration already landed, or
the registration lands after the sweep and the generation check catches
it. stopAndRemove already tolerates a double-stop of the same container
(both its stop and remove calls treat "already gone" as success), so
there's no failure mode where both paths race to clean up the same one.
Also drops VerdaccioSidecarManager's class javadoc reference to the
CodeArtifactService repository-record walk that #4411 removed; it was
describing something that no longer exists.
The wiring landed in #4486 but none of the four
FLOCI_SERVICES_ECS_TASK_ROLE_CREDENTIALS_* settings were written down
anywhere, and nothing said the credentials proxy needs a user-defined
Docker network rather than the default bridge.
Adds them to the environment variable reference, the application.yml
example and the ECS service page, the last with a short section on how
the endpoint is reached and the two cases where a task does not get
credentials: one that sets its own, and one under security-group
enforcement.
Also fixes two things the same work left behind in the source. The
cleanupProtectedNetwork javadoc was orphaned when
prepareTaskRoleCredentials was inserted between it and its method, and
two config javadocs still described the wiring and the proxy as
follow-up work.
* fix(ec2): include the security group helper Dockerfile in the native image
With security group enforcement on and no helper image on the daemon, the native image failed every EC2 launch with "Floci helper Dockerfile is missing". The Dockerfile is read with getResourceAsStream, which the native image only serves for listed resources.
* fix(docker): omit DNS servers for containers that share another container's network
Docker rejects DNS servers together with container:<id> network mode, so an EC2 instance or ECS task under security group enforcement failed to launch whenever Floci ran in a container, where it injects its embedded DNS. The container already uses the resolver of the container whose network it shares, the same reason extra hosts are left out.
* fix(ec2): give the security group helper Floci's DNS and host entries
A workload under enforcement joins its helper's network namespace and uses the helper's resolver and hosts file, where DNS servers and extra hosts on the workload itself are not allowed. The helper had neither, so a workload could not resolve Floci's endpoint hostname when Floci ran in a container.
* chore(config): check that helper Dockerfiles are in the native image
LocallyBuiltHelperImage reads its Dockerfile through a method parameter, which the constant check cannot follow.
* fix(ec2): let workloads reach their DNS servers whatever their security groups allow
Docker's resolver listens on loopback but forwards from the workload's network namespace, so a security group without UDP 53 egress left the workload unable to resolve any name. On AWS, security groups never filter traffic to the VPC resolver. The firewall now always allows port 53 to the helper's DNS servers.
* chore(ec2): keep each security group helper's DNS servers with the helper
Service fields stay final, and a helper no longer takes the DNS servers of the last helper created.
* fix(ec2): read a security group helper's DNS servers from its container
Keeping them in a map leaked an entry for every helper whose task failed before registering, and a helper restored after a restart had none. The rules now take them from the helper's HostConfig, which reconcileAll already inspects.
* fix(ec2): exempt only Floci's DNS from security groups, not the fallback resolvers
On AWS the exemption covers only the Amazon DNS server in the VPC, which Floci's embedded DNS stands in for. A public resolver is ordinary internet traffic that a security group filters, so a group that denies egress now blocks 8.8.8.8 and 8.8.4.4 too.
Program static kernel routes in EKS cluster containers from emulated
VPC route tables associated with the cluster subnets or VPC.
- Implement route table resolution for cluster VPC and subnets
- Resolve EC2 instance and network interface targets to reachable IPs
- Generate idempotent routing shell commands using ip route
- Attach cluster containers to the VPC bridge network when present
- Notify active clusters on route table modifications via VpcRouteTableListener
- Add configuration flag floci.services.eks.vpc-route-programming
- Add unit and Docker integration tests for route programming
* fix(redshift): remove a stale cluster container before creating it
* fix(redshift): keep legacy-named containers when starting a cluster
* test(redshift): drop the zero-ETL cluster teardown
Reject duplicate tag keys in a single request with 400 InvalidInput, matching AWS IAM behavior:
- Users and roles treat tag keys case-insensitively for duplicate checks.
- Policies, instance profiles, OIDC and SAML providers treat tag keys case-sensitively for duplicate checks.
- User and role tag updates preserve existing tag key casing.
- UntagUser and UntagRole remove tags case-insensitively.
- Re-tagging an existing tag with alternate casing stays within the 50-tag quota.
Signed-off-by: Abdul Wali Dal <148618788+abdulwalidal@users.noreply.github.com>