* feat(iam): support account aliases
Implement ListAccountAliases, CreateAccountAlias and DeleteAccountAlias.
An account holds at most one alias: creating a second returns
EntityAlreadyExists, and deleting requires the current alias by name so a
stale value cannot silently clear it.
FLOCI_SERVICES_IAM_ACCOUNT_ALIAS seeds an alias at startup for callers that
expect to read one without creating it first.
Closes#2101
* fix(iam): make account alias create and delete atomic
Concurrent CreateAccountAlias calls could all pass the emptiness check and
write, reporting success to every caller while keeping only one value. Unlike
a named resource, where racing creates carry the same name and either winner
is equivalent, racing alias creates carry different values, so a loser is told
their alias was set when another is stored.
Guard the check-then-write on both create and delete, and cover it with a
concurrency trial asserting exactly one winner. Also track the alias created
by the bats delete case in ACCOUNT_ALIAS so teardown clears it if the test
fails midway.
* fix(iam): match verified AWS account alias semantics and unbreak the test fixture
IamServiceTestHelper resolves the package-private IamService constructor
reflectively against a hardcoded parameter list, so the extra storage backend
broke it at run time with no compile-time signal. Every test using that fixture
errored, and one of them hangs on a socket read rather than failing, which is
what exhausted the CI job. Extend both lookups to the new arity.
Checking the error message against a live AWS account showed the operation
itself was modelled wrongly: CreateAccountAlias does not reject a second alias,
it replaces the current one. EntityAlreadyExists means the requested name is
taken, which for a single-account store is only the alias already held. Create
now replaces and rejects just that case, which also makes the message name the
alias the caller asked for. DeleteAccountAlias applies the same pattern
constraint as create, so a malformed value is a ValidationError.
Concurrent creates therefore all succeed with last-write-wins; the trial now
asserts the store settles on one of the requested values. Seeding logs when it
skips because an alias is already stored, which is otherwise invisible under
persistent storage.
* fix(test): repair iam.bats after the merge fused test bodies
Resolving the merge by keeping both sides concatenated the OIDC and account
alias cases as text, which left the create_oidc_provider helper nested inside an
alias test and dropped a closing brace, so bats could not parse the file and
produced no report at all. Rebuild it from main plus the alias cases, with the
alias tracked in setup and teardown.
* test(iam): pin account alias isolation, and document the two-dash rule
The alias is the only IAM entity keyed by a constant rather than a
caller-supplied name, so every account shares one storage key and the
separation rests entirely on AccountAwareStorageBackend prefixing. Every
integration test here signs as the same account, so that prefixing was never
exercised for aliases. The new case pins it: handing both services the store
unwrapped fails it.
The docs still described the pre-fix constraint. They now carry the
consecutive-hyphen rule and note that the ValidationError message, reproduced
from AWS verbatim, does not itself mention it.
---------
Co-authored-by: Michal Schreiber <michal.p.schreiber@gmail.com>
Co-authored-by: Michal Schreiber <michal.schreiber@benefitsystems.pl>
* fix(ec2): keep the source on security group rules
AuthorizeSecurityGroupIngress and -Egress read only
IpPermissions.N.IpRanges.M.CidrIp, so a rule whose source is another
security group was accepted and then silently stripped: it came back with
no source at all on the authorize response, on DescribeSecurityGroups and
on DescribeSecurityGroupRules. "Allow traffic from security group X" is how
an ALB is wired to its backend tasks, so that whole class of wiring could
be created against Floci but never asserted afterwards.
Parse the source types the permission actually carries: group references,
which the EC2 Query protocol serializes under the wire name Groups rather
than the SDK-facing UserIdGroupPairs, and IPv6 ranges. A reference made by
group name resolves to its group id within the target group's VPC, since
names are unique per VPC and ReferencedSecurityGroup has no name field.
Flatten one SecurityGroupRule per source entry, each keeping its own
description, matching the AWS invariant that a rule holds exactly one
source. A permission with no source at all still yields a single sourceless
rule, as before. The reference is returned as referencedGroupInfo on
DescribeSecurityGroupRules and as UserIdGroupPairs on
DescribeSecurityGroups.
An IPv6-only TCP ingress rule now publishes its host port, which it could
not do while the ranges were dropped at the parse; Ec2PortForwardManager
already treats IPv6 ranges as a CIDR source, and group references stay
unpublished.
Revoke still matches on protocol and port range alone and ignores sources,
unchanged by this.
Closes#2190
* style(ec2): brace the conditionals in the new source parsing
AGENTS.md requires braces on every conditional. The new IPv6 and group
source loops and the group-reference resolution used the unbraced form
the surrounding parse loop happens to use.
* feat(iam): support OIDC identity providers
Implement CreateOpenIDConnectProvider, GetOpenIDConnectProvider,
DeleteOpenIDConnectProvider, AddClientIDToOpenIDConnectProvider,
RemoveClientIDFromOpenIDConnectProvider, UpdateOpenIDConnectProviderThumbprint
and the provider tag actions, and back ListOpenIDConnectProviders with real
data instead of a fixed empty list.
A provider is identified by its URL, so the ARN is derived from it and the
scheme is stripped: GetOpenIDConnectProvider reports the URL without https://,
matching AWS. Creating the same URL twice returns EntityAlreadyExists.
Thumbprints are stored and echoed back but never validated against the remote
endpoint, since nothing here performs the TLS handshake they describe.
Closes#2102
* test(iam): cover OIDC provider persistence and cap the provider URL
Add IamServicePersistenceTest: IAM state is persisted through StorageFactory,
so a restart must preserve providers along with their client IDs, thumbprints,
tags and creation time. The model carries an Instant and two lists, so a broken
serialization round trip would surface here first.
Also enforce the documented 255-character limit on the provider URL, which was
otherwise unchecked and would have produced an oversized ARN.
* fix(iam): match verified AWS behaviour for OIDC providers
Checked the emulated surface against a live AWS account and corrected where it
diverged:
AddClientIDToOpenIDConnectProvider and RemoveClientIDFromOpenIDConnectProvider
are idempotent on AWS. Adding a client ID that is already present, and removing
one that was never added, both succeed and change nothing; they previously
raised EntityAlreadyExists and NoSuchEntity.
Exceeding the thumbprint limit reports InvalidInput, not LimitExceeded. The
client ID quota and duplicate-provider messages now use the AWS wording, and
DeleteOpenIDConnectProvider reports its own not-found phrasing.
Confirmed unchanged: the ARN is derived from the scheme-less URL, Get echoes the
URL without its scheme, the URL is capped at 255 characters, the client ID quota
is 100 with LimitExceeded, and URLs are not normalized, so a trailing slash or a
case difference yields a separate provider.
* fix(iam): reject missing required parameters on OIDC mutators
A null ClientID read as "not in the client ID list", so
RemoveClientIDFromOpenIDConnectProvider reported a no-op success for a request
that never named one. DeleteOpenIDConnectProvider had lost its ARN check when
it stopped routing through getOpenIDConnectProvider to report the not-found
wording AWS uses for that action, so a request with no ARN came back as
NoSuchEntity rather than a required-parameter error.
Route every OIDC mutator through shared ARN and client ID checks so a malformed
request fails as ValidationError before any lookup.
* fix(iam): unbreak the reflective test fixture for the new constructor arity
IamServiceTestHelper resolves the package-private IamService constructor
reflectively against a hardcoded parameter list, so the extra storage backend
broke it at run time with nothing failing at compile time. Every test using the
fixture errored, and one of them blocks on a socket read rather than failing,
which exhausted the CI job before it could report. Extend both lookups and both
newInstance calls to the new arity.
* fix(iam): reject empty tag collections on OIDC providers
TagOpenIDConnectProvider with no Tags and UntagOpenIDConnectProvider with no
TagKeys performed a no-op mutation and returned 200. AWS rejects both, as
InvalidInput rather than ValidationError, with distinct messages for the map and
the key list; checked against a live account. Validate the ARN on the tag path
too, so a missing one fails before the lookup like the other mutators.
---------
Co-authored-by: Michal Schreiber <michal.p.schreiber@gmail.com>
Co-authored-by: Michal Schreiber <michal.schreiber@benefitsystems.pl>
* feat(lambdamicrovms): AWS Lambda MicroVMs service module
Adds the Lambda MicroVMs control plane, a service AWS took GA on 2026-06-22:
MicroVM images with a version and build lifecycle, the managed base-image
catalog, MicroVM CRUD, and VPC egress network connectors.
Two service models rather than one. Lambda Microvms (apiVersion 2025-09-09)
carries images and MicroVMs under /2025-09-09; Lambda Core (2026-04-30)
carries network connectors under /2026-04-04. Both sign as lambda, so their
requests arrive under the existing lambda claim in ResolvedServiceCatalog and
route by path. Neither prefix collides with anything LambdaController serves,
and both are enabled by the lambda service rather than adding a toggle.
Tagging rides the classic /2017-03-31/tags/ routes, so LambdaTagController
learns the MicroVM ARN forms.
Resources are stored per account and region. Floci resolves a per-request
account in AccountContextFilter and these ARNs carry it, so region-only
storage would let two accounts sharing a region read and mutate each other's
images, MicroVMs and connectors.
Wire shapes come from the vendored service models and, where the models are
silent or disagree with the service, from responses recorded against live
AWS. Several members the models mark optional are enforced in practice — a
connector needs ClientToken, OperatorRole, NetworkProtocol and
AssociatedComputeResourceTypes despite all four being optional in Smithy — and
several resources are returned in a different projection per operation: an
image in four shapes, a connector in four, with only the list summaries
carrying Type.
Builds converge instantly rather than on a timer, the usual emulator trade.
Where that would otherwise produce an inconsistent body it is handled
explicitly: a create or update reports the transitional state and does not
name the version it is minting as active, because a client reading otherwise
would launch a MicroVM off a version that does not exist yet.
Auth tokens, the per-VM endpoint, and the idle and suspend timers are
deliberately out of scope here; they belong to a full-fidelity MicroVMs
emulator rather than to CloudFormation provisioning.
Verified against a suite of responses recorded from live AWS
(https://github.com/INTENTIUS/m80): 26 checks over the image, MicroVM and
connector lifecycles, 0 failures.
* feat(cloudformation): provision AWS::Lambda::MicrovmImage and AWS::Lambda::NetworkConnector
Registers a CfnResourceProvisioner for the two MicroVM CloudFormation types
against the LambdaMicrovmsService added alongside, so a template declaring
either provisions and deletes rather than being skipped.
Uses the CloudFormationResourceRegistry interface rather than the switch in
CloudFormationResourceProvisioner, following SqsCfnProvisioner.
* test(lambdamicrovms): AWS CLI compatibility coverage for images, MicroVMs and connectors
* fix(lambdamicrovms): wire service state through StorageFactory
Images, MicroVMs and connectors were held in plain in-memory maps, so in
persistent mode a restarted Floci lost them while the CloudFormation stacks that
created them survived. Those stacks then referenced resources that no longer
existed and DeleteStack failed on the 404.
The three stores are now StorageBackedMap over StorageFactory backends, keyed
region/id. MicroVMs are delivered as part of the lambda service, so they share
its storage key and therefore its configured mode and flush interval rather than
declaring their own. The account half of the key is dropped from the service and
left to the backend, which prefixes and strips the same account the
RegionResolver returns, so region and account isolation are unchanged.
StorageBackedMap only marks the backend dirty on put and remove, so every path
that mutated a stored object in place now writes it back: image update, version
status, version delete, rebuild, MicroVM settle and terminate, connector settle
and update, and both tag paths.
* style(core): import the lambda microvms controllers in the service catalog
* fix(lambdamicrovms): register the persisted types for reflection
Moving images, microvms and connectors into StorageBackedMap made their model
classes persisted types, and PersistedModelReflectionTest fails on any that lack
@RegisterForReflection because native-image persistence cannot rebuild them on
restart.
* feat(ec2): support managed prefix lists
Implement CreateManagedPrefixList, DescribeManagedPrefixLists,
GetManagedPrefixListEntries, ModifyManagedPrefixList and
DeleteManagedPrefixList.
Entries are versioned: a list starts at version 1 and every modification that
changes entries stores a new version, so GetManagedPrefixListEntries can serve
an earlier TargetVersion. Renaming or raising MaxEntries does not create a
version, CurrentVersion makes a modification conditional, and removals apply
before additions so one call can replace an entry's description.
The AWS-managed gateway-endpoint lists are now built once and served by both
DescribeManagedPrefixLists and the existing DescribePrefixLists, so the two
surfaces cannot report different CIDRs for the same list. They are read-only.
Closes#2100
* fix(ec2): validate prefix list input and keep tag copies in sync
Three defects in the managed prefix list surface:
ModifyManagedPrefixList only checked the resulting entry count against
MaxEntries, so a zero or negative MaxEntries on an empty list passed the check
and persisted an impossible capacity.
CreateTags and DeleteTags update the generic tag store and then mirror the
result onto the resource, but updateResourceTags had no arm for prefix lists,
leaving the copy on the model stale for describe responses and tag filters.
MaxEntries and TargetVersion were converted with Integer/Long.valueOf, so
malformed input escaped as an unchecked NumberFormatException and became a 500
rather than a structured EC2 client error.
* fix(ec2): reject a missing PrefixListId and infer the prefix-list tag type
A null PrefixListId reached List.of() inside describeManagedPrefixLists and
threw NullPointerException, so DeleteManagedPrefixList,
GetManagedPrefixListEntries and ModifyManagedPrefixList answered a request that
never named a list with a 500 rather than a client error. Guard the lookup and
raise MissingParameter.
inferResourceType had no pl- arm, so tags on a prefix list were stored but
reported as resourceType "unknown" and were invisible to a DescribeTags filter
on resource-type. The existing test only covered describe and tag: filters,
which is why this went unnoticed.
Also cover the accepting branch of the address-family check, which until now was
only reached by the rejecting case.
* fix(ec2): treat a blank numeric parameter as malformed rather than absent
intOrNull and longOrNull returned null for a present but blank value, which the
callers read as "parameter not supplied". For CurrentVersion that silently
downgraded a conditional ModifyManagedPrefixList to an unconditional one, so a
request that asked to be gated on a version was applied anyway. Only an absent
parameter is null now; a blank one reaches the parse and surfaces as
InvalidParameterValue.
* fix(ec2): report PrefixListVersionMismatch for a stale CurrentVersion
A conditional ModifyManagedPrefixList that loses the version check returns
PrefixListVersionMismatch on AWS, not IncorrectState; verified against a live
account, which also supplies the message. The Terraform provider keys its retry
handling on that code, so the previous one would have left a caller unable to
recognise a losing conditional update.
---------
Co-authored-by: Michal Schreiber <michal.p.schreiber@gmail.com>
* fix(secrets-manager): return partial result for missing secrets in batch
* fix(secrets-manager): remove hardcoded errorCode mapping
* fix(secrets-manager): report deleted and missing current version secrets in BatchGetSecretValue errors
DeleteStack swallowed every resource-deletion failure and always reported
DELETE_COMPLETE. Deleting a stack that owned a non-empty AWS::S3::Bucket
therefore "succeeded" while the bucket and its objects were left behind,
which diverges from AWS (S3 refuses to delete a non-empty bucket, so the
stack must end in DELETE_FAILED).
- CloudFormationResourceProvisioner#delete no longer wraps resource deletion
in a catch-all; failures propagate to the stack-level handler. The lenient
*Safe helpers and the intentional KMS key no-op are preserved.
- CloudFormationService#deleteStackResources now records per-resource
failures: the resource is marked DELETE_FAILED with a reason and event,
remaining resources are still attempted, and the stack settles into
DELETE_FAILED (retaining the stack and its exports) instead of being
reported as deleted. Resources left in DELETE_FAILED are re-attempted on a
subsequent delete, matching AWS retry behavior.
This corrects the same silent-success deviation for every managed resource
type, not just S3 buckets.
Adds a Java integration regression test and AWS CLI compatibility tests
covering both the non-empty (DELETE_FAILED) and empty (DELETE_COMPLETE)
bucket cases.
Fixes#1539
AWS::EC2::VPC and AWS::EC2::Subnet (and related networking resources) had no
provisioner case, so they fell through to the stub branch: CloudFormation
reported CREATE_COMPLETE and exported a fake "logicalId-<random>" physical id,
but the subnet was never created in EC2. ec2 describe-subnets did not return it
and elbv2 create-load-balancer failed with "The subnet ID '...' does not exist".
Inject Ec2Service into CloudFormationResourceProvisioner and add cases for VPC,
Subnet, SecurityGroup, InternetGateway, RouteTable, SubnetRouteTableAssociation,
Route, NatGateway and EIP. Each delegates to the existing Ec2Service create
methods and sets the physical id to the real vpc-/subnet-/... id so Ref/exports
resolve to resources EC2 and ELBv2 can use. Topological ordering already
guarantees parents are provisioned before children.
Adds a CloudFormation+EC2+ELBv2 integration test plus AWS CLI and CDK
compatibility coverage.
Closes#1297
* test(kms): add grant compatibility contracts
* feat(kms): support empty ListGrants
* feat(kms): add CreateGrant and persisted ListGrants round trip
* test(kms): add create grant round trip coverage
* feat(kms): add grant pagination, filters, and ListRetirableGrants
* test(kms): add pagination, filter, and retirable grant coverage
* feat(kms): add RevokeGrant administrative delete
* test(kms): add RevokeGrant unit and integration coverage
* feat(kms): add RetireGrant with token and key+grant retirement paths
* docs(kms): document grant lifecycle operations and enforcement scope
* fix(kms): include RetiringPrincipal in ListGrants response
The handleListGrants handler was omitting RetiringPrincipal from the
JSON response even when the grant had one set. This meant grants
created with a retiring principal were invisible through ListGrants,
while ListRetirableGrants worked fine. Adds the missing serialization
to match the GrantListEntry AWS spec.
* fix(sqs): omit Messages field from empty ReceiveMessage JSON response
Real AWS SQS omits the Messages field entirely when a ReceiveMessage
call returns no messages. With AWSConfigs.InitializeCollections=false
(the modern AWS SDK default) the SDK leaves the response collection as
null in that case, which several parity tests assert.
Floci was emitting "Messages": [] instead, so the SDK deserialized it
to a non-null empty list. This broke the StartMessageMoveTask family
of tests (which drain a freshly-created queue and assert null) and
~12 other tests in the .NET conformance sweep.
Refs #768.
* test(pipes): handle empty AWS CLI output in stopped-pipe assertion
After the SQS ReceiveMessage fix, an empty queue response is `{}` instead
of `{"Messages": []}`. The AWS CLI may emit an empty string in that case,
which makes `jq` fail and leaves msgs as empty, breaking the assertion.
Default $out to `{}` so the .Messages // [] fallback applies cleanly.
Tags passed to CreateQueue were silently dropped in both the Query
and JSON protocol handlers — neither extracted the Tags parameter
before calling sqsService.createQueue().
Changes:
- SqsQueryHandler: extract Tag.N.Key/Value params and pass to service
- SqsJsonHandler: read both 'Tags' and 'tags' fields (botocore sends
lowercase 'tags' for CreateQueue but uppercase 'Tags' for TagQueue)
- SqsService: add createQueue overload accepting tags; existing 2-arg
and 3-arg overloads delegate with null tags (no callers broken)
Closes#699
* 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
* 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.
The AWS CLI's passes the full changeset ARN
(returned by CreateChangeSet) as the ChangeSetName parameter to subsequent
calls. CloudFormationService was doing a direct map lookup by the raw
parameter value, which always missed because changesets are stored by
short name — causing a 400 ChangeSetNotFoundException and the CLI to
crash with .
Add resolveChangeSetName() to extract the short name from an ARN before
the map lookup, and apply it in describeChangeSet, executeChangeSet, and
deleteChangeSet.
Closes#606
Co-authored-by: Dixit R Jain <dixitrjain@Mac-1319.lan>
* feat(ses): implement email template CRUD with stored, inline, and ARN variants
Adds CreateTemplate / GetTemplate / UpdateTemplate /
DeleteTemplate / ListTemplates on both V2 REST JSON
(/v2/email/templates) and V1 Query.
SendEmail / SendTemplatedEmail resolve templates in three forms
with Mustache-style {{var}} substitution against TemplateData:
- TemplateName references a stored template
- TemplateArn extracts the name from the template/<name>
segment of an SES template ARN (region and account segments
are not validated, mirroring how KMS / Secrets Manager
handle ARNs in Floci)
- TemplateContent (V2 only) supplies inline subject / text /
html without storing the template first
V2 Content.Template requires exactly one of TemplateName,
TemplateArn, or TemplateContent; violations return
BadRequestException (400). V1 SendTemplatedEmail accepts
TemplateArn either alone or alongside Template (name) — the
name is used for resolution when both are present, matching
AWS where boto3 and the Java SDK keep Template as a required
field and treat TemplateArn as supplementary for cross-account
addressing.
Templates persist region-scoped via StorageFactory in
ses-templates.json. Template names reject leading/trailing
whitespace (same rule as identities) and are validated through
a single validateTemplateName helper reachable from every
resolution path. listTemplates is sorted by CreatedTimestamp
with TemplateName as a tiebreaker for deterministic output.
Error codes: the service layer throws V1-style codes
(TemplateDoesNotExist / AlreadyExists / InvalidTemplate /
InvalidParameterValue); SesController remaps them to
NotFoundException (404) / AlreadyExistsException (400) /
BadRequestException (400) for V2 callers.
* test(ses): add Python and Java SDK compatibility tests for templates
Covers boto3 (ses / sesv2) and AWS Java SDK v2 (SesClient /
SesV2Client) against the SES email template CRUD, inline
TemplateContent, and TemplateArn paths. Happy path,
duplicate-create rejection, missing-template lookups,
Mustache-style variable substitution, and 3-way selector
conflicts on V2 Content.Template are exercised on both SDK
surfaces.
Adds:
- Python: ses_client / sesv2_client conftest fixtures and a
tests/test_ses_templates.py suite covering V1 + V2
- Java: sesv2 Maven dependency, SesV2Client factory in
TestFixtures, and a SesTemplateTest covering V1 + V2
* docs(ses): document email template CRUD and templated send
Adds the new V1 template actions (CreateTemplate / GetTemplate
/ UpdateTemplate / DeleteTemplate / ListTemplates /
SendTemplatedEmail) and the V2 /v2/email/templates endpoints
to the SES service reference, and extends the README service
matrix to mention template support on the SES / SES v2 rows.
* fix(ses): add template actions to SES_ACTIONS for unsigned request routing
Unsigned clients (curl, aws --no-sign-request) were falling through to
the SQS handler because the six template Query actions were not
registered in SES_ACTIONS.
* fix(ses): narrow exception catch to JsonProcessingException in template endpoints
Broad Exception catch was masking unexpected errors (e.g. NPE) as 400
responses. Narrowed to JsonProcessingException which is the only
checked exception from objectMapper.readTree().
* test(ses): add template variable substitution edge cases and cross-region isolation
Add SesServiceTemplateTest with 14 unit tests for applyTemplateData
covering undefined variables, spaced/hyphenated names, unclosed braces,
non-string JSON values, regex metacharacters, and case sensitivity.
Add cross-region isolation integration test verifying templates created
in one region are not visible in another.
* test(ses): add awscli compatibility tests for template CRUD and templated send
Cover create, get, update, list, delete template and send-templated-email
via the AWS CLI. Uses JSON parameter format to avoid awscli parser issues
with Mustache-style {{variable}} syntax.
---------
Co-authored-by: Kenshin OKINAKA <kenshin_okinaka@realcross.co.jp>
* feat(cognito): add TagResource, UntagResource, ListTagsForResource for user pools
Dispatch the three Cognito IDP tag operations through CognitoJsonHandler and
resolve user pools by parsing the resource ARN (O(1) pool-store lookup, not a
full scan). Malformed ARNs now surface as InvalidParameterException rather
than a swallowed ResourceNotFoundException.
Reject reserved floci:* keys on standalone TagResource via
ReservedTags.rejectReservedTagsOnUpdate, matching the existing strip-on-write
behavior on CreateUserPool / UpdateUserPool. Mutations are synchronized on
the pool instance to match the ensureJwtSigningKeys pattern.
Covered by new unit tests (CognitoServiceTest, CognitoJsonHandlerTest), AWS
CLI bats (cognito.bats), and Java SDK compat tests (CognitoFeaturesTest).
* chore: retrigger CI
Real AWS DynamoDB accepts both short table names and full table ARNs for
TableName inputs. Floci only accepted short names, which broke OpenSearch
Data Prepper's dynamodb source plugin (requires table_arn) and any
Terraform flow that feeds aws_dynamodb_table.x.arn into the SDK.
- Add DynamoDbTableNames resolver: canonicalizes TableName input,
rejects ARNs targeting index/stream resources, and rejects ARNs whose
region does not match the request region (400 InvalidParameterValue,
matching the #450 Lambda ARN precedent).
- Normalize at every DynamoDbService lookup boundary, including
transaction condition paths and batch RequestItems map keys, so
internal callers handling request-derived input cannot bypass the
resolver.
- CreateTable explicitly rejects ARN-form TableName via requireShortName
so ARN input cannot be persisted as the canonical table identity
(which would produce nested ARN-on-ARN TableArn values).
- UpdateTable stream enable/disable now use the canonical
table.getTableName() instead of the raw request TableName. Without
this, calling UpdateTable via ARN keyed stream state under the ARN
while reads canonicalize, stranding the stream.
- Covers DescribeTable, Scan, Query, GetItem, PutItem, UpdateItem,
DeleteItem, BatchGetItem, BatchWriteItem, TransactGetItems,
TransactWriteItems, UpdateTable, DeleteTable, DescribeTimeToLive,
UpdateTimeToLive, DescribeContinuousBackups, UpdateContinuousBackups,
Enable/DisableKinesisStreamingDestination.
- Tests: 32 resolver unit tests, 7 integration tests (item/batch/
transact/TTL/backups/streaming/validation), 1 awscli bats case.
bats-core parallelises tests within a file when --jobs > 1. ses.bats
and s3-notifications.bats share state across tests via setup_file/
teardown_file. In ses.bats this races "verify identities deleted"
against the delete calls, producing an intermittent failure that
blocked merges across recent PRs (#570, #576, #580).
Pass --no-parallelize-within-files to keep parallelism across files
(where tests are independent) while serialising within files. The
--jobs 4 speedup is preserved since total runtime is bottlenecked by
total-tests / jobs regardless of within-file scheduling.
Verified locally: 20/20 pass with the flag, 4/10 pass without.
Allow KMS CreateKey and Cognito CreateUserPool to accept a reserved floci:override-id tag at creation time so tests can pin deterministic resource IDs without a lookup round trip.
Strip reserved floci:* tags from stored metadata and responses, reject reserved tags on KMS TagResource, wire KMS CloudFormation provisioning through tagged key creation, and add focused unit, handler, integration, and AWS CLI bats coverage for the new behavior.
CreateKey with `--key-spec HMAC_{224,256,384,512} --key-usage
GENERATE_VERIFY_MAC` now succeeds instead of throwing
InvalidCustomerMasterKeySpecException. DescribeKey returns the matching
MacAlgorithms array (HMAC_SHA_*), and GetPublicKey correctly rejects
HMAC keys with UnsupportedOperationException.
Validation also rejects the two incompatible pairings:
- HMAC_* without GENERATE_VERIFY_MAC usage
- GENERATE_VERIFY_MAC usage with any non-HMAC spec
HMAC material is generated with SecureRandom and base64-stored on the
existing privateKeyEncoded field (same pattern as RSA/ECC private key
bytes). Generation sits outside the try block that wraps asymmetric
keypair creation, so ValidationExceptions aren't rewrapped as 500s.
Closes#497.
Out of scope (follow-up PRs):
- GenerateMac / VerifyMac operations
- HMAC key rotation support
- Catch-rewrap bug in generateKeyMaterial for asymmetric keys
* refactor: narrow exception handling to transport-level failures only
The broad catch(Exception) in the Lambda dispatch probe and warmup
swallowed all errors, masking real service regressions as skipped tests.
Narrow to specific transport-level exceptions so only environment
unavailability (timeout, connection refused) triggers a skip:
- Java probe: SdkClientException + ConnectException (not all Exception)
- APIGW warmup: HttpTimeoutException + ConnectException
- Go invoke: net.Error via errors.As (not any error)
Unexpected service errors now propagate as test failures.
* fix: remove unreachable ConnectException catch in lambda probe
AWS SDK wraps all transport-level failures (ConnectException,
ApiCallTimeoutException, etc.) in SdkClientException, so the
separate ConnectException catch was unreachable and broke compilation.
* fix(compat): use unique_name in s3-notifications.bats to avoid parallel collisions
Parallel bats workers could share the same $(date +%s) timestamp,
producing identical bucket/queue/topic names. One worker's
put-bucket-notification-configuration would overwrite another's,
and the round-trip read would return zero filter rules. Switch to
unique_name which appends the shell PID.
* fix(compat): use unique_name in kms and ses bats to avoid parallel collisions
Same class of flake as s3-notifications.bats. Under --jobs 4, parallel
bats workers sharing a $(date +%s) timestamp produce identical alias
names (kms) and identity names (ses), causing cross-worker interference.
* feat(dynamodb): add EnableKinesisStreamingDestination support
Implement EnableKinesisStreamingDestination, DisableKinesisStreamingDestination,
and DescribeKinesisStreamingDestination API actions for DynamoDB.
When a Kinesis streaming destination is enabled on a table, all item mutations
(INSERT/MODIFY/REMOVE) are automatically forwarded to the configured Kinesis
stream. The Kinesis record payload matches the AWS format with awsRegion,
eventName, tableName, and dynamodb (Keys, NewImage, OldImage, etc.).
Closes#426
* fix(dynamodb): address review feedback for KinesisStreamingDestination
- Decouple Kinesis forwarding from DDB Streams: forwardToKinesisDestinations
is now called directly from DynamoDbService mutation hooks, independent of
whether DDB Streams is enabled
- Fix ApproximateCreationDateTime to use milliseconds (was seconds)
- Remove SequenceNumber and StreamViewType from Kinesis payload (not present
in real AWS)
- Add ApproximateCreationDateTimePrecision inside dynamodb record node
- Return ValidationException when disabling an already-disabled destination
- Simplify persistTable to accept TableDefinition directly
- Add test for disable-already-disabled and payload format assertions
ListUserPoolClients was returning full UserPoolClient objects including
ClientSecret, GenerateSecret, AllowedOAuthFlows, AllowedOAuthScopes,
CreationDate and LastModifiedDate. Per the AWS API spec, this action
returns UserPoolClientDescription containing only ClientId, ClientName
and UserPoolId.
Add clientToDescriptionNode() for the list response, matching the
existing pattern where ListUserPools uses userPoolToDescriptionNode().
DescribeUserPoolClient continues to return the full object via
clientToNode().
applyRemoveClause() only handled top-level attributes, treating
"ratings.foo" as a literal key name instead of navigating into the
map structure. Add removeValueAtPath() that splits the path into
segments, resolves expression attribute names, and navigates through
nested Map wrappers (M field) to remove the target key.
Includes unit tests for nested paths, expression attribute names,
non-existent paths, and 3-level deep nesting, plus an AWS CLI
compat test reproducing the original report.
Enable file-level parallelism (--jobs 4) for the awscli compatibility
test suite. Replace hardcoded resource names in rds.bats and ecr.bats
with unique_name() to prevent cross-file collisions under parallel
execution, matching the pattern used by the other 13 bats files.
* test: move compatibility tests into this repo
* fix: add StatisticValues parsing to CloudWatchMetricsJsonHandler
* fix: add missing required abstract methods to EmulatorConfig in EventBridgeSchedulerIntegrationTest
* test: add sdk tests for multipart S3 copy coverage
* fix: cover and fix smithy cbor and multipart s3 copy regressions
* test: migrate more test coverage to new folder
* test: add missing ec2 expectation in healthcheck test
* docs: update READMEs in `./compatibility-tests`