Commit Graph
721 Commits
Author SHA1 Message Date
Liam MacPherson 86c4aae2e2 feat(pipes): support Kafka pipe sources and polling (#1260)
* feat(pipes): support Kafka pipe sources and polling

Add EventBridge Pipes support for Amazon MSK and self-managed Kafka sources exposed via `smk://`.

Introduce Kafka consumer management for bootstrap resolution, consumer group selection, topic validation, and safe reuse across poll cycles.

Extend the Pipes poller and tests to filter decoded Kafka payloads, deliver the expected record shape, and commit offsets only after successful delivery.

* fix(pipes): tighten Kafka validation and commit handling

Clarify Kafka validation errors, avoid duplicate Kafka record transformation, commit delivered Kafka offsets per partition for non-Lambda targets, and remove reflective poller test access.

* fix(pipes): stabilise Kafka poller event handling

Use a consistent Kafka partition type, narrow JSON decode error handling, remove reflection from manager tests, and tighten no-commit assertions for failed Kafka delivery paths.

* fix(pipes): preserve Kafka nulls and commit progress

Preserve null Kafka key and value fields, encode Kafka headers consistently, and commit Lambda Kafka progress per partition so successfully processed records are not replayed after later failures.

* fix(msk): align broker metadata and Kafka event payloads
2026-06-25 19:59:38 -05:00
Ahmed khaled a8fde26d06 feat(memorydb): model auth via ACLs and users (#1478)
* feat(memorydb): model auth via ACLs and users

* fix(memorydb): keep loading pre-existing cluster

* fix(memorydb): reject no-password CreateUser and validate UserName
2026-06-25 19:48:45 -05:00
kotov228 efacb37130 feat: Adds initial Elastic Beanstalk Query API support to Floci. (#1362)
* feat: add Elastic Beanstalk query API support

feat: add Elastic Beanstalk query API support

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

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

* test(elasticbeanstalk): add Java SDK compatibility coverage
2026-06-25 19:16:51 -05:00
Abhishek Dubey e7b7839d85 fix: implement read APIs required by Steampipe resource collection (#1538)
* fix: implement read APIs required by Steampipe resource collection

IAM ListMFADevices, ECR BatchGetRepositoryScanningConfiguration, and CloudWatch Logs GetDataProtectionPolicy returned UnsupportedOperation (400). Each is invoked per-item by the Steampipe AWS plugin to enrich aws_iam_user, aws_ecr_repository, and aws_cloudwatch_log_group; the 400 aborted the whole table hydration, so those tables collected zero rows against Floci.

Implement minimal, wire-accurate responses:
- IAM ListMFADevices -> empty MFADevices list (IsTruncated=false)
- ECR BatchGetRepositoryScanningConfiguration -> reuse describeRepositories, return MANUAL scan config
- CloudWatch Logs GetDataProtectionPolicy -> empty policy at HTTP 200 (the steampipe aws plugin hydrate does not tolerate ResourceNotFound, so 200 is required for collection to succeed)

Adds focused tests for each handler.

* docs: ground read-API handler comments in AWS wire behavior

Rewrite the ListMFADevices, BatchGetRepositoryScanningConfiguration, and
GetDataProtectionPolicy handler comments to describe real AWS response shapes,
enum values, and error semantics (NoSuchEntity 404, scanFrequency enum,
ResourceNotFoundException 400) instead of referencing a specific consumer.
Note the known deviations (200-empty vs error, batch-fail vs failures[]).
2026-06-25 19:14:43 -05:00
Konda Balaji RaoandHector Ventura 952dec060f fix(lambda): use persisted firstReceiveTimestamp in SQS ESM (#1548)
* fix: return XML error for missing action and add volume action fallbacks

* fix(eventbridge): sync EventBridge tags to ResourceGroupsTaggingService

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

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

Closes #1343

* fix(lambda): use persisted firstReceiveTimestamp in SQS ESM and Pipes event payloads

Both SqsEventSourcePoller.buildSqsEvent() and PipesPoller.buildSqsRecordNodes()
were using System.currentTimeMillis() for ApproximateFirstReceiveTimestamp,
causing the value to change on every poll cycle. AWS SQS defines this as the
epoch time when the message was first received from the queue, and it must
remain constant across retries.

The SQS service layer already tracks this correctly via
Message.firstReceiveTimestamp (set once in GuardedMessageQueue.tryClaim()),
but both pollers bypassed the stored value.

Changes:
- SqsEventSourcePoller: read msg.getFirstReceiveTimestamp() with null fallback
- PipesPoller: same fix for the identical code path
- SqsEventSourcePollerTest: set firstReceiveTimestamp on test messages and
  assert the output matches the stored value; add a regression test proving
  the timestamp remains stable across simulated retries

Closes #1497

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
2026-06-25 19:11:51 -05:00
Jason van Zyl 1a319551cc feat(ec2): add instance type metadata catalog (#1534) 2026-06-25 19:09:59 -05:00
Alex Banna bd75d4428f fix(codebuild): create build working directory before running phases (#1577)
The build container was started with a fire-and-forget entrypoint
("mkdir -p /codebuild/output/src/src && tail -f /dev/null"). createAndStart
returns as soon as the container is running, which can be before that mkdir
completes. The runner then immediately execs the build phases (which chdir
into the directory) and copies artifacts out of it, so on a slow container
start the directory does not exist yet: the BUILD exec fails and the artifact
copy 404s, and the build is reported as FAILED.

Drop the mkdir from the entrypoint and create the working directory with an
explicit, awaited "mkdir -p" exec (run from "/", which always exists) before
the source copy and the phases. This removes the race.

This was surfacing as the intermittent failure of
CodeBuildTest.batchGetBuilds_eventuallySucceeds in the sdk-test-java
compatibility suite.
2026-06-25 18:50:17 -05:00
Stuart Lang 21a7939e46 fix(lambda): propagate SQS FIFO system attributes to ESM event (#1527)
When an SQS event source mapping invokes a Lambda from a FIFO queue,
copy MessageGroupId, SequenceNumber, and MessageDeduplicationId into
each record's attributes map, matching the values ReceiveMessage
already returns. Standard-queue messages are unaffected.

Closes #1526
2026-06-25 18:06:44 -05:00
Alex Banna 0a806f7382 fix(lambda): resolve handler paths with a leading "./" against the package (#1575)
A Node/file-based handler can be given with a leading "./" — e.g.
"./v1/lambda-handlers/entry.handler", as the terraform-aws-modules/lambda module
(and DPS) emit. resolveHandlerFilePath stripped only the ".handler" export
suffix, leaving "./v1/lambda-handlers/entry", which never matched the
deployment-package entry "v1/lambda-handlers/entry.js" (stored without the
"./"). CreateFunction then rejected the function with
"Handler file '...' not found in deployment package".

Normalize a leading "./" away before matching the handler against the package.
2026-06-25 18:04:25 -05:00
shrimptails-f ad1cc22c19 fix(rds): align subnet group placement handling with AWS behavior (#1295)
* fix(rds): align subnet group placement handling with AWS behavior

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

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

* fix(rds): tighten subnet group placement validation

* chore: rerun ci
2026-06-25 17:54:50 -05:00
Steve 976f819e5c fix(iam): make entity stores thread-safe under concurrent mutation (#1509)
The storage backend hands every caller the same entity instance, and
IamService mutates that entity's collections in place before storing it
back (getInlinePolicies().put(...), getAttachedPolicyArns().add(...), etc.)
with no synchronization. When two requests touch the same entity at once -
e.g. Terraform applying many aws_iam_role_policy resources under
-parallelism - the plain HashMap/ArrayList lose entries and corrupt their
internal tables. PutRolePolicy returns success but the immediate
GetRolePolicy then reports NoSuchEntity (so the provider's create-waiter
exhausts and the apply fails), and listRolePolicies can throw
ArrayIndexOutOfBoundsException off the corrupted map.

Make the shared collections concurrency-safe across all IAM entities:
ConcurrentHashMap for tag and inline-policy maps, CopyOnWriteArrayList for
the user/group/role/instance-profile lists, with defensive setters so a
Jackson rehydrate from disk can't swap a plain collection back in.

Policy versions keep insertion order via a synchronized LinkedHashMap, and
the compound check-then-act paths that a thread-safe collection alone can't
make atomic are guarded explicitly: createPolicyVersion (version id derived
from size()+1), delete/setDefaultPolicyVersion, listPolicyVersions, and the
single-role cap in addRoleToInstanceProfile.

Add concurrency tests that drive each collection from many threads and
assert no entry is lost or corrupted; they fail reliably before the fix.
2026-06-25 01:21:59 -05:00
Prakhar Kapoor 0b28554626 fix(ec2): persist default egress as SecurityGroupRule and fix DescribeSecurityGroupRules filter parsing (#1525) 2026-06-25 01:16:18 -05:00
Eduardo Lugo Vela 28a1427ea8 fix(s3): serve custom error document for missing keys in static websi… (#1334)
* fix(s3): serve custom error document for missing keys in static website hosting

When a bucket has a website configuration with an ErrorDocument, requests
to missing keys now return the error document with a 404 status instead
of the default XML NoSuchKey error.

* fix(test): handle null output in waitForExecution to prevent flaky CI failures

* fix(s3): address review feedback on static website hosting

* fix(s3): recognize s3-website hostnames in virtual host filter

* fix(s3): gate website error document on website endpoint host

* fix(s3): restore validateRawUri inside try block after rebase
2026-06-25 01:09:34 -05:00
Jongsic Choi 398535ed55 feat(core): add opt-in Private Network Access for CORS preflights (#1530) 2026-06-25 00:56:42 -05:00
「彩」ギリングハムピアース 05d050190e fix(cloudfront): honor configured domain-suffix for generated distribution domains (#1533)
CloudFrontService hardcoded the ".cloudfront.net" suffix when generating
distribution domain names, so the existing floci.services.cloudfront.domain-suffix
config (FLOCI_SERVICES_CLOUDFRONT_DOMAIN_SUFFIX) had no effect.

Read config.services().cloudfront().domainSuffix() into the service and use it
in createDistribution() and createStreamingDistribution(). The default remains
cloudfront.net via @WithDefault, so existing behaviour is unchanged.

Adds CloudFrontServiceTest covering the default suffix and a configured override
for both distributions and streaming distributions.
2026-06-25 00:52:50 -05:00
Kenshin Okinaka e24566c47b feat(ses): publish SNS notifications to identity feedback topics (#1540)
Wire SetIdentityNotificationTopic into the send path so a verified
identity (or its parent domain) with a Bounce/Complaint/Delivery topic
receives an Amazon SNS notification when a matching event occurs,
independently of any configuration set. Previously the topic ARN was
stored and only echoed back by GetIdentityNotificationAttributes.

The notification uses the legacy notificationType payload format, which
shares the mail/bounce/complaint/delivery blocks with event publishing
but differs in three spec-mandated ways: the top-level discriminator is
named notificationType instead of eventType; the mail object omits the
tags field; and the original headers (headers/commonHeaders/
headersTruncated) are included only when the identity has
headers-in-notifications enabled for the notification type.

The sending identity is resolved from the bare email address (so a
display-name Source yields a valid identity/<email> ARN), and SendRawEmail
falls back to the MIME From header when Source is omitted, using that
effective source consistently for the stored message, SMTP relay, and
event publishing. RawMessageHeaders now parses the From address.

Docs: documented the behavior in docs/services/ses.md.
2026-06-25 00:35:44 -05:00
Jason van Zyl ad785f95f6 feat(ec2): add Java-built Ubuntu AMI guest image (#1542) 2026-06-25 00:33:15 -05:00
Juri Duval e5a646d40c fix(sfn): no execution data available via SDK (#1506)
* fix(1504): fix execution history handling

* fix(1504): add tests

* fix(1504): add negative test

* chore(sfn): pr comments
2026-06-25 00:16:41 -05:00
Samarth Tikotkar 2288454021 fix(dynamodb): invalid expressions throw 400 with exact error messages (#1545) 2026-06-25 00:14:14 -05:00
Vinod Kumar Bengaluru 2583c3d61e feat(s3): support bucket logging configuration (#1510) 2026-06-25 00:07:51 -05:00
Konda Balaji Rao a3f3bf8fe1 fix(lambda): populate SQS messageAttributes in Lambda event payload (#1422)
* fix: return XML error for missing action and add volume action fallbacks

* fix(eventbridge): sync EventBridge tags to ResourceGroupsTaggingService

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

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

Closes #1343

* fix(lambda): populate SQS messageAttributes in Lambda event payload

buildSqsEvent() was calling record.putObject("messageAttributes") which
creates an empty JSON object node and discards msg.getMessageAttributes()
entirely. Lambda functions receiving SQS events always saw an empty
messageAttributes map regardless of what was sent with the message.

Fix serializes each MessageAttributeValue into the AWS-specified shape:
  { dataType, stringValue, binaryValue, stringListValues, binaryListValues }

Binary values are base64-encoded per the Lambda SQS event contract.
md5OfMessageAttributes is now forwarded to the record when present.

Added four new unit tests covering: String, Number, and Binary attribute
types, multiple messages each with independent attributes, and the
no-attributes case (backward compat: empty object, no md5 field).

Fixes #1411

* fix: serialize only populated SQS message attribute values

* fix: omit null scalar fields from SQS message attributes in Lambda event payload

- Stop emitting explicit JSON nulls for absent stringValue/binaryValue
  fields in SqsEventSourcePoller.buildSqsEvent(); AWS Lambda omits
  these entirely rather than sending null.
- Align serialization order with PipesPoller: check binaryValue first,
  then stringValue via else-if.
- Update test assertions to expect key-absent (assertNull) instead of
  null-JSON-node (isNull) for the unpopulated scalar field.
2026-06-24 23:37:03 -05:00
shrimptails-f e8f7cc470e fix(rds): align create-time parameter group validation with AWS behavior (#1330) 2026-06-24 22:47:04 -05:00
Abhishek Dubey ab6d7feb9d fix(elbv2): omit terminal SSL policy marker (#1522) 2026-06-24 22:37:15 -05:00
shrimptails-f 5e6bcca401 fix(cognito): align sign-up confirmation with AWS behavior (#1488)
* fix(cognito): align sign-up confirmation with AWS behavior

* fix(cognito): centralize constructor initialization

* fix(cognito): use issued sign-up confirmation code in node compatibility test

* fix(cognito): align signup confirmation tests with issued codes
2026-06-24 22:35:57 -05:00
James Netherton 03f1e44e27 fix(secretsmanager): register AWSPENDING version before invoking rotation Lambda (#1519)
RotateSecret invoked the Lambda rotation function without first
registering the ClientRequestToken as an AWSPENDING version. Standard
rotation handlers (including the AWS-provided templates) call
DescribeSecret and expect to find their token in VersionIdsToStages,
causing rotation to fail with:

  ValueError: Secret version <token> has no stage for rotation.

Create an empty AWSPENDING placeholder version keyed by the
ClientRequestToken before invoking the Lambda's createSecret step.
This matches the behavior of real AWS and Moto.

Also allow PutSecretValue to overwrite an AWSPENDING placeholder that
has no secret value yet, since the Lambda's createSecret step needs to
populate it.
2026-06-24 22:26:44 -05:00
Maciej 72146eeb02 fix(athena): serialize timestamps as epoch seconds in GetWorkGroup and GetTableMetadata responses (#1524) 2026-06-24 22:10:17 -05:00
Stuart Lang a6c6cf6de9 fix(floci-ui): report real sidecar-start failures instead of always blaming the image (#1544)
Pressing 'Open Floci UI' under Podman (docker-socket compat) reports every
failure as a missing image and tells the user to 'docker pull floci-ui' — even
when the image is present. The real causes (an unreachable Docker/Podman socket,
a port clash, a daemon error) are hidden, which is especially confusing on
SELinux hosts where the bind-mounted socket connect fails with
'java.net.BindException: Permission denied'.

Classify the failure in FlociUiManager.describeStartFailure:
- only a genuinely unavailable image (NotFoundException / docker-java's
  'Could not pull image: ...' wrapper) keeps the 'docker pull' guidance;
- an unreachable runtime (SocketException/BindException/ConnectException) points
  at the socket mount and SELinux relabeling;
- any other daemon error is surfaced as-is (e.g. 'address already in use').

Also fix the Podman docs: use ':z' (shared relabel) rather than ':Z' on the
shared Podman API socket, note it applies to the UI sidecar, and mention the
'--security-opt label=disable' fallback.

Add unit tests for the four classifications.
2026-06-24 22:08:27 -05:00
seyi idowu 7efb280dbc fix(ec2): VPC endpoint compatibility for AWS SDK/Terraform (#1476)
- emit routeTableIdSet/subnetIdSet items as plain text (AWS SDK for Go could not
  deserialize the wrapped form)
- add DescribePrefixLists returning managed S3/DynamoDB prefix lists
- honor private_dns_enabled (default true for interface endpoints)

Adds Ec2IntegrationTest coverage and documents the new actions.
2026-06-23 21:57:37 -05:00
Stuart Lang 9253ee82b0 fix(floci-ui): resolve readiness probe URL from container endpoint (#1471)
* fix(floci-ui): resolve readiness probe URL from container endpoint

Resolve the floci-ui readiness probe URL once at start/adopt time from the
sidecar's resolved EndpointInfo instead of branching on container detection
each probe. EndpointInfo already returns a Floci-reachable address —
localhost:hostPort natively, or the sidecar's container IP on the shared
Docker network when Floci runs in a container, where the published host port
is unreachable from inside.

* fix(floci-ui): set hostPort from bound endpoint natively, keep configured port in container

Address PR review: EndpointInfo.port() is the real host binding only in native
mode (and reflects dynamic port=0 allocation there). In container mode it is the
sidecar's internal port (4500), so the configured published port stays
authoritative for the browser redirect. Extract resolveHostPort() and use it in
both ensureStarted() and adoptExisting().
2026-06-23 00:41:40 -05:00
Jason van Zyl 0870f993a4 fix(ssm): reject send-command timeouts below AWS minimum (#1511) 2026-06-23 00:39:12 -05:00
Preston-Cai bb6ee4f69d fix(ec2): user data logging (#1474)
* fix(ec2): added user data output streaming to cloud watch

* fix(ec2): deleted dead code after merging

* fix(ec2): adjust comments position

* fix(ec2): fixed userdata logging and added mockito tests
2026-06-23 00:20:33 -05:00
Hector Ventura 2b26149ef5 fix(config): persist config rules, conformance packs, recorders, channels, tags (#1516)
Back the durable AWS Config maps with StorageFactory so they survive a restart
instead of living only in memory. configRules and conformancePacks use the
nested-region pattern (re-put after inner-map mutation); configurationRecorders,
deliveryChannels and tags swap to flat StorageBackedMaps with tag inner-map
write-backs. Recorder run-state stays in memory. Storage key is config. Wire
ConfigStorageConfig + catalog descriptor + application.yml.
2026-06-23 00:16:31 -05:00
Hector Ventura e0758cca23 fix(codebuild): persist projects, report groups and source credentials (#1515)
Back the region-nested projects, report groups and source credentials maps
with StorageFactory-backed maps (ELBv2 nested-region pattern) so they survive
a restart instead of living only in memory. Re-put the region entry after
inner-map create/update/delete so the periodic flush captures the change.
Builds and build counters stay in memory as runtime state. Wire
CodeBuildStorageConfig + catalog descriptor + application.yml.
2026-06-22 23:41:28 -05:00
Hector Ventura cc2cbb48e0 fix(ecs): persist durable resources via StorageBackedMap (#1514)
Back clusters, task definitions, latest revisions, services, capacity
providers, attributes and account settings with StorageFactory-backed
maps so they survive a restart instead of living only in memory. Add
write-backs at in-place mutation sites (cluster config/counters, service
config/status, task-definition status, tags, attributes) so the periodic
flush captures them; transient runtime state (tasks, task sets,
deployments, container instances) stays in memory. Wire EcsStorageConfig
+ catalog descriptor + application.yml.
2026-06-22 23:18:39 -05:00
Konda Balaji Rao f725a38969 feat(secretsmanager): implement automatic secret rotation lifecycle (#1467)
* fix: return XML error for missing action and add volume action fallbacks

* fix(eventbridge): sync EventBridge tags to ResourceGroupsTaggingService

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

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

Closes #1343

* feat(secretsmanager): implement automatic secret rotation lifecycle

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

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

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

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

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

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

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

* fix: non-immediate rotation runs testSecret only

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

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

The non-immediate rotation path only invokes testSecret (not createSecret),
so the test should expect 1 lambda invocation instead of 2.
2026-06-22 23:18:16 -05:00
seyi idowu 2301db53c7 feat(ec2): add Network ACL support (#1473)
Implements CreateNetworkAcl, DescribeNetworkAcls (with vpc-id / default /
association.subnet-id filters), CreateNetworkAclEntry, ReplaceNetworkAclEntry,
DeleteNetworkAclEntry, ReplaceNetworkAclAssociation, and DeleteNetworkAcl.
Every VPC is provisioned with a default NACL and each subnet is associated with
it, so aws_network_acl and aws_default_network_acl work via Terraform.

Adds Ec2IntegrationTest coverage and documents the new actions.
2026-06-22 22:57:57 -05:00
Aidan Fahey 7b3c5b230d fix(rds): fix PostgreSQL proxy ignoring requested database name (#1480)
* fix(rds): postgres proxy ignores requested database name

* fix(rds): assert-auththread and backendthread are terminated

* fix(rds): assert-auththread and backendthread are terminated again
2026-06-21 10:00:26 -05:00
Kenshin Okinaka 7c04e8824c feat(ses): support v1 ConfigurationSet tracking and reputation-metrics options (#1479)
* feat(ses): support v1 ConfigurationSet tracking and reputation-metrics options

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

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

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

Add integration and AWS SDK v2 compatibility tests.

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

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

Add integration coverage for both cases.

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

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

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

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

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

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

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

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

---------

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

* feat(s3-vector-store): implement S3 Vectors service API with controller, service, and integration tests
2026-06-21 00:55:10 -05:00
Konda Balaji Rao b377940cb6 fix(cognito): implement token revocation for AdminUserGlobalSignOut (#1407)
* fix: return XML error for missing action and add volume action fallbacks

* fix(eventbridge): sync EventBridge tags to ResourceGroupsTaggingService

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

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

Closes #1343

* fix(apigateway): add support for SQS path-style integration URIs

- Enhanced AwsServiceRouter to parse both action/ and path/ style integration URIs
- Updated ApiGatewayExecuteController to handle form-urlencoded SQS requests
- Added comprehensive integration tests covering end-to-end functionality
- Maintains backward compatibility with existing action/ style integrations

Fixes issue with API Gateway AWS integrations failing when using path-style
SQS ARNs like arn:aws:apigateway:region:sqs:path/account/queue instead of
action-style URIs.

* fix(cognito): implement token revocation for AdminUserGlobalSignOut

Previously AdminUserGlobalSignOut was a stub that only logged a message
and did not invalidate any tokens, allowing previously issued refresh and
access tokens to remain fully usable after a global sign-out.

Changes:
- Add RevokedTokenInfo model to track revoked token state
- Add revokedTokenStore (StorageBackend) to CognitoService
- Add jti and origin_jti claims to all generated JWT tokens
- Implement revokeAllUserTokens() using a global revocation record keyed
  by pool + username, checked at every token validation point
- Add validateRefreshTokenNotRevoked() accessible from the auth flow handler
- Add validateUserNotGloballySignedOut() checked in getUser, changePassword,
  updateUserAttributes, deleteUserAttributes, and getTokensFromRefreshToken
- Fix CognitoAuthFlowHandler.handleRefreshToken() to call the revocation
  check before issuing new tokens from REFRESH_TOKEN_AUTH flow
- Update package-private constructor (used in tests) to accept the new store
- Add AdminUserGlobalSignOutIntegrationTest covering the full sign-in →
  sign-out → token-reuse scenario (9 test cases)

Closes #1395

* fix(cognito): only revoke tokens issued before global sign out instant

* fix(cognito): correct time precision for global sign-out token invalidation
2026-06-21 00:31:00 -05:00
Marvelous Ikponmwosa bb5a37d19e fix(apigatewayv2): cascade-delete child resources and 404 references … (#1300)
* fix(apigatewayv2): cascade-delete child resources and 404 references on DeleteApi

Closes #1218.

DeleteApi removed only the Api row, leaving routes, integrations, stages,
deployments, authorizers, models, route responses, and integration responses
orphaned under their region::apiId::* keys. The list endpoints also silently
returned empty lists for unknown apiIds instead of 404. Both diverge from
real AWS (children deleted; subsequent reads return NotFoundException).

- deleteApi now cascades through every api-scoped child store, mirroring
  the existing apigateway v1 deleteRestApi pattern (api row first, then
  inline stream-based deletes per store, then LOG.infov).
- VpcLink is region-scoped (region::vpcLinkId — shared across APIs) and
  intentionally excluded from the cascade.
- getRoutes / getStages / getIntegrations / getAuthorizers / getModels /
  getDeployments / getRouteResponses / getIntegrationResponses now call
  getApi(region, apiId) first so they 404 when the API doesn't exist,
  matching real AWS behavior.

Verified end-to-end with boto3 against running Floci: the reproduction from
#1218 went from 6 leaked child types on main to 0 with this branch.

* refactor(apigatewayv2): extract deleteByPrefix helper, consolidate cascade tests
2026-06-20 12:30:20 -05:00
Kenshin Okinaka 1ffa9a4e21 feat(ses): support v2 dedicated IP pools and configuration-set option groups (#1412)
* feat(ses): support v2 dedicated IP pool APIs

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

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

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

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

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

Validation matches real AWS SES V2:

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

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

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

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

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

* fix(ses): stop validating ArchiveArn format

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

Replace the malformed-ARN rejection test with one asserting an arbitrary
ArchiveArn round-trips.
2026-06-20 11:47:36 -05:00
Ahmed khaled fd904bc409 feat(memorydb): add MemoryDB service with mock mode (#1420)
* feat(memorydb): add MemoryDB service with mock mode

Adds Amazon MemoryDB for Redis as a Docker-backed service, modelled on
the existing ElastiCache and DocumentDB services.

Control plane is AWS JSON 1.1 (X-Amz-Target: AmazonMemoryDB.*) dispatched
from AwsJson11Controller, supporting CreateCluster, DescribeClusters,
UpdateCluster, DeleteCluster, ListTags, TagResource and UntagResource.

The data plane reuses ElastiCache's RESP proxy and SigV4 validator, since
MemoryDB is Redis wire-compatible: each cluster starts a real Valkey/Redis
container and an auth proxy forwards client connections to it.

A mock mode (FLOCI_SERVICES_MEMORYDB_MOCK, default false) tracks clusters
as control-plane-only resources without starting a container, so IaC tools
like Terraform and OpenTofu can run where no Docker socket is available.
This mirrors the existing DocumentDB mock flag.

Includes service unit tests and documentation.

* fix(memorydb): return UnknownOperationException for unsupported actions

Unrecognised JSON 1.1 actions returned InvalidParameterValueException,
which mis-signals the error category and can break SDK/CLI probing.
Use UnknownOperationException to match CloudMap and the shared
JsonErrorResponseUtils.createUnknownOperationErrorResponse helper.

* docs(memorydb): drop service-count bump from this PR

The 55->56 edit was built on a stale baseline (main's count does not
reflect already-merged services) and conflicts with a separate docs
branch. Keep the MemoryDB matrix row; leave the headline count to a
dedicated docs PR. No functional change.

* fix(memorydb): use InternalFailure for unexpected errors

Align the generic exception path with Floci's JSON 1.1 convention and the
shared JsonErrorResponseUtils.createErrorResponse helper, which emit
InternalFailure for unexpected server errors. SDKs commonly key on this.

* fix(memorydb): copy AuthToken onto cluster spec on CreateCluster

CreateCluster resolved AuthMode.PASSWORD from the presence of AuthToken
but never copied the token onto the spec, so the service stored a null
token and password auth always failed. Copy AuthToken onto the spec and
add MemoryDbHandlerTest covering token propagation and the NO_AUTH default.

* fix(memorydb): validate cluster name to avoid NPE on null key

getCluster passed the name straight to the ConcurrentHashMap-backed
storage, so a null/blank name (reachable via UpdateCluster/DeleteCluster
without ClusterName) threw a NullPointerException surfaced as a 500.
Guard with an AWS-style InvalidParameterValueException (400), matching
CreateCluster, and add a regression test.

* fix(memorydb): roll back proxy port and container on failed provisioning

If container or proxy startup failed after allocating a proxy port, the
port stayed reserved (and any started container orphaned), eventually
exhausting the range with InsufficientClusterCapacity. Extract backend
startup into startBackend with best-effort rollback that stops the proxy
and container and always releases the port. Add a regression test proving
the port is reclaimed after a failed create.

* fix(memorydb): stop proxies and containers on emulator shutdown

MemoryDbProxyManager.stopAll and MemoryDbContainerManager.stopAll were
never invoked from EmulatorLifecycle.onStop, so MemoryDB clusters left
bound TCP proxy ports and running containers after shutdown. Wire both
managers into onStop alongside the existing ElastiCache and RDS cleanup.

No test: shutdown DI wiring is not meaningfully testable in isolation.

* test(memorydb): update EmulatorLifecycleTest for new constructor params

The shutdown-wiring change added MemoryDb container/proxy managers to the
EmulatorLifecycle constructor; update the direct constructor call in the
unit test to pass the two new mocks.

* test(memorydb): add Docker-backed integration test

End-to-end coverage mirroring ElastiCacheIntegrationTest: JSON 1.1 control
plane (CreateCluster/DescribeClusters/DeleteCluster) plus the real RESP
data plane through a Valkey container and the auth proxy. Covers no-auth
connectivity (PING/SET/GET), password auth (AUTH token accepted, wrong
token and unauthenticated commands rejected), and proxy-port reuse after
delete. Gated on Docker availability via an assumption.

* docs(memorydb): clarify mock endpoint uses configured hostname

Mock mode reports <hostname>:6379 (from floci.hostname / FLOCI_HOSTNAME,
defaulting to localhost), not always localhost. Update the Mock Mode note
so users with a custom hostname aren't surprised.

* fix(memorydb): use correct InsufficientClusterCapacityFault error code
2026-06-20 11:45:37 -05:00
Stuart Lang 760d48b91a feat(neptune): support neo4j backend for openCypher via NEPTUNE_DB_TYPE (#1449)
* feat(neptune): support neo4j backend for openCypher via NEPTUNE_DB_TYPE

Neptune emulation always started a TinkerPop Gremlin Server, which only
speaks Gremlin. Add a global db-type selector (FLOCI_SERVICES_NEPTUNE_DB_TYPE,
mirroring LocalStack's NEPTUNE_DB_TYPE) so clusters can be backed by Neo4j and
served over the Bolt protocol for openCypher.

- Add NeptuneDbType enum (gremlin -> 8182, neo4j -> 7687) with alias parsing
- Add db-type and default-neo4j-image config (default neo4j:5-community)
- Resolve image/port per engine in NeptuneService and NeptuneContainerManager
- Run Neo4j with NEO4J_AUTH=none and probe readiness via the Bolt handshake
- Add openCypher/Bolt integration test and NeptuneDbType unit test
- Document the new option in README and docs/services/neptune.md

* test(neptune): assert DeleteDBCluster cleanup and clarify docs

Assert the openCypher integration test's DeleteDBCluster cleanup returns
200 so a failed delete surfaces instead of silently leaking a backend
container and proxy port into later tests.

Also drop the misleading backend ports from the db-type table (users
connect via the proxy port range, not the container-native port) and
correct the SigV4 auth-header comment to reference the management
request routing.

* fix(neptune): treat all-zero Bolt handshake reply as not-ready

The Neo4j readiness probe accepted any non-empty response, but Neo4j
answers the Bolt handshake with 0x00000000 when it rejects every
proposed version (Bolt disabled, wrong port, or an unsupported server
version). That made the probe report ready for a backend whose sessions
would then fail. Require a non-zero agreed version for the neo4j
db-type so such a backend times out with a clear error instead.

* fix(neptune): fall back to default db-type on unknown config value

A server-side typo in FLOCI_SERVICES_NEPTUNE_DB_TYPE shouldn't fail the
client's CreateDBCluster. Make NeptuneDbType.fromConfig return an
Optional and have NeptuneService fall back to GREMLIN with a WARN for an
unrecognised value, instead of throwing InvalidParameterValue. The
cluster still comes up on the default engine.
2026-06-20 11:24:00 -05:00
Vishal Goyal 5aee7b6312 fix(cloudformation): merge SAM Globals into resource properties (#1427)
Apply top-level Globals (e.g. Function Handler / Runtime / Timeout,
Api settings) onto each matching SAM resource's properties before
expansion. Resource-level properties take precedence over Globals and
nested maps are deep-merged. Globals is stripped from the template on
every return path.
2026-06-20 11:07:45 -05:00
Vishal Goyal f1204d9d4b feat(cloudformation): generate implicit API Gateway from SAM Api events (#1438)
* feat(cloudformation): generate implicit API Gateway from SAM Api events

Synthesize an implicit AWS::ApiGateway RestApi (RestApi / Resource /
Method / AWS_PROXY Integration / Deployment / Stage) from SAM function
Api events, matching SAM/CloudFormation behavior so a template that
relies on the implicit API can be deployed and served.

Routes are deduped by (path, method); a route whose RestApiId is
explicitly set (non-null) is left untouched; the generated RestApi
uses a collision-safe logical id.

* fix(cloudformation): harden implicit API route generation

- skip Api routes whose Path is a non-literal intrinsic (Ref/Fn::Sub)
  instead of registering them as the API root
- default Method to ANY when given as a non-literal value
- make the Deployment and Stage logical ids collision-safe via uniqueId
2026-06-20 10:06:44 -05:00
MAN$I VERMA 222fec440b fix(acm): restore ACM certificates after restart by ignoring computed getters (#1428) (#1440) 2026-06-20 09:58:54 -05:00