Commit Graph
487 Commits
Author SHA1 Message Date
Vũ Thế Huy 4daba7ed6a feat(redshift): wire the Simple Query DDL interceptor into the proxy (#3029)
* feat(redshift): add PostgresWireDecoder for frontend wire-message framing

* feat(redshift): intercept Simple Query DDL through RedshiftInterceptingBridge

* test(redshift): end-to-end DDL rewrite over the Simple Query protocol

* docs(redshift): document the Simple Query DDL interceptor

* fix(redshift): remove em-dashes and address review feedback on bridge

* fix(redshift): stream opaque non-query frames without size limit

* fix(redshift): stream oversized simple query frames to passthrough

* test(redshift): import stream types in RedshiftInterceptingBridgeTest

* test(rdsdata): fallback to direct H2 driver on classloader mismatch

* test(redshift): remove oversized socket test from RedshiftInterceptingBridgeTest
2026-09-05 10:36:34 -04:00
Guilherme Scaranse 5512db0e05 fix(lambda): persist, validate and enforce event source mapping FilterCriteria (#3060)
* fix(lambda): persist and validate event source mapping FilterCriteria

CreateEventSourceMapping/UpdateEventSourceMapping accepted FilterCriteria,
returned 200, then silently dropped it (get-event-source-mapping reported
null): EventSourceMapping had no such field and the hand-maintained
parse/response allowlists never mentioned it.

Persist it as a typed nested FilterCriteria/Filter on EventSourceMapping
(Jackson round-trips it via EsmStore); parse and validate it at create and
update (well-formed JSON object patterns whose values are non-empty match
arrays or nested objects; max 5 filters; max 4096-char pattern; empty
object / empty Filters / null clear); echo it back omit-when-unset. Add
EsmFilterCriteriaUtils to wrap a stored FilterCriteria as the
{"FilterCriteria":{"Filters":[...]}} node PipesFilterMatcher consumes and
to correlate matched records to their sources by identity.

Poller enforcement (Kinesis/DynamoDB/SQS) follows in a separate change.

* fix(lambda): enforce event source mapping FilterCriteria in the pollers

Round 1 persisted and validated FilterCriteria; this wires it into the three
Lambda event-source pollers so filters actually take effect, reusing the
existing PipesFilterMatcher (unchanged) via EsmFilterCriteriaUtils.

- Kinesis: filter against the AWS dialect, top-level base64-DECODED `data`
  (plus `partitionKey`), while the delivered event keeps `kinesis.data`
  base64. The shard checkpoint now advances to the newest FETCHED sequence
  whenever a batch is disposed of (successful invoke OR fully filtered out),
  so filtered-out records are consumed rather than re-read forever; an invoke
  that errors or is throttled still leaves the checkpoint unmoved.
- DynamoDB Streams: same checkpoint discipline; the per-record node
  (top-level eventName + dynamodb.*) is both the delivery and filter shape.
- SQS: non-matching messages are deleted immediately (AWS consumes filtered
  SQS messages), a fully-filtered batch returns without invoking, and all
  post-filter delete/return logic operates only on the matched subset.

Unfiltered mappings are unchanged (no filter nodes built, same list reference).
Adds KinesisEventSourcePollerTest and extends the DynamoDB/SQS poller tests
(matching-only delivery, fully-filtered checkpoint-advance/delete, invoke-error
and throttle no-advance with same-window retry, dialect pin, non-JSON drop).

Also documents FilterCriteria in docs/services/lambda.md.

* style(lambda): remove em dashes from lines this branch adds

AGENTS.md requires colons, commas or periods instead of em dashes. Comment,
javadoc and docs prose only; no code or string literals change.

* fix(lambda): validate filter-pattern operators, arity and operand types

The structural check accepted any non-empty match array, so a malformed operator
reached the matcher and corrupted delivery silently, in whichever direction the
matcher happened to fail. {"numeric":[">","abc"]} coerced its operand to zero and
matched every positive value; {"numeric":[">"]} matched every record because the
comparison loop never ran; an unknown operator matched nothing, so the pollers
checkpointed past or deleted every record. Enforcement makes an unsatisfiable
pattern destructive rather than inert, so it is now rejected at create/update.

Each match element must be a string, number, null, or an object carrying exactly
one operator. Operands are checked per operator, and numeric must be a sequence
of comparison/value pairs. An operator AWS documents but the matcher does not
implement (cidr, wildcard) is rejected with a distinct message rather than
silently dropping records. This couples the validator to PipesFilterMatcher's
operator set, which the previous comment avoided on purpose; that trade no longer
holds now the pollers act on the result.

Stricter than AWS for cidr, wildcard and boolean literals, all of which AWS
accepts. Docs record the deviation and the reason.
2026-09-05 10:32:42 -04:00
Vũ Thế Huy 6653b9a4e4 feat(iam): support DynamoDB fine-grained access control (#2926) (#3011)
* refactor(iam): make the policy condition context multi-valued

Condition keys such as dynamodb:LeadingKeys and dynamodb:Attributes are set-typed by definition, but the evaluator carried the request context as Map<String,String> from the filter all the way into the condition block, so a set could not be represented at all.

Change the type to Map<String,List<String>> across evaluate, simulateCustomPolicy, simulatePrincipalPolicy and the condition helpers, and update the three in-tree call sites. Non-set operators keep today's semantics by comparing only the first value, which is behaviour-preserving for every key that is single-valued today. normalizeConditionContext now preserves an empty list, which the set operators need to distinguish an empty set from an absent key.

* feat(iam): support ForAllValues and ForAnyValue set operators

ForAllValues: and ForAnyValue: appeared nowhere in the IAM package, so
evaluateConditionBlock stripped only an IfExists suffix and the whole
prefixed string reached the operator switch as an unknown operator, which
yields false. Every policy scoping DynamoDB access through
ForAllValues:StringLike therefore denied the requests it was written to allow.

Parse the quantifier prefix ahead of the IfExists strip so
ForAnyValue:StringEqualsIfExists composes, and evaluate the quantifier over
the request's value list, reusing evaluateSingleCondition for each member so
every existing operator works under a quantifier with no new operator code.
Empty-set semantics follow AWS: ForAllValues matches vacuously, ForAnyValue
does not. An absent key still fails closed without IfExists.

* fix(iam): read every SimulatePrincipalPolicy context key value

extractContextEntries read only ContextKeyValues.member.1 and dropped the
rest, which was invisible while the condition context was single-valued but
silently breaks set operators: a ForAnyValue: condition satisfied by the
second supplied value evaluated as implicitDeny. Reuse extractIndexedValues
to collect the whole member list per context entry.

* feat(dynamodb): add a KeyConditionExpression partition-key value reader

IAM condition-key extraction needs the value a Query pins its partition key
to, which today only DynamoDbAccessPathValidator can compute and only as a
side effect of validation. Add a narrow package-internal reader over the
existing ExpressionEvaluator instead of widening the validator's visibility.
Anything it cannot resolve returns null, which the policy layer treats as an
unknown leading key and fails closed on.

* feat(dynamodb): extract LeadingKeys, Attributes and Select from a request

Add a static extractor covering GetItem, PutItem, UpdateItem, DeleteItem,
Query, BatchGetItem and BatchWriteItem. Partition-key values come from Key,
Item, the Query KeyConditionExpression or the per-table RequestItems entries;
attribute names come from Key/Item fields, AttributesToGet,
ProjectionExpression, UpdateExpression targets and ExpressionAttributeNames.

Whatever cannot be determined is absent rather than guessed, so an
unresolvable leading key yields an empty list and the policy layer fails
closed on it.

* feat(iam): populate the DynamoDB condition keys from the request

IamConditionContextResolver supplied s3:* keys only and returned null for every other service, so dynamodb:LeadingKeys, dynamodb:Attributes and dynamodb:Select were never in the request context and no DynamoDB fine-grained policy could match. Add a dynamodb branch that reads the body already buffered by ResourceArnBuilder, resolves the table's key schema through a lazily injected DynamoDbService, and emits the three keys.

A key that cannot be resolved is omitted rather than guessed, so a policy scoping access through it denies the request.

* test(iam): cover the DynamoDB LeadingKeys scenario end to end

Add the issue #2926 acceptance criteria at evaluator level, plus an HTTP test
with enforcement enabled where one scoped session reads USER_alice and is
denied USER_bob against the same table, and a request whose Key omits the
partition attribute is denied because its leading key cannot be proven.

* docs(iam): document the set operators and the DynamoDB condition keys

Record ForAllValues:/ForAnyValue: with their empty-set semantics, the three dynamodb:* condition keys and the actions they cover, and the fail-closed consequence for a request whose leading key cannot be determined.

* fix(iam): correct negated-operator, empty-set and locale handling in conditions

Three fail-open gaps in the condition evaluator, all more reachable now that the
set operators make multi-valued and negated conditions common:

- A negated operator (StringNotEquals, ArnNotLike, NotIpAddress, ...) against a
  condition that lists several values was ORed across them, so the value matched
  as long as it differed from any one entry. AWS ANDs the negated match across
  the list; a ForAllValues:StringNotEquals deny-list on dynamodb:Attributes now
  actually denies.
- Null treated a present-but-empty set as present, so the Null:{key:"false"}
  guard that policies pair with ForAllValues did not block the vacuous empty-set
  allow. An empty set now counts as absent for Null, matching AWS.
- The per-key lower-casing used the default locale while the context map is
  normalised with Locale.ROOT, so under a Turkish locale a key would never match
  its own Deny statement. Both sides now use Locale.ROOT.

* perf(iam): resolve the table key schema without the item-count scan

IamConditionContextResolver called DynamoDbService.describeTable on every
enforced DynamoDB request, and describeTable refreshes the table's item count
by calling size() on a ConcurrentSkipListMap ??? an O(items) traversal ??? before
the request is even authorized. The resolver only needs the HASH key name.

Add DynamoDbService.findTable, which returns the stored definition without the
count refresh, and switch the resolver to it. findTable returns Optional and
never throws, so the surrounding try/catch, its Logger and the now-unused
injected ObjectMapper go away.

* feat(dynamodb): widen condition attribute extraction and support legacy KeyConditions

dynamodb:Attributes under-reported: it collected item/key fields, AttributesToGet,
the projection and update expressions and ExpressionAttributeNames, but never the
names a FilterExpression, ConditionExpression or KeyConditionExpression references.
A Query projecting only allowed attributes while filtering on a forbidden one would
slip past a ForAllValues:StringEquals on dynamodb:Attributes. Walk the parsed
expression tree so literal names, not only #aliases, are captured.

A Query using the legacy KeyConditions map instead of KeyConditionExpression
produced no dynamodb:LeadingKeys at all. Read the EQ entry for the partition key
from that map as a fallback, and take attribute names from KeyConditions and
QueryFilter.

Also pins DynamoDbKeyConditionParser on begins_with (never an equality) and a
top-level OR (not constrained to one partition), both of which must yield null.

* docs(iam): note negated-operator, empty-set and widened Attributes semantics

Record that a negated condition operator ANDs across multiple policy values
(making ForAllValues:StringNotEquals a usable deny-list), that Null treats a
present-but-empty set as absent, and that dynamodb:Attributes now also reflects
filter / condition / key-condition expression names and the legacy KeyConditions
EQ entry.

* fix(dynamodb): replace em-dash with colon in DynamoDbConditionKeys

* fix(dynamodb): resolve GSI partition keys and capture UpdateExpression read attributes

* docs(dynamodb): clarify fail-closed Javadoc applies to LeadingKeys not Attributes
2026-09-05 10:19:17 -04:00
Mario Toffia d771783afb feat(cognito): check the custom domain certificate in ACM and mark it in use (#3035)
* feat(cognito): require an issued ACM certificate for a custom domain and track it as in use

CreateUserPoolDomain and UpdateUserPoolDomain stored any CertificateArn
as given. The certificate must now exist in ACM, in us-east-1, with
status ISSUED, as AWS requires; anything else is rejected with AWS's
InvalidParameterException message.

While a domain uses a certificate, ACM lists the domain's CloudFront
distribution under InUseBy and DeleteCertificate refuses with
ResourceInUseException. Deleting the domain, or moving it to another
certificate, releases the old one. AcmService gains addInUseBy and
removeInUseBy for this; the refusal on delete already existed.

DeleteStack deleted resources in reverse insertion order, so a
certificate added by a later update was deleted before the domain that
still used it and the stack ended in DELETE_FAILED. Resources are now
deleted in reverse dependency order from the stack's template, as on
AWS, with insertion order as the fallback when the template cannot be
read.

* feat(cognito): register the certificate before storing the domain and require a certificate ARN

Review follow-ups:

- The domain was stored before it was registered on its certificate,
  so a certificate deleted between the check and the registration left
  a stored domain that ACM did not protect. Registration now comes
  first on create, and a changed certificate is checked and registered
  before an update touches the domain; the old certificate is released
  after the store. A certificate that disappears in that window fails
  with the same InvalidParameterException as a missing one.
- The ARN check accepted any ACM resource. It now also requires the
  resource to be certificate/<id>, before ACM is asked.
2026-09-05 10:06:53 -04:00
Guilherme Scaranse 8a2161ab5e fix(stepfunctions): let Express executions reuse names and type the nested StartExecution refusal (#3059)
StartExecution enforced execution-name uniqueness on Express state machines, but AWS
does not: an Express name is immediately reusable and every start is its own concurrent
execution. Uniqueness, and the 90-day reuse window, applies to Standard workflows only.

- StepFunctionsService.startExecution now gives an Express execution a per-start ARN
  (express:<stateMachine>:<name>:<uuid>) and skips the execution-store collision check, so
  a reused name starts a new, independent execution instead of failing with
  ExecutionAlreadyExists. This also closes a data-loss hazard: same-name Express starts
  would otherwise share one store key, letting a completing execution overwrite another.
  Standard behavior (idempotent same-input replay while RUNNING, ExecutionAlreadyExists
  otherwise) is unchanged.
- AslExecutor.invokeNestedStateMachine now wraps the child StartExecution call so a refusal
  becomes a typed, catchable error (StepFunctions.ExecutionAlreadyExistsException) instead of
  States.Runtime, which no Catch or Retry can match. This mirrors the aws-sdk:sfn:startExecution
  path, which keeps its Sfn. prefix and is unchanged.

Tests cover Express name reuse and a same-name no-clobber regression at the service level;
nested-refusal typed-error, catch, retry and Sfn-vs-StepFunctions prefix cases for bare,
.sync and .sync:2; a wire-level StartExecution integration test; and a .sync/.sync:2 success
guard. The Express idempotency test that pinned the old divergence is removed.

AWS Compatibility: Express StartExecution is non-idempotent and enforces no name uniqueness,
and the express:<stateMachine>:<name>:<id> ARN shape matches the Step Functions resource-ARN
definition; the optimized states:startExecution integration reports StepFunctions.<Code>Exception
for a Standard-child collision. Left as documented deviations, not changed here: the 90-day
Standard name-reuse window is not modeled, and finished Express executions are retained rather
than evicted.
2026-09-05 07:37:26 -04:00
Mario Toffia 7ec4c89d0f fix(iot): isolate topic rule actions and run the error action (#3012)
* fix(iot): isolate topic rule actions and run the error action

One failing action of a topic rule no longer fails the publish or the
actions after it. The failure is logged, and once every action ran the
rule's errorAction receives the AWS failure document (ruleName, topic,
base64OriginalPayload, failures). CreateTopicRule and ReplaceTopicRule
keep awsIotSqlVersion and errorAction, and GetTopicRule returns them.

* fix(iot): map nested payload values to DynamoDB maps and lists in the dynamoDBv2 action

Objects and arrays in a payload were flattened to empty strings, which
also emptied the failures list of the error action's failure document.
They now become DynamoDB M and L attribute values, as on AWS.

* fix(iot): skip a topic rule action without a type and keep the stack trace of a failed action

An action object without a recognisable member is skipped with a warning
before anything is dispatched, so the failure document can never see a
missing type, and the warnings for a failed action, error action or
unparsable stored rule now carry the exception.
2026-09-05 07:31:01 -04:00
Mario Toffia c3d977a3e3 feat(apigateway): provision AWS::ApiGateway::DomainName and BasePathMapping (#3040)
* feat(apigateway): provision AWS::ApiGateway::DomainName and BasePathMapping

Both types were stubs: the stack turned green while no domain or mapping
existed, Fn::GetAtt on the domain resolved to the literal attribute name, and
a request sent to the custom domain was not routed. The new provisioner calls
the existing CreateDomainName and CreateBasePathMapping. Ref and every
Fn::GetAtt attribute return what GetDomainName reports, a changed DomainName
or BasePath replaces the resource (created before the prior one is deleted),
and everything else is patched in place.

The physical id of a mapping is the compound identifier CloudFormation uses
for the type, <DomainName>|<BasePath>, with (none) for an empty base path.

Service fixes needed so the provisioned values can be read back through the
API: CreateDomainName keeps regionalCertificateArn and regionalCertificateName
(both were dropped), an EDGE domain gets a distributionDomainName and the fixed
CloudFront hosted zone, GetDomainName returns domainNameArn,
endpointConfiguration.types and tags, UpdateDomainName accepts the
/endpointConfiguration/types/EDGE patch path, domain tags are managed through
the tag API on the domain ARN, and CreateDomainName checks the name and stores
the domain under one lock so two concurrent creates cannot both succeed.

* fix(apigateway): keep the distribution in step with a domain's endpoint type

A move to EDGE through UpdateDomainName left the domain without a
distributionDomainName, and a move back to REGIONAL kept the old one, so
GetDomainName and Fn::GetAtt reported CloudFront fields that did not match the
endpoint type. Both create and update now go through one helper that puts a
distribution in front of an EDGE domain and drops it for a REGIONAL one.

* fix(apigateway): serialize domain and mapping changes, refuse a taken base path, validate the endpoint patch path

The stores hand out live objects, so a domain patch, a tag write and a
mapping patch were read-modify-write steps that concurrent calls could lose
or corrupt: eight concurrent tag writes on one domain kept four tags. Every
change to a custom domain or a base path mapping now runs under one lock, and
a tag write replaces the tag map instead of changing the one a reader may be
iterating.

CreateBasePathMapping on a base path that already has a mapping answers
ConflictException as AWS does; before, the new mapping silently replaced the
old one, so eight concurrent creates of one base path all succeeded.

UpdateDomainName accepted any /endpointConfiguration/types/<x> path; the path
must now name the type the domain has, as on AWS.

The provisioner sends the PATCH before it reconciles the tags, so a rejected
update leaves the tags as they were. Tests cover every case above, the
remaining cells of the update matrix (a prior resource gone under a new name),
and the REGIONAL to EDGE move end to end through a stack.

* fix(apigateway): refuse an endpoint type other than REGIONAL or EDGE on CreateDomainName

UpdateDomainName already rejected any other value, but CreateDomainName stored
whatever string the request carried, so a PRIVATE or misspelled type produced a
domain that was neither regional nor edge-optimized and that nothing could
route or describe. Private custom domains are not emulated, so the create now
answers BadRequestException with the same message as the update, and nothing
is stored. Adds the two remaining provisioner matrix cells as tests: a taken
domain name fails the resource without deleting anything, and a resource
without Properties is rejected.
2026-09-04 22:45:24 -04:00
Priamo Germosen 252bfe85a2 feat(lambda): mint EKS bearer tokens natively for the kubernetes executor (#2981)
* docs(lambda): qualify which kubeconfig auth methods the Kubernetes executor supports

#2919 replaced the Fabric8 Kubernetes client with a plain REST client that
only understands static-token and client-certificate kubeconfig auth. The
Kubernetes executor section still said Floci "uses your local kubeconfig"
without qualification, which reads as full kubectl parity. exec and
auth-provider credential plugins (aws eks get-token, gcloud) fail with a
named error instead, so an EKS or GKE user following the doc as-is would
be surprised.

Follow-up noted on hectorvent's approval of #2919.

* feat(lambda): mint EKS bearer tokens natively for the kubernetes executor

#2919 dropped the Fabric8 Kubernetes client, whose kubeconfig handling
covered exec-credential plugins like `aws eks get-token` as a side effect
of shelling out to them via client-go. The replacement REST client
rejected that shape outright, so kubeconfigs generated by
`aws eks update-kubeconfig` (the common case for a real EKS cluster)
stopped working.

Adds EksTokenMinter, which recognizes the `aws eks get-token
--cluster-name <name>` exec shape and mints the bearer token itself:
a presigned sts:GetCallerIdentity URL with x-k8s-aws-id bound into the
signature, base64url-encoded and prefixed with k8s-aws-v1., matching
what aws-iam-authenticator's webhook expects and what the AWS CLI's
own `aws eks get-token` produces. No subprocess is spawned and no SDK
dependency is added, keeping KubernetesApiClient as it was after #2919.

Recognition scans for "eks", "get-token" as a consecutive pair
anywhere in the exec args, rather than requiring them first: confirmed
against the AWS CLI's own update_kubeconfig.py, a generated kubeconfig
always puts the global --region ahead of the subcommand and --output
json after it, so a strictly-positional check would have rejected
every kubeconfig that tool actually produces.

Credentials are resolved from AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/
AWS_SESSION_TOKEN, falling back to the shared credentials file
(AWS_PROFILE, default ~/.aws/credentials). Both are read from the
kubeconfig exec block's own `env` entries first: `aws eks
update-kubeconfig --profile <p>` threads the profile through exec.env
precisely because the plugin has no other reason to see it. An
AWS_PROFILE the exec block names explicitly is honored ahead of static
keys that merely happen to be ambient in Floci's own process, rather
than falling out of plain env-var-beats-profile precedence: those
ambient keys weren't necessarily meant for this resolution, so letting
them silently outrank a profile the kubeconfig specifically asked for
would authenticate as the wrong principal. A lone access key or secret
key, at either the exec.env or ambient-env tier, is rejected outright
rather than silently falling through to the next source, matching
botocore's own PartialCredentialsError instead of quietly picking a
different identity than whatever was actually intended. A session
token is only ever combined with the access/secret key pair from the
same source (exec.env or ambient) it came from, never mixed across
the two, since a session token is only valid for the specific key
pair STS issued it alongside.

STS is signed against the region's actual partition suffix, sourced
from the AWS SDKs' own public partition metadata (botocore's
partitions.json): amazonaws.com for the commercial aws partition and
aws-us-gov, amazonaws.com.cn for aws-cn, and the classified
ISO/ISOB/ISOE/ISOF partitions each under their own distinct domain.
Previously this always assumed the commercial partition, so a
non-standard-partition cluster would get a token signed for a host
that isn't its real STS endpoint.

Role assumption is rejected explicitly, in every form get-token's own
--role-arn flag can actually reach this code as: not just the long
form and the abbreviated --role that update_kubeconfig.py writes when
--role-arn was passed to update-kubeconfig, but every unambiguous
prefix in between (--role-a, --role-ar) that AWS CLI's own argument
parser equally accepts, since role-arn is the only get-token option
starting with "role", plus all of those flags' --flag=value spellings.
Missing any of these would silently mint a token under ambient or
profile credentials instead of the identity the kubeconfig asked for.
Any other exec command or an auth-provider plugin still fails with a
named error rather than being silently mishandled;
SSO/IMDS/container-credentials/IRSA are not implemented.

mint's signing timestamp now takes an injectable Clock (defaulting to
Clock.systemUTC() for every existing caller) instead of calling
Instant.now() directly, so a test can pin it and assert on the exact
resulting signature. Added such a test: the signature for fixed
credentials, cluster, region and timestamp is checked against a value
computed by a from-scratch Python re-implementation of the SigV4 spec,
not ported from this code, so the two can't share a bug. Every other
test up to now only checked the token's shape (right host, right
query keys, a signature that looks like a signature); this is the
first one that proves the actual bytes are what the spec says they
should be.

Also updates docs/services/lambda.md's Kubernetes executor section,
which still said the aws eks get-token exec plugin was unsupported.
2026-09-04 18:05:00 -05:00
Vũ Thế Huy 80725e6f48 fix(dynamodb): flush persistence once per affected table in batch and transact writes (#2998)
* test(dynamodb): add tests asserting single persistence flush per table in batch and transact writes

* fix(dynamodb): flush persistence once per affected table in batch and transact writes (#2995)

* docs(dynamodb): document batch persistence and recommend wal/hybrid for write workloads (#2995)

* fix(dynamodb): pre-validate operations and guarantee persistence flush in batch and transact writes (#2995)

* fix(dynamodb): reject duplicate items in transaction and rollback partial writes on failure
2026-09-04 14:06:13 -04:00
lex00 dd9cdc1207 feat(cognitoidentity): identity pool management plane (CRUD, roles, principal-tag maps, tags) (#2977)
* feat(cognitoidentity): identity pool management plane (CRUD, roles, principal-tag maps, tags)

Emulates the Cognito Identity (federated identity pools) management API:
CreateIdentityPool through DeleteIdentityPool, ListIdentityPools with
pagination, SetIdentityPoolRoles/GetIdentityPoolRoles including role
mappings, Set/GetPrincipalTagAttributeMap, and resource tagging. JSON 1.1
under the AWSCognitoIdentityService target prefix, signing name
cognito-identity.

* fix(cognitoidentity): require AllowUnauthenticatedIdentities and key tag writes by pool region

An omitted AllowUnauthenticatedIdentities returned success with false persisted. It now fails with ValidationException. TagResource and UntagResource wrote the pool back under the signing region rather than the region in its ARN.

* fix(cognitoidentity): reject a non-boolean AllowUnauthenticatedIdentities

Jackson coerced strings and numbers to a boolean instead of failing the request.
2026-09-04 12:16:18 -04:00
TATSUNO “Taz” Yasuhiro e5afe3518b fix(kms): apply real RSAES-OAEP for RSA keys in Encrypt and Decrypt (#3038)
* fix(kms): apply real RSAES-OAEP for RSA keys in Encrypt and Decrypt

Encrypt on an RSA key now produces raw RSA-OAEP ciphertext of the
modulus length. Decrypt accepts a ciphertext made locally with the
public key from GetPublicKey, so the normal envelope pattern works.
Encrypt, Decrypt, and ReEncrypt read the EncryptionAlgorithm request
fields and return them in responses.

Validate plaintext length between 1 and 4096 bytes on every encrypt
path. Turn a malformed blob payload into InvalidCiphertextException
instead of a 500. GenerateDataKey now names itself in key usage
errors and rejects non symmetric keys like real AWS.

Error codes and messages for algorithm mismatch, wrong key usage,
missing KeyId, encryption context on asymmetric keys, and oversized
plaintext were measured against real AWS KMS in us-east-1 and match.

Fixes #3024

* test(kms): rename a GenerateDataKey test to state the thrown exception
2026-09-04 11:21:25 -04:00
Kurt McAlpine 23728e0b75 feat(ecr): prefer locally present images over the loopback registry rewrite (#3022)
* feat(ecr): prefer locally present images over the loopback registry rewrite

EcrRegistryManager.rewriteImageUri rewrote every AWS-shaped
<account>.dkr.ecr.<region>.amazonaws.com/<repo>:<tag> URI to Floci's
loopback registry unconditionally, so a container image Lambda function
(or ECS task) whose image was built locally and tagged with its real ECR
URI could never run: the launcher started the registry:2 sidecar and
tried to pull from it, failing with "failed to resolve reference ..."
(Lambda.InitError) even though the daemon already held the image.

The rewrite now first asks the Docker daemon whether the image exists
under the URI as given; if it does, the URI is used unchanged and the
registry container is not started. Images the daemon does not have keep
the existing rewrite-and-pull path, so CDK DockerImageFunction flows are
unaffected. floci.services.ecr.prefer-local-images
(FLOCI_SERVICES_ECR_PREFER_LOCAL_IMAGES, default true) restores the old
behaviour when set to false.

Verified with a provided.al2023 Go image tagged
000000000000.dkr.ecr.ap-southeast-2.amazonaws.com/e2e/hello-image:local:
Invoke fails on 2.0.1 and succeeds with this change, both with Floci as
a host process and inside a container sharing the host's docker.sock; an
image absent from the daemon still takes the rewrite path.

* fix(ecr): inspect the image reference ContainerBuilder launches when preferring local images

With floci.docker.image-registry-base set, rewriteImageUri inspected the bare
AWS-shaped URI while ContainerBuilder later prefixed it, so a locally present
image was reported as found and then missed at launch. Resolve the image
through ContainerBuilder before asking the daemon so both paths agree.
2026-09-04 10:59:51 -04:00
Matheus André d398376642 fix(elasticache): implement parameter group reservation to prevent deletion during provisioning (#3023)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-04 10:51:05 -04:00
luiseterc 1f87f7c482 feat(ec2): implement instant CreateFleet (#2956)
* feat(ec2): implement instant CreateFleet

* fix(ec2): address CreateFleet review feedback

* fix(ec2): harden CreateFleet placement rollback

* test(ec2): isolate CreateFleet dry-run fixture

* fix(ec2): group CreateFleet response instances

* fix(ec2): report incomplete fleet rollback

* fix(ec2): resolve fleet placement from subnet overrides
2026-09-04 10:06:44 -04:00
Kurt McAlpineandkurtmc a7be2dd299 feat(neptune): support the Terraform aws_neptune_cluster read-back contract (#3017)
* feat(neptune): support the Terraform aws_neptune_cluster read-back contract

The Terraform AWS provider's aws_neptune_cluster resource reads back every
DBCluster field after create and update, and treats a mismatch on a ForceNew
attribute as a replacement. Against Floci the resource could not converge:
StorageEncrypted was hardcoded to true against the provider's default of
false, AvailabilityZones was emitted as a singular element that SDK parsers
drop, BackupRetentionPeriod and the other settings were never stored, and
tag calls on a Neptune ARN never reached the Neptune store.

CreateDBCluster and ModifyDBCluster now store the settings a request carries
(NeptuneClusterSettings, modelled on DocDbClusterSettings) and
DescribeDBClusters reads them back with the AWS defaults otherwise:
AvailabilityZones, BackupRetentionPeriod, PreferredBackupWindow,
PreferredMaintenanceWindow, DBSubnetGroup, DBClusterParameterGroup,
VpcSecurityGroups, StorageEncrypted, KmsKeyId, StorageType,
DeletionProtection, CopyTagsToSnapshot, EnabledCloudwatchLogsExports,
ReplicationSourceIdentifier, ServerlessV2ScalingConfiguration,
AssociatedRoles and ClusterCreateTime. StorageEncrypted defaults to false
as on AWS.

Also:
- A requested Port is honoured when it is free inside the proxy range, so
  Terraform's default port of 8182 matches the first cluster.
- DeleteDBCluster refuses a cluster with DeletionProtection enabled with
  InvalidParameterCombination, as on AWS.
- DBClusterMembers uses the DBClusterMember element the Neptune API model
  declares; the previous member element was dropped by SDK parsers.
- New actions: AddRoleToDBCluster, RemoveRoleFromDBCluster,
  DescribeGlobalClusters (empty list), ListTagsForResource,
  AddTagsToResource and RemoveTagsFromResource. Tags are accepted on
  CreateDBCluster and CreateDBInstance, and the rds credential scope routes
  a Neptune ARN ResourceName to the Neptune handler.

Verified against hashicorp/aws 6.62.0 with terraform apply, a clean
re-plan, an update covering retention, protection, log exports, security
groups, iam_roles and tags, a destroy blocked by deletion protection, and a
destroy after disabling it.

* test(compat): cover aws_neptune_cluster in the Terraform and Java SDK suites

Adds a dedicated Terraform fixture and bats test that applies an
aws_neptune_cluster, checks the read-back through terraform output and the
AWS CLI, checks tags through ListTagsForResource, and asserts a clean
re-plan. Extends the Java SDK NeptuneTest with tags, IAM roles, modify
settings, deletion protection and cluster members, so a real SDK parser
covers the new DBCluster fields.

* fix(neptune): infer the rds service for the DBCluster role actions

Unsigned Query requests resolve their service from the action name, and
AddRoleToDBCluster and RemoveRoleFromDBCluster were missing from the RDS
action set, so they fell through to the SQS default instead of reaching
the Neptune handler.

* feat(neptune): read back the settings Terraform's aws_neptune_cluster_instance manages

DescribeDBInstances omitted AutoMinorVersionUpgrade, PromotionTier,
PubliclyAccessible, the parameter and subnet groups and the windows,
ModifyDBInstance ignored them, StorageEncrypted was hardcoded to true,
and every cluster member was reported as the writer, so the provider
issued a ModifyDBInstance on every apply.

NeptuneInstanceSettings, modelled on NeptuneClusterSettings, stores what
a request carries and DescribeDBInstances reads it back with the AWS
defaults otherwise; StorageEncrypted, KmsKeyId and StorageType are the
cluster's. The first member of a cluster is its writer and deleting it
promotes the next. Covered by unit, integration and Java SDK tests and a
Terraform compat fixture with a writer and a reader instance.

---------

Co-authored-by: kurtmc <2661907+kurtmc@users.noreply.github.com>
2026-09-04 09:45:29 -04:00
lex00 0c33ef234b feat(ec2): Capacity Reservation CRUD (#2974)
* feat(ec2): Capacity Reservation CRUD

CreateCapacityReservation, DescribeCapacityReservations,
ModifyCapacityReservation and CancelCapacityReservation were
unimplemented, so any aws_ec2_capacity_reservation resource failed with
UnsupportedOperation. Wire shapes follow botocore's ec2/2016-11-15
service model: synchronous creation (active on the create response),
TagSpecification support on create, the documented Describe filters,
and cancel marks the record cancelled with zero available capacity
rather than deleting it, matching AWS's retain-but-cancel behaviour.

* fix(ec2): match the AWS required fields and filters for Capacity Reservations

InstancePlatform and InstanceCount are required and AvailabilityZone is optional, with AvailabilityZoneId accepted. A non-positive InstanceCount is rejected on create and modify. The describe filters drop capacity-reservation-id and add instance-match-criteria and end-date-type.
2026-09-04 09:40:15 -04:00
lex00 09801146b1 feat(autoscaling): warm pools, scheduled actions, traffic sources, and process suspension (#2973)
* feat(autoscaling): warm pools, scheduled actions, traffic sources, and process suspension

PutWarmPool/DescribeWarmPool/DeleteWarmPool, PutScheduledUpdateGroupAction/
DescribeScheduledActions/DeleteScheduledAction, AttachTrafficSources/
DetachTrafficSources/DescribeTrafficSources, and SuspendProcesses/
ResumeProcesses, parsed against botocore's autoscaling/2011-01-01 wire model.
Deleting a group also removes its scheduled actions and warm pool.

* fix(autoscaling): scope scheduled-action cleanup to the group's region

Deleting a group removed scheduled actions with the same group name in every region. PutScheduledUpdateGroupAction now rejects a malformed StartTime or EndTime with ValidationError instead of treating it as absent.
2026-09-04 09:30:25 -04:00
Niels Kootstra 7fdd145c0c fix(lambda): honor configured function architecture (#2994)
* fix(lambda): honor configured function architecture

* fix(lambda): isolate Docker images by platform

* fix(lambda): reject unsupported architectures early

* fix(lambda): require one function architecture

Note: pre-existing full-suite flakes in EC2, Kinesis Analytics, and RDS Data passed in isolated reruns.

* fix(lambda): preserve legacy architecture fallback

* fix(lambda): reject malformed architecture fields

* fix(lambda): reject invalid persisted architectures
2026-09-04 09:22:23 -04:00
Chiara Forresi ee24c77d02 feat(lakeformation): add UpdateResource action (#2944)
* feat(lakeformation): add UpdateResource action

* fix(lakeformation): validate resource updates safely

* fix(lakeformation): synchronize registerResource and pin the register/update race

* fix(lakeformation): publish UpdateResource atomically to concurrent readers

UpdateResource mutated the stored ResourceInfo field by field while
DescribeResource and ListResources read the same object reference without
synchronization, so a concurrent reader could observe a mixed state (e.g.
new role ARN with old federation value).

Apply copy-on-write: build a defensive copy, mutate the copy, then atomically
put it back. Readers now see either the old complete state or the new
complete state, never a partial one.

Add a regression test that races DescribeResource against UpdateResource and
asserts every observed snapshot is internally consistent.

* fix(lakeformation): remove em-dash
2026-09-04 09:14:52 -04:00
Chiara Forresi 96d16de998 feat(s3): add Intelligent-Tiering configuration CRUD (#2997)
* feat(s3): add Intelligent-Tiering configuration CRUD

Add AWS S3 Intelligent-Tiering configuration management through the
real REST XML subresource (?intelligent-tiering), mirroring the existing
metrics configuration pattern.

Operations:
- PutBucketIntelligentTieringConfiguration (PUT, 204)
- GetBucketIntelligentTieringConfiguration (GET by id)
- ListBucketIntelligentTieringConfigurations (GET without id)
- DeleteBucketIntelligentTieringConfiguration (DELETE, 204)

The parser validates Id, Status (Enabled/Disabled), optional Filter
(Prefix/Tag/And), and one or more Tiering entries (AccessTier + positive
Days), re-serializing through XmlBuilder/XmlParser/AwsNamespaces.S3 so
responses are built by floci rather than echoing the request body.
Malformed bodies return MalformedXML; missing configurations return
NoSuchConfiguration.

Configurations are stored on the Bucket model keyed by id (nullable map
for backward-compatible deserialization of older snapshots), persisted
through StorageFactory, and synchronized on the bucket monitor with the
same requireSameRecord guard as metrics to survive concurrent puts and
bucket delete/recreate races.

Tests:
- S3IntelligentTieringConfigurationTest: parser unit tests
- S3ServiceTest: service lifecycle, isolation, persistence, concurrency
- S3IntelligentTieringConfigurationIntegrationTest: REST integration
- compatibility-tests/sdk-test-awscli: AWS CLI bats coverage

* refactor(s3): rename METRICS_XML_DECLARATION to S3_XML_DECLARATION

The XML declaration constant is shared by both metrics and
intelligent-tiering configuration responses, so the name should reflect
its S3-wide scope rather than implying it is metrics-specific.

* fix(s3): enforce auth and validate Days overflow on intelligent-tiering

Address review feedback on PR #2997:

- PUT and DELETE ?intelligent-tiering now enforce S3 authorization via
  a new authorizeBucketWrite method, closing the bypass where mutations
  skipped the auth applied to reads.
- Days values above Integer.MAX_VALUE no longer throw NumberFormatException
  and return 500 InternalError; they are rejected as 400 MalformedXML.
- A PUT without a request body returns 400 MalformedXML instead of NPE/500.

Tests: unit coverage for Days overflow, integration coverage for empty body.

* fix(s3): enforce tier-specific Days range on intelligent-tiering

AWS enforces a tier-specific Days range for S3 Intelligent-Tiering:
- ARCHIVE_ACCESS: 90 to 730 days
- DEEP_ARCHIVE_ACCESS: 180 to 730 days

Out-of-range values now return InvalidArgument with ArgumentName and
ArgumentValue in the XML error body, matching the real S3 error shape.

Add unit and integration tests covering below-minimum, above-maximum,
boundary acceptance, and the full XML error response.

* refactor(s3): extract Days range constants in intelligent-tiering

Replace repeated magic numbers (90, 180, 730) with named constants
ARCHIVE_ACCESS_MIN_DAYS, DEEP_ARCHIVE_ACCESS_MIN_DAYS, and MAX_DAYS.
Pass min into daysOutOfRange instead of recomputing it, and use an
import for LinkedHashMap.
2026-09-04 09:06:15 -04:00
Mario Toffia 3600038a3f fix(ssm): set the Arn attribute on AWS::SSM::Parameter (#3019)
The registry schema lists Arn as the type's only read-only property,
but the provisioner never set it, so Fn::GetAtt [Param, Arn] resolved
to the literal "Param.Arn" and CfnSchemaCoverageTest fails on main
once the schema corpus is present.

The ARN uses AWS's parameter/<name> form: a name without a leading
slash gets one inserted, a name with one is not doubled.
2026-09-04 01:09:19 -05:00
Mario Toffia 9220c057b7 feat(iot): domain configurations (#3008)
* feat(iot): add the domain configuration model and service

Stores AWS IoT Core domain configurations the way the API reports them:
a new configuration is ENABLED and CUSTOMER_MANAGED (ENDPOINT without a
domain name), carries one VALID server certificate, the default TLS
policy and an ARN with the short id AWS appends. Update changes the
status, authorizer, TLS, certificate and protocol settings; delete
refuses an ENABLED configuration, as AWS does; list filters by service
type and pages with marker and pageSize. Tags work on the ARN.

* feat(iot): serve the domain configuration API

Adds the REST-JSON routes CreateDomainConfiguration,
DescribeDomainConfiguration, UpdateDomainConfiguration,
DeleteDomainConfiguration and ListDomainConfigurations under
/domainConfigurations, registered with the IoT service so the
X-Amzn-Errortype header is set for unsigned callers too. Tags on a
configuration ARN go through IotTagHandler; the IoT /untag route now
uses the same handler as /tags instead of calling IotService directly.
DescribeEndpoint accepts iot:CredentialProvider, the endpoint type
that pairs with the CREDENTIAL_PROVIDER service type.

* feat(iot): provision AWS::IoT::DomainConfiguration

Adds IotDomainConfigurationCfnProvisioner over the domain configuration
service. Ref is the configuration name; Fn::GetAtt Arn, DomainType and
ServerCertificates resolve to what DescribeDomainConfiguration reports
(ServerCertificates as a JSON string, since attributes are strings).

Like the CloudFormation handler, a configuration is created ENABLED and
a DomainConfigurationStatus of DISABLED is applied with a follow-up
update; tags go through TagResource and are reconciled on update; a
delete disables the configuration first because the API refuses to
delete an ENABLED one. UpdateStack keeps the configuration when the
createOnly properties (DomainName, ServiceType, ValidationCertificateArn,
ServerCertificateArns) are unchanged and replaces it otherwise, with a
fresh generated name when the template names none.

Inventory TSV, fixture wiring and the generated resource-type table
updated.

* docs(iot): describe domain configurations and add the stack integration test

IotDomainConfigurationCfnIntegrationTest provisions the type through a
stack and asserts Ref and every Fn::GetAtt attribute against
DescribeDomainConfiguration, the in-place status update, and that
DeleteStack removes the configuration.

* test(iot): cover domain configurations in the Java and Go SDK suites

Both cases create, describe, list, update and delete a configuration
through the real SDK clients and check the AWS error types on the
duplicate create, the refused delete of an ENABLED configuration and
the describe after deletion.

* fix(iot): remove a renamed domain configuration and keep the status when the template omits it

A template that changes DomainConfigurationName creates the new
configuration and now removes the previous one, as the generated-name
replacement already did; before, the old configuration outlived the
stack. An update without DomainConfigurationStatus no longer forces
ENABLED: the field is omitted and the current status stays, as the AWS
handler does.

The service rejects a structured JSON value where a string, boolean,
list or object is expected instead of turning it into an empty string
or silently clearing the authorizer, and validates the whole update
before touching the stored record.

* fix(iot): let stack rollback remove a domain configuration and make same-name creates atomic

A configuration created by a stack is recorded, with the owned marker,
before the follow-up status update, so a failure there still lets the
create rollback delete it. A replacement that fails after the new
configuration exists removes it again, re-enables the previous one if
it had been disabled on the way out, and marks the resource restored,
as the other provisioners do.

CreateDomainConfiguration checks and stores the name in one step, so
two overlapping creates of the same name cannot both succeed. A tags
value that is not a list is rejected. The Java SDK compatibility case
looks for a leftover configuration instead of swallowing every cleanup
exception.

* fix(iot): point the resource back at the prior domain configuration after a failed replacement

After the unwind removes the replacement and re-enables the previous
configuration, the resource now carries the previous name and
attributes again, without the owned marker, so it describes the
configuration that is still there rather than the one just removed.

* feat(iot): serve the AWS-managed domain configurations

Every AWS account has iot:Data-ATS, iot:Data, iot:CredentialProvider
and iot:Jobs without creating them. They now exist in every region on
first use: AWS_MANAGED, ENABLED, no server certificate, and the address
DescribeEndpoint returns as their domain name. They can be updated and
tagged like any other configuration, but not deleted, as on AWS. A
client that starts by describing iot:Data-ATS gets an answer instead of
a 404.

* fix(iot): report a failed replacement cleanup as a rollback failure

When the unwind of a failed replacement cannot remove the new domain
configuration, the resource now carries the rollback-failure marker
with the reason, so the stack ends in UPDATE_ROLLBACK_FAILED instead of
reporting a clean rollback while the configuration is still there. The
marker moves next to the restored one in CfnRollback so extracted
provisioners can set it; the legacy provisioner keeps its alias.

* fix(iot): serialise every read-modify-write on a domain configuration

Update, delete, tag and untag read a record, change it and write it
back. Two overlapping writers lost each other's changes: sixteen tag
writers on one configuration left seven keys. All of them now run under
the lock the create already used, and a test pins the invariant. A JSON
round trip with the mapper setup persistent storage uses pins that the
model reloads intact.

* fix(iot): keep the prior status the unwind compares against and never delete a same-name replacement

The store hands out its live record, so disabling the prior on the way
to deleting it changed the very object the unwind later compared
against, and a prior whose delete failed half way was left DISABLED
while the stack reported a clean rollback. The status seen at the start
is now kept and used. The test reproduces the aliasing instead of
handing the provisioner a fresh copy per call.

A replacement under the same explicit name normally fails on the
create; if it goes through because the prior vanished in between, the
prior is no longer deleted, which would have removed the configuration
just created.

* fix(iot): tolerate a domain configuration that vanishes while a stack delete disables it

The disable that precedes the delete now treats ResourceNotFoundException
as already deleted, the way the delete itself does. The SDK cases also
enable an already ENABLED configuration, the call a client makes when
it only wants to be sure the configuration is on.
2026-09-04 01:05:21 -05:00
Mario Toffia f3c251ef20 feat(cognito): provision AWS::Cognito::UserPoolDomain (#3005)
* feat(cognito): provision AWS::Cognito::UserPoolDomain

The type was a stub: the stack turned green, but Fn::GetAtt
CloudFrontDistribution resolved to the literal
LogicalId.CloudFrontDistribution, so a Route 53 alias record for a
custom domain pointed at that text.

CognitoCfnProvisioner creates the domain through the existing
CreateUserPoolDomain. Ref is the domain name and CloudFrontDistribution
is the CloudFront name DescribeUserPoolDomain reports. A changed Domain
or UserPoolId replaces the domain; any other change is applied in place
through the new UpdateUserPoolDomain operation, so the distribution a
DNS alias points at survives a certificate change, as on AWS. Delete
uses the pool id recorded at create time and tolerates an already
deleted domain.

UpdateUserPoolDomain is also exposed on the Cognito API, with the same
response shape as CreateUserPoolDomain.

* feat(cognito): treat null domain settings as absent and pin the same-name replacement failure

Review follow-ups for AWS::Cognito::UserPoolDomain:

- A JSON null inside CustomDomainConfig was copied as the text "null",
  which would have passed for a certificate ARN. Null values are now
  skipped, so the service rejects the missing ARN as it should.
- ManagedLoginVersion on CreateUserPoolDomain and UpdateUserPoolDomain
  treated an explicit null as 0, overwriting the stored version. Null
  now counts as omitted, and a value of another JSON type is a
  SerializationException, as on AWS.
- Moving an unchanged domain to another pool fails on the create,
  because domain names are unique across pools and the replacement is
  created before the original is deleted, exactly as on AWS. The unit
  test that mocked this path as a success is replaced by one that pins
  the failure and checks the original domain is left in place.

* test(cognito): cover domain replacement, prefix domains and SecurityPolicy updates

The stack test now also renames the domain through UpdateStack, asserting the old domain is gone and the new one has its own distribution, and a second stack proves a prefix domain resolves Fn::GetAtt CloudFrontDistribution to an empty string rather than the literal attribute name. The service test covers a SecurityPolicy change and that an omitted policy is kept. The in-place check reads ctx.reusesPriorEntity(domain), as the sibling provisioners do.

* test(cognito): provision the stack test's certificate through AWS::CertificateManager::Certificate

With the ACM provisioner merged, the stack test now declares the certificate as a resource and references it with Fn::GetAtt, the way CDK does. Rotating to a new certificate resource updates the domain in place and removes the old certificate once nothing references it. A wildcard name keeps a domain rename from replacing the certificate.
2026-09-04 00:55:19 -05:00
Mario Toffia 38176b9e05 feat(acm): provision AWS::CertificateManager::Certificate (#3003)
* feat(acm): provision AWS::CertificateManager::Certificate

Adds AcmCfnProvisioner over the existing AcmService. Ref and
Fn::GetAtt CertificateArn both resolve to the certificate ARN instead
of the stub's literal "LogicalId.CertificateArn". Maps DomainName,
SubjectAlternativeNames, ValidationMethod (default DNS), KeyAlgorithm
and Tags; DomainValidationOptions is accepted and ignored because the
certificate is ISSUED at once, there is nothing to validate locally.

UpdateStack: a change to a createOnly property (DomainName,
SubjectAlternativeNames, KeyAlgorithm) requests a new certificate and
deletes the previous one; otherwise tags are reconciled in place.
Delete tolerates an already removed certificate and lets
ResourceInUseException propagate.

Tests: AcmCfnProvisionerTest (attribute keys, update paths, delete),
AcmCfnIntegrationTest (stack output is an ARN DescribeCertificate
finds, gone after DeleteStack). Inventory TSV, fixture wiring and the
generated resource-type table updated.

* fix(acm): remove the replacement certificate when the prior one cannot be deleted

On a replacing update, a failure deleting the previous certificate
(ResourceInUseException, for one) made the update fail after the new
certificate existed. CloudFormationService restores the previous
StackResource on a failed update and never learns the new ARN, which
orphaned that certificate. Delete it and mark the resource restored
for the rollback walker, as Route53CfnProvisioner does for zones.

Also pins that a ValidationMethod-only update keeps the certificate:
the property is writeOnly in the registry schema and "No interruption"
in the AWS docs, and ACM has no call to change it on an issued
certificate.
2026-09-03 23:46:03 -04:00
Matheus Oliveira 06349c8d88 fix(apigateway): enforce AWS_IAM authorization on the execute-api data plane (#2895)
A method (REST) or route (HTTP API) with authorizationType AWS_IAM was
recorded but never enforced, so an unsigned request reached the integration as
if it were NONE. ExecuteApiSigV4Authorizer now verifies the caller's signature
over the request as it arrived, for both the Authorization header and the
presigned query string, and surfaces the verified caller on the proxy event:
requestContext.identity on REST, requestContext.authorizer.iam on HTTP API.
The signature must cover host, and expired or inactive credentials are
rejected.

Temporary credentials must also present the session token STS issued with
them, compared against the value the session store records since #2912.

Authentication only: execute-api:Invoke is not evaluated against IAM policies.

Closes #2810

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-03 22:23:44 -04:00
Matheus André 6c9cc95d54 feat(elasticache): add validation for cache parameter group existence in replication group operations (#2957)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-03 17:24:34 -04:00
Matheus André df0e7bc79c feat(route53): update supported operations and add VPC association actions (#2959) 2026-09-03 17:15:41 -04:00
Kurt McAlpine ad0f4a1613 fix(sqs): honour ReceiveMessageWaitTimeSeconds when ReceiveMessage omits WaitTimeSeconds (#2989)
* fix(sqs): honour ReceiveMessageWaitTimeSeconds when ReceiveMessage omits WaitTimeSeconds

ReceiveMessage treated a missing WaitTimeSeconds as 0 and returned
immediately, ignoring the queue's ReceiveMessageWaitTimeSeconds
attribute. AWS applies that attribute as the default wait, and only an
explicit WaitTimeSeconds in the request overrides it, so consumers that
enable long polling on the queue were short polling against Floci.

Both protocol handlers now pass -1 when the parameter is absent, and the
service resolves the wait from the queue attribute, mirroring the
existing VisibilityTimeout fallback. CreateQueue stores the AWS default
of 0 so GetQueueAttributes reports the attribute like AWS does.

* fix(sqs): reject ReceiveMessage WaitTimeSeconds outside 0 to 20

An explicit negative or non-integer WaitTimeSeconds was parsed to the
"omitted" sentinel and inherited the queue's long poll instead of
failing. Carry the parameter as a nullable Integer, reject malformed
values at the protocol boundary and out-of-range values in the service
with InvalidParameterValue, and cap the queue attribute fallback at the
AWS maximum of 20 seconds.

* fix(sqs): reject fractional WaitTimeSeconds on the SQS JSON protocol

canConvertToInt() accepts fractional JSON numbers such as 1.5, which
asInt() then truncated before the range check, so a malformed request
ran as a one second poll instead of failing with InvalidParameterValue.

Signed-off-by: Kurt McAlpine <kurt.mcalpine@halter.co.nz>

---------

Signed-off-by: Kurt McAlpine <kurt.mcalpine@halter.co.nz>
2026-09-03 11:29:36 -04:00
Simone Primarosa 732e009207 fix(ecr): clean up registry storage (#2982)
Remove every manifest for a forced repository deletion and reclaim the shared registry volume only when storage pruning is configured.
2026-09-03 08:14:56 -04:00
Priamo Germosen 2b531dad3a docs(lambda): qualify which kubeconfig auth methods the Kubernetes executor supports (#2978)
#2919 replaced the Fabric8 Kubernetes client with a plain REST client that
only understands static-token and client-certificate kubeconfig auth. The
Kubernetes executor section still said Floci "uses your local kubeconfig"
without qualification, which reads as full kubectl parity. exec and
auth-provider credential plugins (aws eks get-token, gcloud) fail with a
named error instead, so an EKS or GKE user following the doc as-is would
be surprised.

Follow-up noted on hectorvent's approval of #2919.
2026-09-02 23:17:06 -05:00
Brian Taylor 906717a510 feat(cognito): implement SetUserPoolMfaConfig (#2831)
* feat(cognito): implement SetUserPoolMfaConfig

The action was unrouted, so the dispatcher answered UnsupportedOperation
and any caller configuring pool MFA failed. GetUserPoolMfaConfig already
existed but reported only MfaConfiguration, so a software-token setting
could not round-trip even once it could be set.

SetUserPoolMfaConfig now stores the MFA mode and the software-token
setting, and both actions answer with the shape measured on the live
service: only configured factors appear, so SoftwareTokenMfaConfiguration
is omitted until it is set.

SMS, email and WebAuthn MFA are accepted and deliberately not stored —
Floci has no path to deliver those factors, and retaining the config
would claim a capability that does not exist.

* test(cognito): cover MFA configuration through the AWS SDK

The integration test drives the endpoint over raw HTTP, so nothing
exercised the new action through a real SDK client. Adds coverage for
the three cases that matter to a caller: an unconfigured pool reports
OFF with no software-token member, a set round-trips through Get, and an
invalid MfaConfiguration is rejected.

* fix(cognito): follow the measured SetUserPoolMfaConfig semantics

Three behaviours were taken from the API reference and turned out wrong
when measured against the live service:

  - an absent MfaConfiguration means OFF, not "leave the current mode
    alone", so a pool set to OPTIONAL is reset by a request that omits it
  - turning MFA off drops the factor configuration with it; the service
    answers OFF alone afterwards
  - sending a factor while the effective mode is OFF is rejected with
    "can't turn off MFA and configure an MFA together"

The enum in the validation message is also ordered [OPTIONAL, OFF, ON],
as the service emits it. Two tests asserted the previous guesses and
passed, which is how a guess becomes apparent evidence; both now pin the
measured behaviour.

* fix(cognito): apply the MFA factor rules to email and SMS, not just the software token

Review flagged that a request combining an effective OFF mode with
EmailMfaConfiguration or SmsMfaConfiguration was accepted, since only
SoftwareTokenMfaConfiguration was read. Measured against the live
service, and the finding holds for email and SMS but not for WebAuthn:

  - OFF + EmailMfaConfiguration is rejected with the same message as
    OFF + SoftwareTokenMfaConfiguration
  - OFF + WebAuthnConfiguration returns 200 and echoes the block back
  - the rule fires on the member being present, not on Enabled: OFF
    alongside SoftwareTokenMfaConfiguration{Enabled:false} is rejected

The same pass turned up the mirror rule, which was also missing: ON or
OPTIONAL with none of the three factors present is rejected with
"SMS MFA, Email MFA, or Software Token MFA must be enabled". Despite
that wording it is again presence, not value - ON alongside
SoftwareTokenMfaConfiguration{Enabled:false} is accepted - and WebAuthn
does not satisfy it, so it sits outside both rules in both directions.

One existing test set ON with no factor at all, which the live service
refuses; it now sends a factor.

* test(cognito): read the MFA config tests in their execution order

The methods were laid out 1, 2, 3, 4, 5, 8, 6, 10, 7, 9, 11, 12, 13, an
artifact of adding cases across three review rounds. The chain is stateful,
so a reader following the pool through it had to jump around the file.

Pure move: the methods are reordered to match their @Order values, no
annotation value and no test body is changed, so the execution order is
exactly what it was.

* chore(cognito): drop the em-dashes this branch introduced

AGENTS.md asks for none in any content. Seven had leaked into the MFA
prose: the docs table row, two service comments, the handler javadoc and
two in the test class. Replaced with colons and commas, no wording change
beyond the punctuation.

Pre-existing em-dashes elsewhere in these files are left alone.

* revert: "chore(cognito): drop the em-dashes this branch introduced"

This reverts commit d7a0ad10. The rule it cited does not exist: AGENTS.md
says nothing about em-dashes, and the repo uses them throughout, including
in CONTRIBUTING.md's own commit-type table and in the pull request template.
I asserted a house style that is not the house style, so the prose goes back
to how it read when you reviewed it.

Nothing in this PR's behaviour was affected either way. The @Order fix in
63086a30 is unrelated and stands.

* chore(cognito): drop the em-dashes this branch introduced

Reinstates d7a0ad10, which b4a283e3 reverted in error.

The rule is real: AGENTS.md line 333, under Documentation Style, "No
em-dashes anywhere, in any content. Use colons, commas, or periods." I
grepped this branch's copy of AGENTS.md rather than origin/main and found
nothing, so I concluded it did not exist. It was added in 10a70ba1 on
31 Aug, after this branch's merge base at b0fe8311, which is why the
branch's copy predates it.

Seven occurrences on six lines: the docs table row, two comments in
CognitoService, the handler javadoc and two in the test class. Punctuation
only, no wording change. Pre-existing em-dashes elsewhere in these files
are left alone, since the rule is about content this branch adds.
2026-09-03 00:16:01 -04:00
Aniket Shukla c30ca8fb5f fix(cognito): name missing user pools in errors (#2936)
* fix(cognito): name missing user pools in errors

* test(cognito): address missing pool review
2026-09-03 00:12:14 -04:00
Vũ Thế Huy 14ca62d9f7 feat(ecs): honor UpdateService forceNewDeployment and emit EventBridge lifecycle events (#2938)
* feat(ecs): honor UpdateService forceNewDeployment (#2557)

* feat(ecs): add EcsEventPublisher for aws.ecs lifecycle events (#2557)

* feat(ecs): emit ECS Task State Change events on task start/stop (#2557)

* feat(ecs): emit ECS Deployment State Change events (#2557)

* test(ecs): end-to-end ECS EventBridge lifecycle events + docs (#2557)

* fix(ecs): log diagnostic when task ARN region parse fails (#2557)

* fix(ecs): synthesize lifecycle events from a task snapshot, not the shared instance

emitTaskLadder toggled the live task's lastStatus in place to synthesize
each phase, so a concurrent DescribeTasks/ListTasks could observe a
status the task never actually occupied while the four-phase ladder
was in flight. Build the ladder from a shallow copy instead.

Also bump the ARN region-parse fallback log from debug to warn, since
debug is off by default and made the fallback effectively invisible.
2026-09-02 23:09:37 -04:00
Kenshin Okinaka 812911fd03 feat(ses): support tag operations on tenant ARNs (#2832)
* feat(ses): support tag operations on tenant ARNs

* fix(ses): shield the stored tenant record from tag-callback mutation

* test(ses): cover the cross-region guard for tenant TagResource/UntagResource

* docs(ses): drop em dashes from the tenant tag additions
2026-09-02 22:14:39 -04:00
Hector Ventura eb0472fccc docs: fix stale image tags, release model, service nav and contributor checklists (#2980)
The getting-started and contributor docs had drifted from what the workflows and the
code actually do:

- quick-start and CONTRIBUTING pointed users at a `latest-jvm` image that the release
  pipeline never publishes; both now name the `-compat` image, and `make docs-check`
  greps the docs for any `-jvm` tag
- the CONTRIBUTING branching model now matches the workflows: `main` is published as
  the nightly channel, a maintainer runs the Release Cut workflow to tag a release, and
  the tag triggers the publish; PR builds produce compat images but never publish them
- README and the docs landing page carried a hand-maintained service count and a
  second copy of the service table, both stale; they now link to the Services Overview
- the Service Matrix gains the ELB Classic row it was missing, with an `elb` alias so
  the check no longer resolves the Classic key to the v2 page, and
  check_service_matrix.py now also fails on a docs/services page that has no row
- the README category table lists 16 documented services it omitted
- mkdocs nav gains 11 service pages that were unreachable from the site, drops a
  duplicate CloudTrail entry, and the docs job now runs `mkdocs build --strict` with nav
  and link validation so a page without a nav entry fails CI
- AGENTS.md, CONTRIBUTING.md and docs/contributing.md told contributors to register a
  service in ServiceRegistry, which has no registration API; all three now point at
  ResolvedServiceCatalog and list the config, storage, native-image, docs, tooling and
  compat-suite touchpoints a new service needs
2026-09-02 22:10:46 -04:00
Facundo Paredes 5dc0808bda feat(cloudformation): report a stubbed unsupported resource type instead of hiding it (#2971)
An unsupported resource type was stubbed at debug, so the stack reached CREATE_COMPLETE and a green stack did not prove its resources existed.

The stub is now reported at warn, naming the type, and the resource carries a status reason saying nothing was created, which DescribeStackEvents returns. A new floci.services.cloudformation.allow-stub-unsupported-resource-types setting (default true) turns the stub into a stack failure for suites that need a green stack to mean every resource exists. An unexpanded SAM resource type warns on its own, and the delete path names the physical id it does not remove.

Closes #2967
2026-09-02 20:22:49 -05:00
Scott Steen 44655751c6 feat(bedrock-runtime): implement ConverseStream for stub and proxy backends (#2889)
Both backends now emit the real application/vnd.amazon.eventstream framing
Bedrock SDK clients expect: a messageStart/contentBlockDelta/contentBlockStop/
messageStop/metadata event sequence, framed with the same AwsEventStreamEncoder
helper already used by S3 Select and Kinesis SubscribeToShard.

The proxy backend posts to /chat/completions with stream:true (matching
Converse) and translates the OpenAI SSE response into Bedrock stream events,
including basic tool-call accumulation. A response - streaming or not - that
never produces real completion content surfaces as a ModelErrorException
instead of a fabricated empty success:

- ConverseStream: no usable SSE chunks, chunks that only carry role/usage/
  finish_reason with no text or tool_calls, a stream that ends without a
  finish_reason or "[DONE]" (truncated mid-generation), or a tool_calls
  fragment missing its id/name or with arguments that never form valid JSON.
- Converse: a 2xx response with no choices at all.
2026-09-02 19:55:40 -05:00
Sam Fakhreddine 279f2776b7 docs: fix port ranges, OpenSearch default image and quick-start snippets (#2690)
Corrects the documented port ranges, the OpenSearch default image tag, the quick-start snippets and a duplicate CloudTrail nav entry so the docs match application.yml and EmulatorConfig.
2026-09-02 19:19:38 -05:00
Simone Primarosa 309043baf6 fix(eks): validate IAM authentication tokens (#2912)
Reject forged, expired, and cross-cluster EKS authentication tokens before granting cluster-admin access.
2026-09-02 19:37:26 -04:00
Priamo Germosen 671628b525 feat(cloudtrail): implement AddTags, RemoveTags and ListTags (#2934)
* feat(cloudtrail): implement AddTags, RemoveTags and ListTags

CloudTrailJsonHandler dispatched none of the three tag actions, so any
trail lookup went through the unsupported-action path — including the
Terraform AWS provider's transparent-tagging ListTags call on every read
of aws_cloudtrail, which broke refresh/plan/destroy for any state
containing a trail regardless of whether it was tagged.

Tags are tracked per-trail in CloudTrailEntry (not the wire-serialized
Trail record, which AWS never includes tags on) and are resolved by ARN
only, matching AWS's actual request shape for these three actions. An
ARN that isn't a well-formed CloudTrail trail ARN raises
CloudTrailARNInvalidException; a well-formed ARN with no matching trail
raises ResourceNotFoundException, so a stale Terraform state entry
surfaces as a real error instead of an empty tag list.

Fixes floci-io/floci#2297

* fix(cloudtrail): omit Value from ListTags response for valueless tags

AddTags only requires Key, so a tag can legitimately have no Value.
listTags() was serializing that as an explicit "Value":null, but AWS
omits absent optionals from the response entirely.
2026-09-02 17:29:03 -05:00
Christian Franzen 39b19d1c92 refactor(config): move max-request-size and ecr-base-uri into sub-mappings (#2902)
floci.max-request-size and floci.ecr-base-uri sat at the config root but
belong with related settings. Relocate them:

- max-request-size -> floci.protocols.max-request-size (ProtocolsConfig)
- ecr-base-uri      -> floci.services.lambda.ecr-base-uri (LambdaServiceConfig)

A new FlociConfigRelocationsInterceptor (SmallRye ConfigSourceInterceptor,
registered via META-INF/services) keeps the old flat keys and their
FLOCI_MAX_REQUEST_SIZE / FLOCI_ECR_BASE_URI env vars working: the legacy key
is consulted when the new key is requested, and iterateNames() rewrites it so
config-mapping validation does not flag it as unknown. Future relocations are
one entry in its RELOCATIONS list.

ImageResolver, both application.yml files, the affected tests and the
configuration docs are updated to the new keys.
2026-09-02 18:14:55 -04:00
Brian Taylor 0a3bc030f6 feat(cognito): implement identity provider configuration CRUD (#2858)
* feat(cognito): implement identity provider configuration CRUD

CreateIdentityProvider, DescribeIdentityProvider, ListIdentityProviders,
UpdateIdentityProvider and DeleteIdentityProvider were unsupported, so
infrastructure tooling could not manage a user pool's federated providers.

Stores provider configuration alongside the other user pool sub-resources and
matches the response and update semantics measured against the live API:

- IdpIdentifiers is echoed by create and update only when the request supplied
  the member, whatever the stored value; describe always returns it
- AttributeMapping defaults to username -> sub when the member is absent at
  create, while an explicitly empty map is stored as given
- members a request omits are preserved rather than cleared
- a duplicate provider name raises DuplicateProviderException
- ListIdentityProviders returns name/type/date summaries, never ProviderDetails

Federated sign-in itself is out of scope: Floci has no /oauth2/authorize or
/oauth2/idpresponse endpoint, so providers are stored configuration only.

* test(cognito): match identity provider exceptions on the SDK error name

`rejects.toThrow(/re/)` matches the error message, but the JS SDK maps the wire
`__type` onto `error.name` and puts the AWS text in `message`, so the duplicate
provider assertion never matched. Assert the name, and pin the enum text with
an explicit message matcher.

* fix(cognito): delete a pool's identity providers with the pool, and update a copy

Two review findings, both reproduced first.

DeleteUserPool left provider records behind. A pool recreated on a pinned id
(`floci:override-id`) then inherited the dead pool's providers, ProviderDetails
client_secret included. Pool deletion now removes them the way it already
removes groups.

UpdateIdentityProvider mutated the instance the store handed back, so two
concurrent updates could interleave into a state matching neither request. It
now writes a copy, which makes the losing update simply lose — what AWS does.

* fix(cognito): serialise identity provider mutations

UpdateIdentityProvider is a read-modify-write: it copies the stored provider,
applies only the members the request supplied and writes the whole record back.
Two overlapping updates copied the same base, so the later write restored the
other's omitted members to their stale values and silently dropped an update.

Live Cognito merges omitted members rather than clearing them, and applies that
merge atomically, so both updates survive there. One lock now guards every
mutating path, since create (check-then-put) and delete (check-then-act) carry
the same race, matching the existing identityLinkLock idiom.

The regression test runs two writers touching different optional members across
25 rounds; it fails on the first round with the lock reverted.

* fix(cognito): guard the pool deletion provider cascade with the same lock

DeleteUserPool clears a pool's identity providers outside identityProviderLock,
so a create or update interleaving with the cascade could reinstate a provider
for a pool that is going away. It now takes the same lock as the mutations it
races, closing the last unguarded path in that set.

* fix(cognito): recheck the pool under the lock when creating a provider

CreateIdentityProvider validated the pool before taking identityProviderLock and
never rechecked it, so a DeleteUserPool whose cascade ran in between left the
create writing a provider for a pool that no longer exists. It now reasserts the
pool inside the lock, immediately before the duplicate check and the write.

UpdateIdentityProvider needs no equivalent: the cascade deletes the provider, so
its own lookup throws ResourceNotFoundException. The outer validation stays where
it is to keep error ordering unchanged for ordinary single-request calls.
2026-09-02 12:00:26 -04:00
Brian Taylor 1e4e8b9ee8 feat(cognito): implement managed login branding (#2869)
* feat(cognito): implement managed login branding

CreateManagedLoginBranding, DescribeManagedLoginBranding,
DescribeManagedLoginBrandingByClient, UpdateManagedLoginBranding and
DeleteManagedLoginBranding were unsupported, so a config declaring
`aws_cognito_managed_login_branding` could not be applied against Floci.

A branding belongs to one app client and is stored on it. Behaviour matches what
the live API does:

- a second branding for the same client raises ManagedLoginBrandingExistsException
- ManagedLoginBrandingId must be a version 4 UUID, checked before the lookup
- Settings is omitted from the response when the caller supplied none, while
  Assets is always returned
- members an update omits are left unchanged

Settings is stored opaquely rather than validated against AWS's unpublished
schema, and ReturnMergedResources does not merge Cognito's default corpus.

Closes #2856

* fix(cognito): reject malformed CreateManagedLoginBranding members

Create coerced an absent UseCognitoProvidedValues to false and silently ignored a
wrongly typed Settings or Assets, so a malformed request produced persisted state.

Measured against AWS:

  neither UseCognitoProvidedValues nor Settings -> InvalidParameterException:
      useCognitoProvidedValues or settings should be specified (but not both)
  Assets of the wrong type   -> SerializationException: Unexpected field type
  UseCognitoProvidedValues of the wrong type -> accepted, not rejected

Create now enforces the first rule and type-checks Settings and Assets. A
non-boolean UseCognitoProvidedValues is still accepted, because AWS accepts it.

AWS answers a wrongly typed Settings with a 500 InternalErrorException; Floci
returns the same client error it returns for Assets rather than reproducing that,
and the divergence is documented.

* fix(cognito): check Assets elements before converting them

The Assets reader validated only the outer array, so a scalar element reached
Jackson's convertValue and escaped as a 500 InternalFailure. This is the same
class of bug as the LogConfigurations one, which I fixed in that reader without
applying it here.

AWS separates the two failures, and they differ from the LogConfigurations rules:

  [1, 2] / ["str"] -> SerializationException: Unexpected value type in payload
  [null]           -> InvalidParameterException: 1 validation error detected:
                      Value '[null]' at 'assets' failed to satisfy constraint:
                      Member must satisfy constraint: [Member must not be null]

A null element is rejected here, where LogConfigurations drops it.

* fix(cognito): match AWS branding source validation

A managed login branding request must select exactly one source of branding,
and the same rule governs create and update. Measured against Cognito in
ap-southeast-1:

  useCognitoProvidedValues  settings   result
  absent                    absent     InvalidParameterException
  true                      absent     accepted
  false                     absent     InvalidParameterException
  absent                    present    accepted
  true                      present    InvalidParameterException
  false                     present    accepted

Create rejected only the neither case, update validated nothing at all, so
naming both members and updating with no source both succeeded where the
service rejects them. Presence of the member is not the test: false selects no
source, which is why it needs settings alongside it.

Reading the flag had to move with it. AWS coerces a JSON string rather than
rejecting it, storing true for "true" and for "yes" and false for "false",
while Jackson maps every string except "true" to false. That turned "yes" into
a request selecting no source, so the coercion now follows the service.

* fix(cognito): reject malformed UseCognitoProvidedValues types

Jackson's asBoolean() maps a number, a JSON null, an object and an array all to
false, so a malformed flag alongside valid Settings passed source validation and
persisted as branding state that was never requested.

Measured against Cognito in ap-southeast-1: 1, null, {} and [] are each a
SerializationException, with or without Settings, while omitting the member is
accepted and stores false. Only booleans and strings are read now, strings still
coerced the way the service coerces them, and everything else raises
SerializationException the way SesController already does.

* fix(cognito): bound managed login branding assets at 40

Neither create nor update checked the documented 40-item maximum on Assets, so
an oversized request was accepted and stored where AWS rejects it.

Measured against Cognito in ap-southeast-1:

  create 40 assets            passes the bound, reaches the source rule
  create 41 assets            InvalidParameterException, length constraint
  create 41 + unknown client  the length error, not the missing client
  update 41 + malformed id    2 validation errors, the length one first
  update malformed id alone   1 validation error, before the pool lookup

The asset and branding-id checks now run before anything is looked up and
share one message, matching those last three rows. DescribeManagedLoginBranding
ran its pool lookup ahead of the branding-id check, which the fourth row shows
is the wrong way round, so it moved with them.

The length message embeds the request model's toString. The blob renders as the
decoded buffer, confirmed at three payload sizes; the decoder used here is the
lenient one so that building a rejection cannot itself fail.
2026-09-02 11:50:47 -04:00
Brian Taylor b8f1e22c74 feat(cognito): implement log delivery configuration (#2867)
* feat(cognito): implement log delivery configuration

SetLogDeliveryConfiguration and GetLogDeliveryConfiguration were unsupported, so a
config declaring `aws_cognito_log_delivery_configuration` could not be applied
against Floci.

The configuration is stored on the user pool and validated the way the live API
validates it:

- LogLevel accepts ERROR or INFO, EventSource accepts userNotification or
  userAuthEvents, both reported with AWS's 1-based member path
- every entry must name a CloudWatch, Firehose or S3 destination
- Set replaces the list rather than merging, so an empty list clears it
- Get always returns LogConfigurations, as [] when nothing is configured

Floci stores the configuration and delivers nothing: the destination is neither
written to nor required to exist, and the pricing-tier gate AWS applies to
userAuthEvents is not reproduced.

Closes #2855

* fix(cognito): reject a null LogConfigurations instead of clearing the configuration

SetLogDeliveryConfiguration treated an omitted, null or wrongly typed
LogConfigurations as an empty replacement, so a malformed request returned 200
and erased the pool's stored configuration.

AWS rejects all three. An omitted or null member fails validation, and a value of
the wrong JSON type fails deserialization:

  omitted / null -> InvalidParameterException: 1 validation error detected: Value
                    null at 'logConfigurations' failed to satisfy constraint:
                    Member must not be null
  wrong type     -> SerializationException: Expected list or null

Also drops two em-dashes from the docs, per AGENTS.md.

* fix(cognito): translate malformed LogConfigurations elements the way AWS does

A scalar inside the array reached Jackson's convertValue directly, so an
IllegalArgumentException escaped as a 500 InternalFailure instead of a client
error, and a null element would have failed on the validation loop.

AWS answers both without a 500:

  [1, 2] / ["a string"] -> SerializationException: Expected null
  [null]                -> 200, the null element is dropped

Elements are now checked before conversion: nulls are skipped and non-objects
raise SerializationException.

* fix(cognito): bound LogConfigurations and reject a repeated event source

SetLogDeliveryConfiguration validated each element but never checked the list
itself, so a request with three or more well-formed configurations, or two
naming the same event source, was accepted and stored where AWS rejects it.

Measured against Cognito in ap-southeast-1:

  3 well-formed configs   InvalidParameterException, length constraint on
                          'logConfigurations', max 2
  2 duplicate sources     InvalidParameterException, "appear more then once"
  3 configs, one bad enum 2 validation errors, the length one reported first
  unknown pool, bad enum  the validation error, not ResourceNotFoundException
  0 configs               200 OK

The shape checks now run before the pool lookup, matching that last row, and
collect every violation into one message instead of throwing on the first.
The duplicate and missing-destination complaints share one message with the
missing-destination clause first, and each event source is named once however
many configurations carry it, as measured.

"more then once" is the service's own spelling, kept so the message matches.

The length message embeds the request model's toString, which the emulator now
reproduces for all three destination shapes and for an absent destination.
2026-09-02 11:44:18 -04:00
NAMAN JAIN de6bf8f599 feat(glue): jobs and crawlers (#2591)
* feat(glue): implement CRUD operations for Jobs and Crawlers

* fix(glue): resolve edge cases in jobs, crawlers, and tagging implementation

- Fix DynamoDBTarget ScanAll/ScanRate JsonProperty casing
- Support MaxResults and NextToken pagination in GetJobs and GetCrawlers
- Throw EntityNotFoundException for unknown Job/Crawler deletions
- Retain existing configuration values during Crawler updates
- Use centralized ResourceGroupsTaggingService for non-schema TagResource/UntagResource/GetTags actions

* test(glue): add CRUD, pagination, and tagging tests for Jobs and Crawlers

* fix(glue): validate pagination limits and ARN existence for tagging

* fix(glue): enforce AWS-compliant validation, semantics, and responses

- Add required field validation to Job and Crawler CRUD operations.

- Persist SourceControlDetails and ProfileName across Job updates.

- Set default State (READY) and Version for Crawlers on creation.

- Standardize empty-body responses to bare Response.ok() per AWS specs.

- Add handler-level integration tests for request payload parsing.

- Refactor GlueServiceTest to use valid mock objects and standard imports.

* fix(glue): add missing ARN validation for databases, tables, and UDFs

- Restore EntityNotFoundException when attempting to tag nonexistent Databases, Tables, or UserDefinedFunctions.

- Expand tagging tests to verify behavior for these resources.

* chore(glue): apply AWS defaults for Job creation and remove unused Crawler DTOs

- Apply default GlueVersion (5.1) and Timeout (480/2880 based on version) for newly created Jobs.

- Remove empty Create/Update/DeleteCrawlerResponse models since they are unused.

* fix(glue): throw EntityNotFoundException for unmodeled resource ARNs

- Prevent validateResourceExists from silently passing when an ARN type isn't supported (e.g. connections).

- Any ARN not matching jobs, crawlers, databases, tables, or UDFs now throws.
2026-09-02 11:39:10 -04:00
TATSUNO “Taz” Yasuhiro fad54f3c7a fix(stepfunctions): fail an intrinsic argument that matches nothing (#2872)
* fix(stepfunctions): fail an intrinsic argument that matches nothing

States.Format('{}', $.nope) resolved to null and the state succeeded. Real AWS
fails it with States.Runtime and names the whole expression. An index past the
end of an array is a miss here, where the same path written directly resolves
to null.

Closes #2870

* docs(stepfunctions): drop the States.Format template gap note

The gap is not fixed or caused by this change, so it is tracked on its
own issue instead of riding along in this pull request.

* test(stepfunctions): point the format template gap at issue #2927
2026-09-02 10:31:20 -04:00
Facundo ParedesandFacundo Paredes 77b4881fe4 fix(cloudformation): merge Fn::Transform AWS::Include before provisioning, and honour GetTemplate TemplateStage (#2886)
* test(cloudformation): pin Fn::Transform AWS::Include merging against the deployed template

The expected values come from a deployed stack's original and processed templates,
read with get-template, and from get-template-summary probes against real AWS.
Every assertion states its expected value as a literal, including the spliced
multi-line Fn::Sub value with its line breaks intact.

* fix(cloudformation): merge Fn::Transform AWS::Include before provisioning

The template engine evaluated ten intrinsics and Fn::Transform was not among them,
so an AWS::Include node was neither expanded nor rejected: it reached provisioning
as an ordinary key. A state machine whose DefinitionSubstitutions came from a
snippet therefore reached CreateStateMachine with a key literally named
Fn::Transform and without any of the snippet's keys, leaving every ${placeholder}
unsubstituted in the stored definition. The stack still reported CREATE_COMPLETE.

Measured against a deployed stack: 41 Fn::Transform nodes in the original template,
all Name AWS::Include, all with the same s3:// Location, all at
Resources.<id>.Properties.DefinitionSubstitutions; 0 in the processed template. At
one of those positions the six sibling keys keep their original order and the five
snippet keys are appended after them, and the spliced multi-line Fn::Sub value keeps
its line breaks: nothing is folded or re-serialized.

Three controlled get-template-summary probes settle the summary contract. A template
with no transform reports DeclaredTransforms null and its ResourceTypes; the same
template with an embedded Fn::Transform, and one with a top-level Transform, both
report DeclaredTransforms AWS::Include. GetTemplate keeps returning the body as
submitted, matching AWS's TemplateStage=Original default, while the change-set
baseline uses the merged body so a byte-identical resubmission reports no change.

* test(cloudformation): pin Fn::Transform AWS::Include rejection when Parameters is absent entirely

* test(cloudformation): pin Fn::Transform AWS::Include rejection when Location is present but blank

* fix(cloudformation): name the Fn::Transform node when AWS::Include Parameters is absent or Location is blank

* test(cfn-transform): pin AWS::Include Location error message for blank and null-Parameters shapes

Renames the existing empty-string test to name the shape it actually feeds,
adds coverage for a whitespace-only Location (which today leaks its raw
value with no quoting) and for an explicit null Parameters (which already
renders the Fn::Transform node, with no test pinning that literal).

* fix(cfn-transform): reject whitespace-only Location and stop leaking non-object Parameters

describeLocation checked isEmpty() where its own javadoc promised blank, so a
whitespace-only Location leaked its raw unquoted value into the rejection
message instead of a quoted string. It also enumerated missing and null as
the only non-mapping Parameters shapes, so a scalar or a list Parameters fell
through to Location's MissingNode and the message rendered Parameters itself
as if it were the rejected Location. Both guards now ask a single question
each: isBlank() for the Location text, and isObject() for the Parameters
shape, dropping the OR out of the second guard.

* test(cfn-transform): pin AWS::Include Location error message for scalar and list Parameters

Closes the coverage gap for defect 2: before the isObject() guard, a scalar
or list Parameters fell through to Location's MissingNode and the rejection
message rendered Parameters itself as if it were the Location, which a
reader could mistake for a valid rejected URI. Both templates go red against
the pre-hunk isMissingNode()||isNull() guard and green against isObject().

* test(cloudformation): pin GetTemplate TemplateStage selecting Processed vs Original

Processed must return the SAM-expanded, AWS::Include-merged body with no
AWS::Serverless::Function or Fn::Transform node left; Original and the
no-stage default must return the caller's raw YAML byte for byte; an
invalid stage must reject with the AWS enum ValidationError; and a plain
stack with no transform must return identical bodies for both stages and
advertise StagesAvailable on every GetTemplate call.

* fix(cloudformation): honor GetTemplate TemplateStage instead of always returning Original

GetTemplate accepted no TemplateStage, so a caller asking for Processed was
silently answered with Original. It now validates the parameter against
AWS's Original/Processed enum, returns stack.templateBody (the SAM- and
AWS::Include-merged body) for Processed and stack.originalTemplateBody
(the caller's raw submission, also the default) otherwise, and reports
StagesAvailable on every response, matching real AWS.

* test(cloudformation): pin GetTemplate TemplateStage validation ordering and empty-string rejection

Pins two AWS-measured behaviors GetTemplate does not have yet: TemplateStage
Bogus is rejected with the enum ValidationError even when the named stack was
never created, proving AWS validates the request shape before the stack
lookup; and TemplateStage="" (present but empty) is rejected the same as any
other value outside the enum, distinct from the omitted case which defaults
to Original.

* fix(cloudformation): validate GetTemplate TemplateStage before the stack lookup and reject an empty value

Two ordering and parsing gaps measured against a real account: an invalid
TemplateStage was rejected with "Stack ... does not exist" instead of the
enum ValidationError when the stack was absent, because the lookup ran
first; and TemplateStage="" (present but empty) was silently accepted as
Original instead of rejected, because isBlank() treated it the same as the
omitted case. Both are hoisted/tightened to match AWS. The two stage names
are also named once as constants instead of retyped across the enum list,
the StagesAvailable list, the stage-selection check and the default, and the
rollback comment and docs are rewritten to describe today's two-stage
behavior instead of the pre-TemplateStage one.

* docs(cloudformation): correct GetTemplate Processed-stage claim, drop a self-evident comment

The GetTemplate doc claimed AWS::LanguageExtensions, a third-party macro, and the
top-level Transform AWS::Include short form always leave Processed unexpanded.
SamTransformProcessor removes the whole Transform section unconditionally when the
template also declares the SAM transform, so any of those three shapes co-declared
with SAM is gone from Processed too; the sentence now states that condition.

Also drops the block comment above STAGE_PROCESSED/STAGE_ORIGINAL: it restated what
the constant names already show.

* docs(cloudformation): drop the CAPABILITY_AUTO_EXPAND deviation, measured as parity

A CreateChangeSet carrying an embedded Fn::Transform/AWS::Include was
accepted against a real account with CAPABILITY_IAM alone, so requiring
no capability for AWS::Include matches AWS rather than deviating from
it. The known-deviation count drops from three to two, and the
unmeasured CreateStack path is named as unmeasured.

---------

Co-authored-by: Facundo Paredes <25681464+facuparedes@users.noreply.github.com>
2026-09-01 23:05:26 -05:00
Olamide Kosile 961d82dda9 fix(cloudformation): provision AWS::Scheduler::ScheduleGroup (#2796) 2026-09-01 21:26:02 -05:00
Priamo Germosen 3b7ba5c687 feat(batch): add UpdateComputeEnvironment and DeleteComputeEnvironment (#2857)
Mirrors the existing UpdateJobQueue/DeleteJobQueue pair. DeleteComputeEnvironment
requires DISABLED state and rejects deletion while still referenced by a job
queue's computeEnvironmentOrder, matching AWS; updating computeResources is a
partial merge (only the sent fields change), not a full replace. Both
UpdateComputeEnvironment and CreateComputeEnvironment now validate state is
ENABLED or DISABLED, so an invalid value can never be persisted and later
block deletion.

CloudFormation stack-delete wiring for AWS::Batch::ComputeEnvironment/
JobQueue/JobDefinition (currently a silent no-op on stack teardown) is left
for a follow-up that migrates all of Batch's CFN handling into a per-service
provisioner, rather than adding more cases to the legacy switch.

Closes #2293, closes #2803.
2026-09-01 18:06:57 -05:00
Allen Sanborn 906af8c632 feat(ec2): support standalone network interface create/attach/detach (#2843)
* feat(ec2): support standalone network interface create/attach/detach

CreateNetworkInterface returned UnsupportedOperation unconditionally,
blocking every root that attaches a standalone ENI: the attach-eni and
override-default-eni examples in terraform-aws-server, the with-elb
example in terraform-aws-asg, and vpc-blackhole-routes in
terraform-aws-service-catalog (floci-kt9 in the floci-harness compat
survey).

Adds CreateNetworkInterface, DeleteNetworkInterface,
AttachNetworkInterface and DetachNetworkInterface, backed by a new
standalone ENI store separate from the implicit primary interface each
instance already carries. DescribeNetworkInterfaces now merges both
without double-counting. RunInstances also accepts a pre-existing
standalone ENI as an instance's primary interface via
NetworkInterface.1.NetworkInterfaceId, the shape Terraform's
network_interface { network_interface_id = ... } block sends for
override-default-eni.

* fix(ec2): keep a standalone ENI's own record when it is attached

Review found two ways the attachment state ended up recorded on only one side.

AttachNetworkInterface updated the standalone ENI and stopped there, so
DescribeNetworkInterfaces reported an attachment that DescribeInstances denied —
and the device-index conflict check, which reads the instance's own interface
list, could never see anything this operation had attached: two interfaces could
take device index 1 on the same instance. The instance now carries the interface
too, and DetachNetworkInterface removes it again.

RunInstances took the opposite approach and deleted the standalone record,
leaving the interface represented only inside the instance. Terminating that
instance then made a caller-created ENI vanish -- InvalidNetworkInterfaceID.
NotFound rather than returning to "available" -- so it could not be reused. AWS
attaches a pre-existing interface with deleteOnTermination false precisely so it
outlives the instance. The standalone record is now kept and marked attached,
and terminate releases it; describeNetworkInterfaces skips the instance-side
copy of any id the standalone store owns, so it is still reported exactly once,
from the side that knows its real attach time and its deleteOnTermination.

Also braces a single-line conditional, per AGENTS.md.

* fix(ec2): release an ENI whose instance died without TerminateInstances

TerminateInstances is not the only way an instance reaches "terminated": a
container-backed launch that fails or is cancelled ends there asynchronously,
inside Ec2ContainerManager, which has no access to the interface store. An ENI
the launch had already marked in-use therefore stayed pinned to an instance that
no longer runs, and every later attempt to reuse it failed with
InvalidNetworkInterface.InUse.

Rather than chase each terminal transition, the attachment is reconciled when
the interface is next read: an attachment naming an instance that is gone or
terminated is cleared, and the interface reports "available" again. That covers
attach, launch, delete and describe through the one path they share.

* fix(ec2): let a dead instance release its copy of a reclaimed ENI

Releasing the standalone record alone left the terminated instance still
reporting the interface, so once the ENI was reused two instance records claimed
it and nothing in DescribeInstances picks a winner. Reclaiming now clears both
sides, and the unit test asserts the instance no longer lists it.

Also drops the em-dashes from the comments and docs this branch adds, per
AGENTS.md.

* fix(ec2): drop the instance's copy on the TerminateInstances path too

The previous commit fixed only the reclaim-on-read path. TerminateInstances
released the standalone record while leaving the mirrored interface on the
terminated instance, so reusing the ENI still produced two instance records
claiming it. Both paths now clear the instance's copy, and the integration test
asserts DescribeInstances no longer mentions the interface before the same ENI
is handed to a second launch.
2026-09-01 18:21:57 -04:00