Commit Graph
388 Commits
Author SHA1 Message Date
Taewoo Ryu aee46fe2da feat(lambda): mount host AWS config for real credential discovery (#703)
When FLOCI_SERVICES_LAMBDA_AWS_CONFIG_PATH is set, bind-mount the host
path read-only into Lambda containers at /opt/aws-config and set
AWS_SHARED_CREDENTIALS_FILE and AWS_CONFIG_FILE env vars so the SDK
discovers credentials regardless of container HOME directory.

When unset, credentials are read from Floci's own environment with a
fallback to test/test/test. Blank values are treated as absent.

Closes #686
2026-05-05 18:22:12 -05:00
Hector Ventura d620c18534 fix(ec2): AssociateRouteTable associationState, RouteTable association filters, DescribeTags filters (#706)
- Include <associationState> in AssociateRouteTable response so Terraform
  v6 waiters can confirm association without timing out
- Add association.route-table-association-id, association.subnet-id,
  association.gateway-id, and association.main filter support to
  DescribeRouteTables
- Apply resource-id, resource-type, key, and value filters in DescribeTags
  (previously all filters were ignored, returning every tag)
- Add RouteTableAssociation.gatewayId field for gateway-id filter support
- Add integration tests covering new filters and associationState assertion
- Add VPC networking resources to compat-terraform and compat-opentofu
  suites (IGW, subnet, route table + association, security group)
2026-05-05 00:11:51 -05:00
Hector Ventura 7900cdbcb2 fix(docker): respect DOCKER_HOST env var and handle missing URI scheme (#705)
When DOCKER_HOST is set without a scheme (e.g. "10.37.124.101:2375" in
Bitbucket Pipelines), docker-java's createDefaultConfigBuilder() calls
URI.create() on the raw value and throws IllegalArgumentException before
Floci's own withDockerHost() override can take effect. PR #665 normalized
the value from floci.docker.docker-host but left this crash path open.

- Add createDockerConfigBuilder() to catch the IAE and fall back to a
  fresh Builder() so the normalized host can still be applied
- Add resolveEffectiveDockerHost() to use DOCKER_HOST env var (normalized)
  as a fallback when floci.docker.docker-host is at its default unix socket,
  so CI environments like Bitbucket Pipelines work without requiring a
  separate FLOCI_DOCKER_DOCKER_HOST setting
- Add unit tests covering the Bitbucket scenario and edge cases

Fixes #663
2026-05-04 23:04:13 -05:00
Kenshin Okinaka 7fa2a28c62 fix(appconfig): use capital "Tags" body key matching AWS SDK wire format (#704)
AppConfigTagHandler inherited the default tagsBodyKey() = "tags"
(lowercase), so SharedTagsController parsed and serialised the tag
payload with the lowercase key. The AWS spec for AppConfig
TagResource and ListTagsForResource is capital "Tags" with a map
body, which is what AWS SDK clients send and expect — so SDK calls
to appConfig.tagResource(...) silently dropped tags and listing
came back empty.

Override tagsBodyKey() on AppConfigTagHandler to return "Tags".
The other axes (POST method, map body, lowercase tagKeys query)
already match the defaults so no further override is needed.

AppConfigIntegrationTest is updated to send capital "Tags" bodies
and assert capital "Tags" response keys, matching the AWS SDK
wire format. AppConfigTest (SDK compatibility) now exercises a
tagResource → listTagsForResource → untagResource round-trip via
AppConfigClient to lock in the wire format end-to-end.
2026-05-04 20:18:53 -05:00
Hector Ventura 4fe93aa379 feat(eventbridge): add Archive and Replay support (#702)
Implement EventBridge Archive and Replay APIs:
- Archive, ArchivedEvent, Replay, ArchiveState, ReplayState models
- ReplayDispatcher: async Vertx-based replay execution with cancel support
- EventBridgeService: createArchive, describeArchive, updateArchive,
  deleteArchive, listArchives, startReplay, describeReplay, cancelReplay,
  listReplays; event capture on putEvents via captureToArchives
- EventBridgeHandler: 9 new action cases wired to service methods
- Storage: 3 new StorageBackend fields (archives, archivedEvents, replays)
  wired through StorageFactory
2026-05-04 17:30:27 -05:00
3cc04994ea feat(sqs,dynamodb): TRACE-level payload logging (#697)
* feat(sqs,dynamodb): add TRACE-level payload logging

Add TRACE log lines that include request/response payloads for the
common SQS and DynamoDB operations -- off by default, opt-in via
per-category log level. Helps diagnose TestContainers-based test
failures where DEBUG IDs alone don't reveal what was sent.

SQS: SendMessage / SendMessageBatch / ReceiveMessage / DeleteMessage /
DeleteMessageBatch log body and attributes.

DynamoDB: PutItem / GetItem / UpdateItem / DeleteItem log the item;
Query and Scan log the returned and scanned counts (bodies would be
too noisy).

Ship quarkus.log.min-level: TRACE so a single category override is
enough -- users don't also have to lower the root floor.

Closes #613

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-04 17:30:10 -05:00
Kenshin Okinaka 8e30c09d0a feat(scheduler): support TagResource, UntagResource, ListTagsForResource (#700)
* feat(scheduler): support TagResource, UntagResource, ListTagsForResource

Implements the three remaining EventBridge Scheduler tag APIs by
extending the shared /tags/{arn} dispatcher. Tags apply to schedule
groups only, matching AWS behavior; ARNs pointing at individual
schedules return ValidationException.

A survey of all ~75 AWS services that share the /tags/{arn} path
shows three independent shape axes — body key (`tags` lower vs
`Tags` capital), body structure (map vs list of {Key, Value}), and
untag query parameter name (`tagKeys` vs `TagKeys`) — and most
"capital Tags" services still use lowercase tagKeys query, so these
axes vary independently. TagHandler exposes them as five orthogonal
default methods rather than a coarse-grained enum:

- tagsBodyKey()           defaults to "tags"
- tagsBodyIsList()        defaults to false (map)
- tagKeysQueryName()      defaults to "tagKeys"
- tagResourceUsesPut()    defaults to false (POST)
- strictTagValidation()   defaults to false (lenient parsing)

The defaults match the most common AWS shape (~73 services use
lowercase tags map + POST + lowercase tagKeys) so handlers like
EKS, Pipes, and AppConfig need no overrides. The dispatcher
returns 405 MethodNotAllowedException for the unused HTTP method
per handler. Strict input validation (missing Tags, wrong-shaped
Tags, missing TagKeys, entries missing Key or Value) is enforced
when strictTagValidation() is true, mirroring the AWS Scheduler
error shape; lenient handlers retain the looser parsing they had
before.

SchedulerTagHandler overrides tagsBodyKey, tagsBodyIsList,
tagKeysQueryName, and strictTagValidation. ApiGatewayTagHandler
overrides tagResourceUsesPut to true. AppConfigIntegrationTest
switches its tagApplication call from PUT to POST to match the
AWS spec for AppConfig (was relying on the dispatcher's prior
leniency on HTTP method).

* fix(tags): normalize empty body and reject non-object payloads

Address Copilot review on floci-io/floci#700.

- doTagResource normalizes null/blank request bodies to "{}" before
  passing to ObjectMapper.readTree, mirroring SchedulerController's
  parseTags. Previously an empty body raised a Jackson parse error
  that strict handlers surfaced as a ValidationException with a raw
  Java/Jackson message instead of the structured AWS error shape.
- parseTags adds a strict-only check that the JSON root is an
  object. A request body like a JSON array or string used to fall
  through to "Value null at 'Tags' ..." which misleads about the
  actual problem; it now reports that the payload itself must be a
  JSON object.

SchedulerIntegrationTest covers both paths with a 400 assertion.
2026-05-04 17:22:12 -05:00
Hector Ventura 023880b7d9 feat(parity): LocalStack drop-in compatibility (#696)
- Translate LocalStack env vars (LOCALSTACK_HOST, PERSISTENCE, LAMBDA_DOCKER_NETWORK, etc.)
  to Floci equivalents automatically at startup; opt out with LOCALSTACK_PARITY=false
- Serve /_localstack/init and /_localstack/health alongside /_floci/* equivalents
- Report executed scripts with path, state, and return_code in /_floci/init response
- Add /_aws/sqs/messages GET (non-destructive peek) and DELETE (purge) inspection endpoint
- Add /_aws/execute-api/{apiId}/{stageName} LocalStack-compat path for REST API invocation
- Add four-phase init hook lifecycle (boot/start/ready/stop) with dual-path discovery
  (/etc/floci/init/ and /etc/localstack/init/ compat paths)
- Install Python 3, AWS CLI, boto3 in standard image; wrap aws binary to pre-configure
  --endpoint-url=http://localhost:4566 so init scripts need no extra flags
- Wire entrypoint.sh + gosu privilege drop into all Dockerfile variants
- Add migration guide and update README, docker-compose, docker-images, SQS, and
  initialization-hooks docs
2026-05-04 01:15:59 -05:00
Tristan BurchandHector Ventura b84d205b89 feat: Glue Schema Registry support (#621)
* feat(glue): add Glue Schema Registry support
* Move Glue SDK coverage to compatibility tests
* Align protobuf compatibility expectations
* Resolve services index merge conflict
* Remove unused Lombok compatibility dependency
* Serialize Glue schema registry timestamps as strings
* Tighten Glue schema registry name validation
* Avoid duplicate schema registry index rebuild
* Limit schema registry in-memory constructor visibility
* Clone Glue tables before resolving schema references
* Align Glue schema registry response shapes
* Extract Glue schema version resolver helper

Both validateSchemaReference and withResolvedSchemaReference duplicated
the latest-version computation and the four-argument getSchemaVersion
call. Pull that into a private resolveSchemaVersion(SchemaReference)
helper so the call sites read at one level of abstraction and a future
change to the resolution rule lands in one place.
* Fix Glue schema version list projection

---------

Signed-off-by: Tristan Burch <tburch@users.noreply.github.com>
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
2026-05-03 22:41:19 -05:00
Kenshin Okinaka ac891db5a7 feat(ses): add TestRenderTemplate (v1) and TestRenderEmailTemplate (v2) (#692)
* feat(ses): add TestRenderTemplate (v1) and TestRenderEmailTemplate (v2)

Render a stored SES template against caller-supplied data and return the
resulting MIME message. v1 is dispatched via the Query protocol; v2 is
exposed at POST /v2/email/templates/{name}/render.

Template variable substitution is now strict: a missing attribute in the
rendering data raises MissingRenderingAttribute (mapped to BadRequestException
on v2), matching AWS / moto / LocalStack semantics. Invalid TemplateData
JSON raises InvalidRenderingParameter; non-object TemplateData is rejected
with operation-appropriate errors on the send paths (InvalidParameterValue
on v1, BadRequestException on v2).

The rendered output is a hand-rolled multipart/alternative MIME with a
Date header (UTC), Subject header, and text/plain + text/html parts.
Transfer encoding is auto-selected (7bit for ASCII bodies, 8bit for UTF-8)
matching moto's encode_7or8bit. Body line endings are normalized to CRLF.
Subject control characters and XML 1.0 invalid characters in the rendered
output are stripped to keep the response parseable by SDK clients.

Bulk per-entry rendering errors (MissingRenderingAttribute /
InvalidRenderingParameter raised at apply time) surface as INVALID_PARAMETER
in BulkEmailEntryResults rather than generic FAILED.

No new dependencies are introduced.

* test(ses): consolidate new SesServiceTemplateTest cases via @ParameterizedTest

Group 23 of the new unit tests added in this PR into 6
@ParameterizedTest methods driven by MethodSource data sets:

- pickTransferEncoding (ascii vs non-ascii) -> 1 test, 4 cases
- parseRenderingData invalid inputs -> 1 test, 5 cases
- normalizeToCrlf line-ending variants -> 1 test, 4 cases
- mapErrorCodeToBulkStatus -> 1 test, 4 cases
- sanitizeSubject control / DEL / Unicode preservation -> 1 test,
  6 cases (null-input case kept separate)
- stripXml10InvalidChars C0 / noncharacters / surrogates -> 1 test,
  11 cases

Coverage is preserved (every input that was exercised before is still
exercised; surfacing each case as an individual test makes the run
report show 58 cases instead of 49 for this file). The remaining
tests -- buildTestRenderMime structure assertions and the original
applyTemplateData edge cases -- stay as individual @Test methods
because they have distinct multi-step assertions.

* test(ses): address upstream Copilot style nits

- Remove unused containsString static import in
  SesTestRenderV2IntegrationTest after the parameterized refactor
- Replace assertEquals(true/false, ...) with assertTrue/assertFalse in
  SesServiceTemplateTest for clearer intent and better failure output
2026-05-03 09:18:10 -05:00
Chris Wright 7b0df82a86 fix(cfn): resolve floci virtual-hosted template urls (#690) 2026-05-02 20:55:42 -05:00
Chris Wright f359a94eaa fix(cfn): adopt existing dynamodb tables on update (#689) 2026-05-02 20:54:18 -05:00
Chris Wright c6763f12e7 fix(lambda): use function region in container AWS env (#687) 2026-05-02 20:53:06 -05:00
Hector Ventura 86bc33d115 fix: ecs delete resource issue (#685) 2026-05-02 16:51:05 -05:00
Hector Ventura b56c7ced82 fix(sfn): apply ItemSelector/Parameters transformation in Map state (#683)
Map state was passing each item raw to the branch executor, ignoring
ItemSelector (current AWS syntax) and Parameters (legacy syntax).

Now resolves the transform against the Map state's effective input
(after InputPath) and enriches the context with $$.Map.Item.Index
and $$.Map.Item.Value per iteration before calling executeBranch.
2026-05-02 13:32:17 -05:00
Hector Ventura b5dde6dae8 feat(autoscaling): EC2 Auto Scaling stored-state API + capacity reconciler (#681)
* feat(autoscaling): implement EC2 Auto Scaling Phase 1+2
* docs: updating documentation
2026-05-02 07:53:45 -05:00
Dixit R Jain 8fe2bf4c97 feat(apigatewayv2): add WebSocket API support, Update ops, Route/Integration Responses, Models, and Tagging (#682)
Closes #526

Add 27 new API Gateway v2 operations (21 → 48 total):

- WebSocket protocol: CreateApi with WEBSOCKET, wss:// endpoints,
  routeSelectionExpression validation, routeResponseSelectionExpression
- Update operations: UpdateApi, UpdateRoute, UpdateIntegration,
  UpdateAuthorizer, UpdateStage, UpdateDeployment
- Route Responses: full CRUD (5 ops)
- Integration Responses: full CRUD (5 ops)
- Models: full CRUD (5 ops)
- Tagging: TagResource, UntagResource, GetTags
2026-05-02 07:53:13 -05:00
Christian Franzen aaa1998508 fix(ecr): Properly check if host-persistent-path is the name of a Docker volume (#678) 2026-05-01 17:15:21 -05:00
Hector Ventura 91ed829ea0 feat(elbv2) alb proxy codedeploy ecs (#677)
* feat(elbv2,codedeploy): real ALB Vert.x proxy and ECS blue/green deployment

ELB v2 Phase 2: replace the mock ALB with a real Vert.x HTTP reverse proxy.
ElbV2DataPlane compiles listener rules into an atomic rule chain and proxies
requests to target group members. ElbV2HealthChecker runs periodic health
checks against registered targets. shiftListenerForward atomically rewrites
the default forward rule (simple or weighted) for CodeDeploy traffic shifts.

CodeDeploy Phase 3: implement full ECS blue/green deployment. CreateDeployment
drives the complete lifecycle — green task set creation, BeforeInstall /
AfterInstall / BeforeAllowTraffic hooks, ALB listener traffic shift (AllAtOnce,
Canary, or Linear), AfterAllowTraffic hook, green task set promoted to PRIMARY,
blue task set deleted. Compute platform is resolved from the Application when
the deployment group doesn't carry it, matching real AWS SDK behavior.

* fix: refactor to use arnUtils
2026-05-01 02:05:00 -05:00
Hector Ventura 57a8d58ed4 refactor: centralize ARN parsing and construction in AwsArnUtils (#676)
Replace ~60 scattered split(":")[n] accesses and "arn:aws:..." string
concatenations with a single Arn record that owns both responsibilities.

AwsArnUtils.Arn.of(service, region, accountId, resource).toString()
covers all construction. AwsArnUtils.parse() with regionOrDefault() /
accountOrDefault() covers all parsing. RegionResolver.buildArn() delegates
to Arn.of() internally.

Service-specific ARN parsers (LambdaArnUtils, DynamoDbTableNames,
AppConfigTagHandler) keep their domain validation but delegate the
six-field base parsing to AwsArnUtils.parse().
2026-05-01 01:19:17 -05:00
Chris Wright b15daf51ed feat: add Fn::ImportValue cross-stack reference resolution for CloudFormation (#669)
Implement cross-stack export/import support so CDK multi-stack deployments
resolve Fn::ImportValue tokens to actual values instead of passing them
through as literal strings.

Changes:
- Track exports from stack Outputs with Export.Name declarations
- Maintain a global per-region export registry in CloudFormationService
- Resolve Fn::ImportValue in CloudFormationTemplateEngine via the registry
- Add ListExports API action with AWS-compatible XML response
- Include ExportName in DescribeStacks output XML
- Validate duplicate export names across stacks (AWS-compatible error)
- Fail stack creation when Fn::ImportValue references a missing export
- Clean up exports on stack delete and update
- Route ListExports through AwsQueryController

Tests:
- Cross-stack Fn::ImportValue with Fn::Join
- Dynamic export names via Fn::Sub
- Export rename on stack update
- Duplicate export name rejection
- Missing import value failure
2026-04-30 21:27:53 -05:00
Avi Shefi 4bb4f24fcd fix(sqs): inject QueueUrl into form body for query protocol path-based requests (#670)
AWS SDKs using the form-encoded query protocol send queue-specific operations
(GetQueueAttributes, SendMessage, ReceiveMessage, etc.) with the queue URL as
the HTTP path and no QueueUrl in the body:

  POST /000000000000/my-queue HTTP/1.1
  Content-Type: application/x-www-form-urlencoded
  Action=GetQueueAttributes&AttributeName.1=QueueArn

#153 fixed routing for this pattern (preventing S3Controller from handling
the request), but QueueUrl was lost after the path rewrite, so SqsQueryHandler
received null and returned QueueDoesNotExist.

Fix: before rewriting the path, reconstruct the queue URL from the original
path components and append it to the entity stream as a form parameter
(&QueueUrl=...). SqsQueryHandler then reads it naturally from the form body.
Content-Length is updated when present. AwsQueryController is unchanged.

Affects Java SDK v1, Python boto3 (legacy), Go SDK v1, .NET SDK v1, and any
other client using the query protocol with path-based queue URL routing.
2026-04-30 20:33:25 -05:00
jsoizo 13203954b3 feat(cognito): implement AdminRespondToAuthChallenge operation (#666)
Adds the admin variant of RespondToAuthChallenge, enabling server-side
challenge response handling with explicit UserPoolId validation.
Extracts shared challenge logic into processChallenge to avoid duplication.
2026-04-30 20:29:36 -05:00
Hector Ventura 832cdf94db feat(ec2): real Docker container execution with SSH, UserData, and IMDS (#658)
* feat(ec2): real Docker container execution with SSH, UserData, and IMDS
* fix: test for ec2
2026-04-30 18:28:17 -05:00
Christine Nguyen 30051b77c8 feat(pipes): populate SQS message attributes in pipe source records (#667) 2026-04-30 18:15:56 -05:00
Yorí 3f4865b949 Fix/lambda incorrect size limit (#674)
* fix(http): remove 8 KB per-attribute limit on form-encoded request bodies

Vert.x 4.x defaults HttpServerOptions.maxFormAttributeSize to a small
value (effectively 8 KB via the Netty AbstractHttpData limit). This
causes any request with Content-Type: application/x-www-form-urlencoded
that carries a single attribute larger than the limit to be rejected with
"Size exceed allowed maximum capacity".

Two places fixed:

- HttpOptionsCustomizer (new CDI bean): sets maxFormAttributeSize=-1 on
  the main Quarkus HTTP server so large form-encoded AWS Query Protocol
  requests (CloudFormation templates, EC2 UserData in base64, large IAM
  policies, etc.) are accepted. The overall body size is still bounded
  by quarkus.http.limits.max-body-size (512 MB).

- RuntimeApiServer: passes HttpServerOptions with maxFormAttributeSize=-1
  when creating the per-container Vert.x HTTP server. This fixes the case
  where the Lambda runtime posts a large synchronous response body (e.g.
  a 5 MB base64 payload) back to the Runtime API endpoint and the body
  is incorrectly decoded through the form attribute path.

* fix(lambda): enforce AWS invoke payload size limits (sync 6 MB, async 1 MB)

Rejects oversized invocation requests with HTTP 413 RequestTooLargeException
before dispatching to the container, matching the AWS Lambda API contract.
Also enforces the 6 MB sync response limit after the function returns.

* test(lambda): add tests for invoke payload size limits

Unit/integration tests (LambdaIntegrationTest) cover sync >6 MB and async >1 MB
request rejections plus boundary-at-limit acceptance. Compat test
(LambdaPayloadSizeLimitTest) uses the Java SDK to verify RequestTooLargeException
is surfaced correctly, including a Docker-gated test for the 6 MB response limit.

* test(lambda): add regression test for 5 MB response via RuntimeApiServer

Verifies that a sync invocation returning a 5 MB body (within the 6 MB AWS
limit) succeeds end-to-end. Without the maxFormAttributeSize fix on the
RuntimeApiServer, the Lambda runtime's POST of the large response body was
rejected by Netty's 8 KB form-attribute cap, crashing the request with
"Size exceed allowed maximum capacity".
2026-04-30 18:08:36 -05:00
Sewci0 c2b635019b fix: read Action from form body in IAM enforcement filter (#655)
IamActionRegistry.resolve() only looked for the Action parameter in the
URL query string. AWS SDKs send Query-protocol calls (IAM, STS, EC2,
SQS, SNS, RDS, ELBv2, CloudFormation, CloudWatch, ...) as POST with
Action=... in the application/x-www-form-urlencoded body, so the
resolver always returned null for those services. Combined with the
permissive "unknown action -> ALLOW" fallback in IamEnforcementFilter
and the absence of any iam/sts/ec2/sqs/sns rules in the REST-JSON rule
table, IAM enforcement was silently bypassed for every Query-protocol
service.

Read Action from the form-encoded body when it isn't in the query
string, and restore the entity stream so AwsQueryController's
MultivaluedMap injection still works.
2026-04-30 17:53:57 -05:00
Sewci0 a453b4b252 fix: protocol-aware Access Denied response in IamEnforcementFilter (#657)
The deny path returned a JSON AccessDeniedException body for every
request, including Query-protocol services (IAM, STS, EC2, SQS, SNS,
RDS, ELBv2, CloudFormation, CloudWatch, ...) and S3, both of which
speak XML. AWS SDKs hard-fail when an XML parser sees a leading "{",
so the deny payload was unreadable for those clients — the AWS CLI
prints "invalid XML received" and SDK error types are lost.

Pick the response shape from request signals:
- credentialScope == "s3"  -> S3 <Error> XML
- form-encoded body        -> AWS Query <ErrorResponse> XML
- everything else          -> historical JSON shape (DynamoDB, Lambda,
                              Kinesis, KMS, REST-JSON services)

Status code stays 403 across all protocols; the message string is
unchanged, so downstream parsers that key off
"not authorized to perform: <action>" keep working.

Closes #656
2026-04-30 17:48:09 -05:00
Christian Franzen b369da5866 fix(athena): Use embedded DNS server to resolve S3 URL used by floci-duck containers (#672) 2026-04-30 17:47:04 -05:00
Yorí 8eeb2244a7 Feat/lambda image config working directory (#673)
* feat(lambda): support ImageConfig.WorkingDirectory override

Propagate WorkingDirectory from the Lambda ImageConfig through the full
stack so container images that rely on a specific WORKDIR can be invoked
correctly, matching real AWS behavior.

- LambdaFunction: add imageConfigWorkingDirectory field + getter/setter
- LambdaService: parse WorkingDirectory on CreateFunction and
  UpdateFunctionConfiguration
- ContainerSpec: add workingDir record component
- ContainerBuilder: add withWorkingDir() fluent method
- ContainerLifecycleManager: pass workingDir to Docker via withWorkingDir()
- ContainerLauncher: apply workingDir when building the container spec
- LambdaController: serialize WorkingDirectory in ImageConfigResponse

* test(lambda): add tests for ImageConfig.WorkingDirectory

Unit tests (LambdaImageConfigTest):
- CreateFunction stores WorkingDirectory alongside Command/EntryPoint
- createFunction with all three fields together
- updateFunctionConfiguration updates and clears WorkingDirectory
- ContainerLauncher passes workingDir to ContainerSpec

Compat tests across all SDKs:
- awscli (lambda.bats): create/get/update WorkingDirectory round-trip
- Java SDK (LambdaFunctionConfigTest): ImageConfig.WorkingDirectory round-trip
- Python (test_lambda_function_config.py): TestImageConfigWorkingDirectory class
- Node (lambda.test.ts): create/update WorkingDirectory assertions
- Go (lambda_test.go): TestLambdaImageConfigWorkingDirectory subtests
- Rust (lambda_test.rs): full create/get/update round-trip
2026-04-30 17:25:03 -05:00
Dixit R JainandDixit R Jain 2dd748ee07 fix: normalize bare host:port Docker host values to prevent URI parse failure (#665)
Co-authored-by: Dixit R Jain <dixitrjain@Dixits-MacBook-Pro.local>
2026-04-30 17:22:34 -05:00
Hector Ventura 37c7969cb4 feat(cloudformation): support AWS::Lambda::EventSourceMapping resource type (#654) 2026-04-30 00:26:43 -05:00
Hector Ventura c91b74ae4e feat(dynamodb): implement ExportTableToPointInTime, DescribeExport, and ListExports (#653) 2026-04-29 23:16:50 -05:00
Christian Franzen 2c7427a3b1 fix(athena): Connect to floci-duck container via IP not via DNS (#648) 2026-04-29 23:16:23 -05:00
Ricardo Lima c77c469ff4 fix(apigateway): implement GET deployment (#652) 2026-04-29 22:14:11 -05:00
Hector Ventura 483dcee157 feat(iam): add 23 AWS managed ExecutionRole policies (#614) (#650) 2026-04-29 22:12:15 -05:00
Hector Ventura 2832bc7714 feat(codebuild,codedeploy): Implementing real build in docker phase2 (#649)
* feat(codebuild,codedeploy): real build execution and Lambda deployment engine

CodeBuild Phase 2: runs buildspec phases inside real Docker containers.
Source injected via docker cp (copyArchiveToContainerCmd); artifacts
extracted via docker cp (copyArchiveFromContainerCmd). No bind mounts —
works transparently in Docker-in-Docker. CloudWatch log streaming, S3
artifact upload, StopBuild, RetryBuild, ListBuilds, ListBuildsForProject.

CodeDeploy Phase 2: real Lambda deployments with traffic shifting via
alias RoutingConfig, lifecycle hook invocation against live Lambda
functions, PutLifecycleEventHookExecutionStatus callback, and
auto-rollback on hook failure. CreateDeployment, GetDeployment,
deployment state polling, ListDeployments, BatchGetDeployments,
ListDeploymentTargets, BatchGetDeploymentTargets.

* docs: updating docs with new services details
2026-04-29 22:11:55 -05:00
Abhigya 2ff85a450e Cognito Custom Auth Flow integration including Lambda triggers (#646)
* feat: cognito custom auth flow
* feat: added more cognito tests
* feat: v2 pre token claim overrides
2026-04-29 17:48:03 -05:00
Kenshin Okinaka 44eb8d2379 feat(ses): add SendBulkEmail (v2) and SendBulkTemplatedEmail (v1) (#645)
* feat(ses): add SendBulkEmail (v2) and SendBulkTemplatedEmail (v1)

Adds bulk templated email support for both the SES v1 Query API
(SendBulkTemplatedEmail) and the SES v2 REST JSON API
(POST /v2/email/outbound-bulk-emails). The two endpoints share a
single SesService.sendBulkTemplatedEmail method that resolves the
template upfront, merges DefaultTemplateData with each entry's
ReplacementTemplateData at the JSON-key level (replacement wins),
renders subject/text/html via the existing applyTemplateData helper,
and reuses sendEmail per destination so each successful entry appears
in the existing /_aws/ses inspection mailbox with a unique MessageId.

Per-entry results are returned in the BulkEmailEntryResult shape with
status mapped to the AWS wire format expected by each protocol
(CamelCase for v1, SCREAMING_SNAKE for v2). Per-entry AwsException
codes are mapped to the closest BulkEmailEntryResult.Status (e.g.
InvalidParameterValue -> INVALID_PARAMETER, which renders as
"InvalidParameterValue" on v1), falling back to FAILED for unexpected
exceptions.

Template lookup failures and account-sending-paused conditions are
top-level errors on both protocols, with v1 raising
AccountSendingPausedException to match AWS semantics.

* fix(ses): enforce account sending check in v1 SendEmail/SendRawEmail/SendTemplatedEmail

v1 Query SES handlers previously sent mail even when account-level
sending was disabled, while v2 REST JSON handlers and the new
SendBulkTemplatedEmail correctly return AccountSendingPausedException.
Add the same guard at the top of handleSendEmail, handleSendRawEmail,
and handleSendTemplatedEmail to align v1 with v2 and AWS semantics.
2026-04-29 17:28:09 -05:00
Hector Ventura cb0a82b749 fix(apigateway): support _custom_id_ tag on create-rest-api (#644)
When create-rest-api includes tags: {"_custom_id_": "ALIAS"}, use the
tag value as the API ID instead of the random 10-char shortId. This
matches LocalStack behavior and allows callers to invoke the API at
/execute-api/ALIAS/{stage}/{path} without knowing the auto-generated ID.

Also include tags in the create/get REST API response.

Fixes #636
2026-04-29 00:27:52 -05:00
Hector Ventura 160a0a35d6 fix(eks): use named Docker volume for k3s data directory (#643) 2026-04-29 00:27:42 -05:00
Hector Ventura 78b0d4d3e2 fix(cloudformation): resolve path-style AWS S3 TemplateURL against local S3 (#627) (#641)
CDK passes TemplateURL as https://s3.{region}.amazonaws.com/{bucket}/{key}.
The condition host.endsWith(".amazonaws.com") incorrectly matched this as
virtual-hosted style, extracting "s3" as the bucket name instead of the real
bucket. Fixed by only treating URLs with a bucket label before ".s3." as
virtual-hosted. Also changed the failure path from silently returning "{}"
(causing CREATE_COMPLETE with zero resources) to rethrowing so the stack
correctly reaches CREATE_FAILED.
2026-04-29 00:02:33 -05:00
Hector Ventura 3960b6e20e fix(lambda): inject log group/stream and Floci endpoint env vars into Lambda containers (#640)
* fix(lambda): inject log, endpoint, and hostname env vars into Lambda containers

Three missing environment variables prevented Lambda functions from running
correctly with newer runtimes and from reaching back into Floci:

and AWS_LAMBDA_LOG_STREAM_NAME to be set before the runtime initialises. Floci
computed both values but only used them for log streaming — they were never added
to the container's env list, causing a hard PlatformError on boot.

their container. FLOCI_HOSTNAME, FLOCI_ENDPOINT, and AWS_ENDPOINT_URL are now
injected so any AWS SDK client instantiated inside the function uses Floci
automatically, without requiring code changes.

When the embedded DNS server is active (Floci running in Docker), FLOCI_HOSTNAME
is set to the configured hostname (e.g. "floci") rather than a raw IP, because
the DNS server is already wired into each Lambda container as its resolver and
will resolve that name correctly. In local dev mode (no embedded DNS), the
Docker-reachable host address is used as a fallback.

Closes #628
Closes #629

* feat(lambda): implement PutFunctionEventInvokeConfig and sibling endpoints (#632)

Adds the five event-invoke-config REST endpoints that Terraform's aws_lambda_function_event_invoke_config resource requires:

- PUT /2019-09-25/functions/{name}/event-invoke-config — replaces config
- POST — partial update (merge)
- GET — retrieve config, 404 if absent
- DELETE — remove config, 404 if absent
- GET .../event-invoke-config/list — list all qualifiers

New files: FunctionEventInvokeConfig model (with @RegisterForReflection and correct AWS JSON field names), LambdaEventInvokeController, and LambdaEventInvokeConfigTest (10
unit tests). Storage is an in-memory ConcurrentHashMap keyed by region:functionArn:qualifier.

Also fixes the ContainerLauncherTest and LambdaImageConfigTest setUp methods that were missing config.baseUrl() stubs required by the FLOCI_HOSTNAME/FLOCI_ENDPOINT env-var
injection added in the branch.
2026-04-29 00:02:07 -05:00
Yorí 1cccf43f7b feat(cognito): include all standard attributes in DescribeUserPool Schema (#642)
* feat(cognito): include all standard attributes in DescribeUserPool SchemaAttributes

AWS Cognito always returns all 20 standard OIDC attributes (sub, name,
email, phone_number, etc.) in SchemaAttributes when describing a user
pool, even if none were explicitly configured. Floci was returning only
what was passed in Schema during creation.

Adds CognitoStandardAttributes with the full default set and a merge()
helper that overlays explicit schema overrides and appends custom:
attributes after the standard ones.

* test(cognito): add compat tests for standard SchemaAttributes across all SDKs

Adds DescribeUserPool SchemaAttributes coverage to all compatibility test
suites (AWS CLI/bats, Go, Java, Node, Python, Rust), verifying that all
20 standard OIDC attributes are returned and that sub is required and
immutable.
2026-04-29 00:01:48 -05:00
Hector Ventura 87eda4bcfc fix(cloudformation): wrap ZipFile inline source in zip archive before passing to Lambda (#639)
CloudFormation's ZipFile property contains raw source code (JS, Python, etc.),
but LambdaService expects Code.ZipFile to be a base64-encoded zip archive per
the Lambda REST API contract. Passing raw source directly caused every inline
Lambda to land in CREATE_FAILED with "Illegal base64 character".

Fix: added sourceToZipBase64() that wraps the raw source in a ZipEntry (filename
derived from the Handler property and runtime extension — .js for Node, .py for
Python) and base64-encodes the archive before forwarding to LambdaService.

Closes #607
2026-04-28 22:36:30 -05:00
Hector Ventura 77db7d24ef fix(dynamodb): fix GSI query pagination infinite loop when items share sort key (#637)
When paginating a GSI query where multiple items have the same index sort key,
LastEvaluatedKey only contained the index keys (GSI1PK + GSI1SK), making it
impossible to distinguish between items on the same "page boundary". This caused
ExclusiveStartKey matching to never advance past that boundary, looping forever.

Fix: include the base-table PK and SK in LastEvaluatedKey for index queries,
and prefer base-table keys when matching ExclusiveStartKey (AWS SDK behaviour).

Closes #587
2026-04-28 22:36:08 -05:00
Christine Nguyen 01ef6890a6 fix(pipes): resolve InputTemplate paths through JSON-encoded string fields (#635) 2026-04-28 20:22:58 -05:00
Christine Nguyen e3d97c28bc feat(cloudformation): provision AWS::Pipes::Pipe resources (#634) 2026-04-28 20:21:53 -05:00
Kenshin Okinaka cd42caa254 feat(ses): add ConfigurationSet CRUD on v1 Query and v2 REST JSON (#631)
* feat(ses): add ConfigurationSet CRUD on v1 Query and v2 REST JSON

Adds Configuration Set name management on both protocols:

- v1 Query: CreateConfigurationSet, DescribeConfigurationSet,
  ListConfigurationSets, DeleteConfigurationSet
- v2 REST JSON: POST/GET (single)/GET (list)/DELETE under
  /v2/email/configuration-sets[/{name}]

Storage is region-scoped and shared across both protocols, with name as
the primary key. Tags are persisted on v2 create and returned on v2 get;
v1 only round-trips the name (real SES v1 has no tags on configuration
sets). Errors map ConfigurationSetAlreadyExists / ConfigurationSetDoesNotExist
(v1) onto AlreadyExistsException 400 and NotFoundException 404 (v2)
via the existing SesController remap helper.

Field validation (per AWS limits): ConfigurationSetName must match
^[A-Za-z0-9_-]{1,64}$; each Tag Key is 1-128 chars and each Tag Value is
0-256 chars; non-array Tags are rejected with BadRequestException.

Out of scope (future PRs): SendingOptions / EventDestinations /
TrackingOptions / DeliveryOptions / ReputationOptions / SuppressionOptions /
VdmOptions, and ConfigurationSetName validation in the Send* APIs.

* fix(ses): allow Tag without Value on ConfigurationSet create

AWS SDKs commonly omit Tag.Value when only the key matters
(Tag.builder().key("env").build()), serialising the request without a
Value field. Floci was rejecting these calls with "Tag Value is
required", diverging from typical SDK and LocalStack behaviour. Drop
the required-value check; the 0-256 length constraint still applies
when a value is present.
2026-04-28 20:21:07 -05:00
Yorí e3368e014c feat(lambda): support ImageConfig Command and EntryPoint for Image (#630)
package type
2026-04-28 20:19:12 -05:00