94 Commits
Author SHA1 Message Date
Kenshin Okinaka 2b9ed9cd55 fix(ses): check the TemplateArn of a v1 templated send as SES does (#9131)
SendTemplatedEmail and SendBulkTemplatedEmail now check TemplateArn with the
parser the v2 sends use: partition, service, region and resource type each
answer their own "Invalid template ARN" message, a value without "arn:" and an
empty template name are rejected, and the account is not checked. The v1-only
parser that looked for ":template/" is removed, and the name/ARN alignment
check moves into SesTemplateService for both protocols; the v2 controller's
remap keeps its BadRequestException.

Both v1 sends require Template whatever TemplateArn holds, as the model does,
and answer "Template cannot be empty" ahead of the ARN checks;
SendBulkTemplatedEmail treats a whitespace-only Template as empty. The Java and
Python compatibility tests build the template ARN in the client's partition and
region.
2026-11-21 09:37:57 -04:00
rajp33 623be62f3a fix(iot): keep MQTT persistent sessions across reconnects (#8915) 2026-11-19 13:01:44 -04:00
Priamo Germosen 9b24a38afe fix(iam): hold every policy document a write is handed to being a policy (#8175)
Seven writes take an IAM policy document and every one of them models
MalformedPolicyDocument, "the request was rejected because the policy document was
malformed". None of them answered it, so a document that was no policy at all was
stored and told apart only later, when something tried to decide with it. A role's
trust policy was the sharpest case: the trust evaluator reads a document it cannot
parse as matching nothing, so a role written that way could no longer be assumed.

The reading goes in IamService rather than at the Query front door, for two reasons.
Three CloudFormation provisioners write these documents straight through the service
and would otherwise be held to nothing. And the order AWS answers in differs per
operation, which only the service can express: CreateRole, CreatePolicy,
CreatePolicyVersion and UpdateAssumeRolePolicy read the document before the name
clash or the entity lookup, where PutUserPolicy, PutGroupPolicy and PutRolePolicy
answer NoSuchEntity for a holder that is not there whatever document the request
carried.

Which reading an operation asks for follows what the document is. A trust policy is
held to the grammar alone and under its own validator's wording, "This policy
contains invalid Json" for a text that does not parse as a JSON object and "Policy
has no statements" for an object carrying no Statement, the element the grammar
requires; its statements name a principal rather than resources, so an identity
statement's elements are not asked of it. An inline policy is held to that grammar
under the identity validator's one sentence for both, "Syntax errors in policy.",
and to the values the language defines: a Version outside 2012-10-17 and 2008-10-17,
an Effect that is not literally Allow or Deny, and a resource named neither by ARN
nor by the wildcard. A managed policy is held to those and to each statement's own
elements, "Policy statement must contain actions." and "Policy statement must
contain resources.".

None of those sentences is published and none is captured. They are the ones AWS's
own emulator answers, a first-party implementation rather than a recording, and the
split between the two validators' wordings is its reading too, which
docs/services/iam.md records.

The grammar is read in one place, not two. #8164 landed
IamPolicyEvaluator.readsAsPolicyDocument for a document a request supplies to the two
simulators or the two context-key readers, which asks exactly what the writes ask of
the top level: parses as a JSON object, and carries Statement. The writes need to know
which of the two failed in order to word their refusal, so the reading lives here and
that method is now its boolean face rather than a second copy of it.

Putting a document back is not a new write. A failed CloudFormation update restores
the trust policy, the inline policy or the policy version it captured before the
attempt, and a document an earlier release accepted must not be refused on the way
back: that would leave the role or the policy without what the rollback had just
removed, and the stack unable to roll back at all. So those three writes keep the
reading on their public entry point and the provisioners restore through
restoreAssumeRolePolicy, restoreRolePolicy and restorePolicyVersion, which apply the
same write without it. The inline-policy provisioner already restored by writing the
captured document straight back, so it needed nothing. This is the same rule as
reading a stored document exactly as it was, applied to the one path that writes one.

The whole text has to be the document. A member taking one takes "the complete, valid
JSON text of an IAM policy", and Jackson reads the first value and stops unless it is
told otherwise, so an object with anything after it parsed as a policy. The reader
enables FAIL_ON_TRAILING_TOKENS, which is what the reference implementation's parser
does by construction.

A null document is nothing to judge: a required member the request leaves out is
answered as absent by the constraints ahead of the operation. What is already stored
is read exactly as it was, so a document an earlier version accepted still decides
what it decided.

Holding every caller means holding the fixtures too, the compatibility suites
included: a Python and a Java SDK test each wrote an inline policy carrying only
Version, and two roles in the EKS access-entry test were created with a trust policy
of {}. All three are documents IAM refuses, the first two being the case recorded for
a document that is valid JSON carrying only Version.

Holding every caller means holding the fixtures too. Filler documents across the test
tree, "{}" as a trust policy chief among them, were documents real AWS refuses; they
now come from one place, io.floci.aws.testing.IamTestPolicies, which also answers a
distinct document per marker for a test that needs several. Two fixtures changed in
substance rather than in spelling: a Step Functions policy meant to name another
event bus named it by bare name, which an identity policy may not, and a managed
policy version's statements named no action.
2026-11-13 00:18:02 -04:00
Andre Kurait 1820d6470d fix(ec2): preserve security group deletion scope and dependencies (#7920)
* fix(ec2): preserve security group deletion scope and dependencies

Coordinate group publication, attachment and deletion, preserve instance/interface group state, and reject invalid DryRun values before deletion.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): tolerate absent persisted group dependency fields

Keep unknown-state instance attachments blocking deletion while treating absent dependency collections as empty. Cover all nullable scan fields and missing identifiers without changing normal dependency semantics.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): roll back failed security group creation

Retain the default rule identity before publication and compensate both group and rule writes when either store fails. Preserve the original exception and record cleanup failures without skipping the remaining cleanup.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): serialize group rule references with deletion

Acquire the regional topology monitor before the source group monitor while resolving and publishing ingress and egress rules. Keep runtime reconciliation outside the mutation locks and preserve existing unknown-reference compatibility.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): retain groups used by Instance Connect endpoints

Reject deletion before mutation when an Instance Connect endpoint uses the group. Return CannotDelete for default groups and reuse shared SDK clients in the existing fixtures.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* refactor(ec2): share resource locks and deletion race helpers

Reuse the reference-counted lock lifecycle for volume operations and instance group assignments. Keep scoped keys and lock ordering unchanged. Reuse deletion tasks and blocked-or-done observations without weakening race assertions.

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-12 20:31:14 -04:00
Andre Kurait 0e244e5724 feat(ec2): delete launch template versions without reusing numbers (#7910)
Preserve default versions and the highest issued version across deletion, persistence and CloudFormation rollback.

Reject invalid DryRun values before deletion, tolerate only already-deleted versions during CloudFormation rollback, and preserve the resolution race fixture without reflective field mutation.

Reuse presence checks to retain name-specific disappearance errors and existing service-test factories.

Reuse existing EC2 test factories and the shared blocked-or-done wait while preserving all race assertions.

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-10 15:50:33 -04:00
Jackson PriceandAndre Kurait 068740794a fix(ec2): select the subnet VPC default security group (#7762)
Use the existing VPC-specific default-group lookup for instance launch, with
service and SDK placement regressions and documentation.

Source: AndreKurait/floci#524 (94f76eae34e46dc1e740b6349bbaed578a15e372).

Remove the obsolete regional resolver and its dedicated test assertions now
that instance launch uses the VPC-specific lookup. Keep legacy VPC resolution
coverage and remove its unused security-group fixture.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-09 13:11:06 -04:00
Jimmy Liu Jia c9fc00a8d5 fix(appconfig): paginate ListApplications results (#7787) 2026-11-09 09:12:47 -04:00
Jackson PriceandAndre Kurait a884257311 fix(appconfig): isolate resources and sessions by region (#7621)
Scope AppConfig stores, sessions and deployment cursors to the request's
account and region. Keep legacy keys in the configured default region.
Adapt the source change to current deployment and CloudFormation behavior,
and cover storage reloads and SDK routing.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-05 16:13:12 -04:00
Jackson PriceandAndre Kurait ee78a41f16 fix(ec2): honor network interface selectors in AssociateAddress (#7506)
* fix(ec2): associate elastic addresses with primary and detached interfaces

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
(cherry picked from commit 28c17835d6e7dc480f5f5716e206fbbe5b81bee0)
Signed-off-by: Jackson Price <jxnprice@amazon.com>

* test(ec2): clean up partial address-association fixtures

Signed-off-by: Jackson Price <jxnprice@amazon.com>

* fix(ec2): serialize interface deletion and resolve managed interfaces

Signed-off-by: Jackson Price <jxnprice@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-04 08:28:01 -04:00
Jackson PriceandAndre Kurait 7b4e568ce4 fix(ec2): validate launch template selectors and honor dry runs (#7497)
* fix(ec2): honor launch template modification dry runs

Signed-off-by: Andre Kurait <akurait@amazon.com>
(cherry picked from commit a76af5e62cf32eacdab4ce71dc0b5c0866de7b25)
Signed-off-by: Jackson Price <jxnprice@amazon.com>

* fix(ec2): reject conflicting launch template selectors

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
(cherry picked from commit 50dfad42ed80c9694e77dcb24be3825b8ed32552)
Signed-off-by: Jackson Price <jxnprice@amazon.com>

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-04 06:47:31 -04:00
Jackson Price 1743cb5f75 fix(autoscaling): derive group zones from selected subnets (#7475) 2026-11-04 05:26:03 -04:00
Andre Kurait 28bde18804 fix(appconfig): honor final bake time and restore reverted configurations (#7156) 2026-11-01 07:47:06 -04:00
Jackson Price 3cb727a85e fix(cloudwatch): decompress gzip JSON PutMetricData bodies (#7123)
* fix(cloudwatch): decompress gzip JSON PutMetricData bodies

The AWS CLI and the SDKs that speak JSON 1.0 to CloudWatch gzip a
PutMetricData body of 10 KiB or more and send Content-Encoding: gzip.
AwsJsonController binds the body as a String, so Floci read the
compressed bytes as text and every such request failed with HTTP 400
SerializationException. The metrics were never stored.

Add a reader interceptor that decompresses that one operation's body
when the controller reads it. It runs after every request filter, so
the signature is still verified over the compressed bytes the client
signed, and IAM still decides the request from X-Amz-Target first,
which is sound because nothing in that decision comes from the body.
The decompressed body is bounded by the decoder the CBOR protocol
already uses: past 10 MiB it returns HTTP 413 PayloadTooLargeException,
and a body that cannot be decompressed returns HTTP 400
InvalidRequestException, both in the controller's JSON error format.

A name binding keeps the interceptor on AwsJsonController alone, so
every other resource reads its body as before. In the native image a
global reader interceptor breaks the tag endpoints that resources
inherit from AbstractTagsController, because Quarkus REST then looks
their methods up reflectively.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(cloudwatch): publish a compressed metric batch through boto3

botocore gzips a PutMetricData body of 10 KiB or more, and with the
pinned boto3 it calls CloudWatch over JSON 1.0. The Python
compatibility suite only ever sent a handful of datums, so it never
sent a compressed request.

Send a 100-datum batch, check that botocore sent it as JSON 1.0 with
Content-Encoding: gzip, and check that all 100 metrics are listed
afterwards. Checking the content type keeps the test from passing
through the CBOR path, which already decompressed gzip, should a later
botocore prefer CBOR.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* chore(cloudwatch): reuse signed IAM test users

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-31 16:53:57 -04:00
TATSUNO “Taz” Yasuhiro 9c00c8c70e test(compat): cover Lambda Web Functions in the Python SDK suite (#6983)
* test(compat): cover Lambda Web Functions in the Python SDK suite

* test(compat): run the Lambda Web Python suite in any region and clean up a partial setup
2026-10-29 23:29:14 -04:00
Andre Kurait 80dbdbc0f8 fix(elb): default omitted classic listener instance protocols (#6785) 2026-10-27 23:55:13 -04:00
Andre Kurait 5c20d54646 fix(appconfig): reject ambiguous configuration names (#6783) 2026-10-27 23:17:05 -04:00
Andre Kurait b5033e970d fix(ec2): model scheduled capacity reservations (#6764)
* fix(ec2): reject unsupported future capacity reservations

Reject StartDate before capacity reservation creation or client-token replay. Preserve immediate reservation behavior.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): model scheduled capacity reservations

Retain future start and commitment metadata, activate through capacity reconciliation, and preserve client-token replay.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): preserve activation membership and replay tags

Reuse open-reservation instance matching during activation, persist creation tag identity, and keep replay from overwriting later tag edits.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(ec2): validate future reservation matching and capacity

Require targeted matching, supported instance families and at least 32 vCPUs before future reservation publication. Preserve scheduling, tag replay and immediate reservation behavior.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-27 23:15:52 -04:00
Andre Kurait f4ace9ebbe fix(appconfig): return no content for cached configurations (#6777) 2026-10-27 22:00:37 -04:00
Andre Kurait 1a5decbb4a fix(ec2): honor default subnet filters (#6772)
Handle both documented default-subnet filter aliases and preserve safe asynchronous ENI cleanup.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-27 19:09:11 -04:00
Andre Kurait b6d9e4c7a4 feat(lambda): list provisioned concurrency configurations (#6758)
* feat(lambda): list provisioned concurrency configurations

Dispatch List=ALL to a paginated view of existing provisioned concurrency allocations. Preserve qualified ARNs, current status and existing pool lifecycle.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(lambda): share function ARN region resolution

Share the existing Lambda region validation and error message across function resolution and provisioned-concurrency lookup/listing.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-27 18:13:24 -04:00
Andre Kurait 0332b5cc24 fix(lambda): preserve alias identity in qualified reads (#6757)
Preserve the requested alias ARN while returning the resolved published version configuration. Retain snapshot-versus-latest regressions for both read APIs.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-27 16:24:36 -04:00
Andre Kurait 52c9c51a7b fix(dynamodb): enforce the default Select for IAM (#6702)
* fix(dynamodb): enforce effective read selection in IAM policies

Preserve generated action and request-member coverage, effective read projections, PartiQL attributes and independent BatchGetItem contexts. Rebase on current main and scope condition data verification to its vendored file, generator, tests and imported modules, retaining all existing IAM data gates.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(dynamodb): derive transaction read conditions from modeled members

Use the generated transaction Get member paths before GetItem IAM extraction, so ignored legacy projection members cannot authorize whole-item reads.

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-27 10:05:55 -04:00
Andre Kurait 6ff4700a22 fix(dynamodb): enforce the aggregate batch write limit (#6633) 2026-10-26 19:36:27 -04:00
Jackson Price 6acd90640d feat(cloudformation): provision AWS::EC2::PrefixList (#6481)
* feat(cloudformation): provision AWS::EC2::PrefixList

An AWS::EC2::PrefixList was stubbed: Ref returned "<LogicalId>-<8 hex>",
Fn::GetAtt the literal "<LogicalId>.<Attribute>", and EC2 held no list, so
a route given its Ref pointed at nothing. Ec2NetworkCfnProvisioner now
creates the customer-managed list through Ec2Service. Ref is its pl- id,
and Fn::GetAtt serves PrefixListId, Arn, OwnerId and Version, the
attributes the registry schema declares.

The schema has no create-only property, and create-only-properties.json
now says so. Without the entry, the engine's name heuristic took
PrefixListName for create-only, so a rename was planned as a replacement
of the list and of the routes and rules that reference it. An update
changes the list in place: its name, capacity, entries and tags. Adding or
removing entries makes a new version and a rename does not, as the EC2 API
reference says. EC2 refuses a request that removes and adds the same CIDR,
which is how a description changes (Terraform's
aws_ec2_managed_prefix_list records the error), so such an entry is added
back by a second ModifyManagedPrefixList call. The first call carries
everything EC2 could refuse, and the capacity the second needs is checked
before the first, so a change EC2 refuses leaves the list as it was. A
rollback puts the prior name, capacity, entries and tags back, and Version
follows the list.

Two updates fail before anything changes: another AddressFamily, which no
EC2 call can change on an existing list, and a new MaxEntries together
with changed Entries, which the CloudFormation and EC2 references both say
cannot change at once. MaxEntries is required to create a list, as the
CloudFormation reference says (aws/aws-cdk#35360 reports the deploy
failing without it); an update that leaves it out keeps the capacity.
Entries and Tags are brought to the template when it, or the previous one,
declares them, so entries or tags no template declared stay. Tags go
through CreateTags after the create, as on the other types in the
provisioner, so EC2 checks them; a tag it refuses fails the create and
removes the new list. A list gone out of band, or a stub an older Floci
left, is replaced by a new one, and a stack delete tolerates only
InvalidPrefixListID.NotFound.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(cloudformation): cover AWS::EC2::PrefixList through boto3

A stack's prefix list is created, resized, given new entries and deleted
through the CloudFormation and EC2 clients of the pinned boto3: Ref and
Fn::GetAtt name the list EC2 describes, a resize keeps the version, new
entries make version 2 of the same list, dropping Tags removes them, and
the list is gone after the stack delete.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* refactor(cloudformation): share optionalInt through ProvisionContext

Ec2NetworkCfnProvisioner and ElbV2CfnProvisioner each carried the same
private optionalInt. An absent, null or AWS::NoValue property stays unset;
a value written into the template, a literal blank included, has to be an
integer; anything else fails with ValidationError "Value of property
<name> must be an integer." It is now ProvisionContext.resolveOptionalInt,
beside resolveOptional, and all seven callers use it: the prefix list's
MaxEntries, the target group's Port and four health check settings, and
the gateway listener's Port.

The two copies differed only in Integer.parseInt against Integer.valueOf
and in building the error through a helper, so neither provisioner
changes behaviour. ProvisionContextTest covers the method directly.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-25 17:16:19 -04:00
Andre Kurait 40b6bfc204 fix(stepfunctions): honor ListExecutions status filters (#6406)
* fix(stepfunctions): honor ListExecutions status filters

Filter by the requested current status, validating filter values and types before listing executions. Serialize the captured matching status, preserve unfiltered behavior, and cover the wire path through the normal SDK suite.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(stepfunctions): reject unsupported pending-redrive listings

Reject PENDING_REDRIVE consistently without implying map-run listing support. Exercise execution filters through explicit stop completion instead of polling for asynchronous success.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* fix(stepfunctions): use Smithy status filter validation

Reuse the shared enum validation helper and preserve the AWS status ordering in invalid ListExecutions filter errors. Verify exact messages before service access and through boto3.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

---------

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-24 21:22:55 -04:00
Andre Kurait 60ef203fa8 fix(ec2): launch instances into capacity reservation groups (#6404) 2026-10-24 18:45:19 -04:00
Andre Kurait 84727e3f2f chore(test): remove unused capacity association Docker fixture (#6405)
Remove the opt-in Docker SDK fixture that CI never enables, as requested in the separate follow-up to #6401. Preserve production and the existing Java association and admission tests.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-24 08:05:52 -04:00
Andre Kurait 5b24703815 fix(ec2): normalize subnet IPv6 CIDRs and expose zone network borders (#6387)
Normalize subnet IPv6 responses and expose regional availability-zone network borders. Keep the read-only regional test at a unique execution order.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-23 20:27:03 -04:00
Stuart Lang 42f5019231 fix(cloudwatch): return empty CompositeAlarms and LogAlarms from DescribeAlarms (#6363)
* fix(cloudwatch): return empty CompositeAlarms and LogAlarms from DescribeAlarms

AWS sends every alarm collection even when it is empty. Floci only sent
MetricAlarms, so the AWS CLI's text output printed a leading None line
for each missing paginator result key.

Closes #6362

* test(cloudwatch): check empty alarm collections in sdk-test-python instead of bats

Drop the new AWS CLI bats file and assert the empty CompositeAlarms and
LogAlarms lists in the existing describe_alarms test, as boto3 leaves an
absent list out of the response.
2026-10-23 19:06:44 -04:00
Andre Kurait 1f31f5bf48 fix(route53): compare alias target DNS names canonically (#6357)
Fold only ASCII DNS letters and accept an optional trailing dot while keeping distinct target values and rejected batches intact. Exercise compatibility cases using the suite endpoint.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-23 13:49:29 -04:00
Andre Kurait d05399feb1 feat(ec2): associate instances with capacity reservations (#6336)
Associate eligible instances with capacity reservations across EC2, AutoScaling and CloudFormation. Preserve account ownership, rollback, physical stop/start ordering and bounded targeted quota admission.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-10-23 08:40:28 -04:00
Vũ Thế Huy d2f2625005 feat(redshift): add ResetClusterParameterGroup (#6230)
* feat(redshift): add ResetClusterParameterGroup

* docs(redshift): update supported operation count

* fix(redshift): validate resets and preserve legacy parameter groups

* fix(redshift): accept empty Query parameter lists
2026-10-22 15:59:54 -04:00
Alessandro Lattaoandoutof-place 47f570a821 feat(cognito): hand email codes to the CustomEmailSender trigger (#6031)
* feat(cognito): hand email codes to the CustomEmailSender trigger

* test(cognito): decrypt CustomEmailSender codes with the AWS Encryption SDK

* docs(cognito): document the CustomEmailSender trigger

* fix(cognito): fail a CustomEmailSender delivery as Cognito does

Measured on Cognito (eu-west-1, 2026-10-16), with the events a real sender
received:
- CreateUserPool and UpdateUserPool refuse a custom sender trigger without
  a KMSKeyID ("KMSKeyId parameter is required when Custom SMS/Email Lambda
  trigger is used."), and CreateUserPool a key that does not exist
  ("Encountered error when CreateGrant was attempted on the input KMS key -
  Key '<id>' does not exist"), both InvalidParameterException.
- A disabled key fails the request with CodeDeliveryFailureException
  "Caller needs to enable the configured KMS Key", a key pending deletion
  with "Unable to encrypt CustomEmailSender/CustomSMSSender code using the
  configured KMS Key". The sign-up is kept, unlike a failed SES delivery,
  and InitiateAuth answers the same error rather than InternalErrorException.
- A function that is gone, or that Cognito may not invoke, answers
  UnexpectedLambdaException "CustomEmailSender invocation failed due to
  error AccessDeniedException."
- request.clientMetadata is null for every source, InitiateAuth's
  ClientMetadata included, so the parameter that carried it is gone.

The branch also follows main since it was written: CognitoService takes
enforceTokenValidityLimits, and signUp ValidationData and ClientMetadata.

* fix(cognito): withdraw a code the CustomEmailSender could not take

Review of #6031: when the handover failed, the code issued for it stayed
live in SignUp, ForgotPassword and both attribute flows, so asking for a
code again within 30 seconds answered LimitExceededException. Measured
on Cognito (eu-west-1): it hands out a code again at once, on a healthy
pool and once a key that could not encrypt is enabled again, for
ResendConfirmationCode and ForgotPassword alike.

sendThroughCustomEmailSender now withdraws the code before it fails, for
every flow, and the two catches that withdrew it by hand (resend and the
sign-in OTP) leave that to it.

* fix(cognito): hand the CustomEmailSender the request's ClientMetadata

Review of #6031: the developer guide lists ClientMetadata for the
sign-up, forgot-password and sign-in sources, and the branch passed null
for every one on the strength of InitiateAuth alone. Measured on Cognito
(eu-west-1): SignUp, ResendConfirmationCode, ForgotPassword,
GetUserAttributeVerificationCode and UpdateUserAttributes each hand the
function the request's ClientMetadata; only the sign-in code's event has
none, even when InitiateAuth sends one. A request without ClientMetadata
gives null, as measured before.

ResendConfirmationCode, ForgotPassword and the two attribute calls now
take the request's ClientMetadata through the service, with overloads
that keep their previous signatures. resolveTriggerArn's custom sender
branch gets its braces.

---------

Co-authored-by: outof-place <contact@outofplace.space>
2026-10-20 06:44:20 -04:00
David Phillips 0f4f59bbbb fix(elbv2): require an HTTPS default certificate (#5989)
* fix(elbv2): require an HTTPS default certificate

Refuse HTTPS listener changes until a default certificate is supplied.

* docs(elbv2): keep certificate checks documented correctly
2026-10-19 21:12:16 -04:00
Andre Kurait a103b938d2 fix(query): route signed GET requests through the Query dispatcher (#6007)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-19 15:34:33 -04:00
Andre Kurait 0a37ea830b fix(dynamodb): support legacy table discovery and batch cleanup (#5986)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-19 13:30:04 -04:00
Andre Kurait 4e47507a7b fix(autoscaling): match DescribeTags input validation (#5894)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-17 16:39:21 -04:00
Mario Toffia 534571b2a3 feat(iot): route shadow events through topic rules (#5260)
* feat(iot): route shadow events through topic rules

Successful classic and named shadow changes, from the REST API and from MQTT
reserved topics, now reach the topic rules engine and MQTT subscribers on the
AWS response topics with AWS payload shapes. Shadow documents keep metadata,
clientid() reports N/A for messages without an MQTT client, and MQTT rejected
responses carry the numeric status code.

Closes floci-io/floci#5256

* fix(iot): compute the shadow delta through nested objects

GetThingShadow and the update/delta event compared desired and reported only at the top level, so one differing nested field put the whole desired object in the delta. AWS compares nested objects key by key and arrays whole, and the delta event carries the stored desired metadata of exactly the delta values.

* fix(iot): give a shadow stored without metadata its leaf metadata

A shadow persisted before metadata was kept now reads back with a metadata mirror of its state stamped with its stored timestamp, so GetThingShadow and the update/documents and update/delta events carry metadata for its existing leaves, as AWS does for every state leaf.

* fix(iot): reject a shadow name outside the AWS pattern

A whitespace-only shadow name no longer addresses the classic shadow, so DELETE ?name=%20 cannot delete it. As on AWS, an empty name is the classic shadow and any name that is not 1 to 64 of [a-zA-Z0-9:_-] fails with InvalidRequestException.

* fix(iot): ignore a shadow request on a named topic with an invalid name

As on AWS, an MQTT request on $aws/things/<thing>/shadow/name/<name>/<op> whose name is not a valid shadow name, empty included, is not a shadow request: nothing is published and the classic shadow is untouched. Before, an empty name updated the classic shadow and a blank one was rejected on the classic shadow's topic.

* docs(iot): note that wildcard rule filters receive shadow events

Verified on AWS IoT: rules FROM '#' and '+/things/<thing>/shadow/#' receive the $aws shadow update events. Adds a test locking in the existing matcher behavior.

* fix(iot): keep only the most recent recorded publish events

The recorder kept every publish, and shadow events now go through it too. Only tests read it, so it now keeps the most recent 1,000 events and drops the oldest.

* test(iot): read shadow rule queues without the 5s poll

* fix(iot): match AWS shadow names, delta numbers and clientToken echo

Accept the reserved $package shadow name and reject any other name containing $ with 'Invalid shadow name : <name>'; a name failing the pattern answers 'Bad Request'. Compare delta numbers as AWS does (equal when both double and long values are, integers beyond long exactly), which also stops a number beyond the double range failing the update, and echo a whitespace clientToken.
2026-10-16 20:47:34 -04:00
XuJian eb84539a67 fix(iot): return ConflictException for shadow version mismatch (#5814)
* fix(iot): return ConflictException for shadow version mismatch

* fix(iot): match AWS shadow version conflict message

* test(iot): expect modeled shadow conflict in Python SDK
2026-10-16 17:52:27 -04:00
Andre Kurait 5a72b4f561 fix(apigateway): validate imported models in their deployment context (#5645)
* fix(apigateway): resolve imported request model references

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): snapshot request model schemas for deployments

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): match the default body validation error

Signed-off-by: Andre Kurait <akurait@amazon.com>

* test(apigateway): expect the AWS default validation message

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): address model snapshot review findings

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): resolve model URLs from deployment snapshots

Signed-off-by: Andre Kurait <akurait@amazon.com>

* test(apigateway): make model reference cases collectable

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): accept canonical model URLs in every partition

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-15 06:50:46 -04:00
Jackson Price e15c081d33 fix(acm): reject empty SAN arrays in certificate requests (#5688)
RequestCertificate answers an explicit empty SubjectAlternativeNames
array with a 400 ValidationException, as ACM does: the API requires at
least one name in the list. CloudFormation certificate resources keep
accepting an empty list and request the certificate for the domain
name alone, as before.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-14 20:57:53 -04:00
jwoa95andPriamo 17c40cecbd fix(cognito): reject token validity outside AWS's limits (#5160)
* fix(cognito): reject token validity outside AWS's limits

CreateUserPoolClient and UpdateUserPoolClient accepted any positive token
validity, so a client with one-minute access and ID tokens, or a
20-minute refresh token, worked locally and failed on deploy. AWS allows
access and ID tokens between 5 minutes and 1 day and refresh tokens
between 60 minutes and 3,650 days, in each token's TokenValidityUnits
unit (hours for access and ID tokens, days for refresh tokens, by
default). A client outside them now fails with InvalidParameterException
"Invalid range for token validity.", the message AWS returns.

floci.services.cognito.enforce-token-validity-limits (env
FLOCI_SERVICES_COGNITO_ENFORCE_TOKEN_VALIDITY_LIMITS, default true) turns
the check off for tests that want tokens shorter than AWS allows.

* test(scheduler): start recurring test schedules in the future

Since #5610 a rate schedule's first occurrence is its creation time, so
a schedule is due the moment it exists. The application's own dispatcher
keeps ticking every 10 seconds during @QuarkusTest and sees every
schedule, so a tick that lands between CreateSchedule and the test's own
dispatcher fires the schedule once more than the test expects.

Four tests create an enabled rate(1 minute) schedule and count exact
deliveries: recurringScheduleStartsOneExecutionPerOccurrence,
stepFunctionsDeleteScheduleStopsFutureOccurrence,
rateScheduleDeliversEachOccurrenceWithItsScheduledTime and
executionIdsDifferBetweenOccurrences. They now create the schedule
through SchedulerTestHarness.createRecurringSchedule, which sets a
StartDate a day ahead, and tick past it on their scoped dispatcher. The
application's dispatcher skips a schedule before its StartDate, and the
test profile and its tick interval stay as they are.

* test(compat): poll OpenSearch domain readiness every 250 ms against Floci

OpenSearchTest waited for the domain to finish processing in its own loop
that slept 5 s between checks and swallowed InterruptedException. Floci
flips Processing to false on its own 3 s readiness poll, so the test
could sit up to 5 s past the moment the domain was ready.

The wait now goes through TestFixtures.await, polling every 250 ms
against Floci and keeping the 5 s cadence against real AWS, with the
same 3 minute timeout.

* fix(opensearch): run domain containers under an init process so a stop ends them at once

The OpenSearch image's entrypoint is a bash script that starts the server
as its child instead of exec'ing it. Running as PID 1, that script ignores
SIGTERM, so every DeleteDomain, and every shutdown for each domain, waited
out the whole 5 s stop timeout before Docker sent SIGKILL. The server
never saw the SIGTERM either way.

Domain containers now run under Docker's init process, which takes the
SIGTERM and ends the container at once. Stopping a ready 2.11.1 container
took 5.27 s (exit 137) without it and 0.26 s (exit 143) with it, and
DeleteDomain in the compatibility OpenSearchTest took 5.3 s.

The two startDomain tests' shared setup moves into one helper, which the
new init test uses too.

* fix(cognito): keep a RefreshTokenValidity of 0 at 30 days in any unit

AWS replaces a RefreshTokenValidity of 0 with "the default value of 30
days". Floci stored the bare number 30 in the client's refresh token
unit, so a client with RefreshToken=minutes issued 30-minute refresh
tokens. With the token validity limits, any later UpdateUserPoolClient
that left the validity alone re-checked that stored 30 minutes and
failed with "Invalid range for token validity.", for a client Floci had
accepted.

A 0 now becomes 30 days in the client's refresh token unit (2592000
seconds, 43200 minutes, 720 hours or 30 days), on create and on update,
and the limits check runs on that normalized value. Also imports UUID on
a test line that spelled it out in full.

* fix(cognito): reset the settings UpdateUserPoolClient omits to their defaults

AWS: "If you don't provide a value for an attribute, Amazon Cognito sets
it to its default value." The developer guide adds that an update with
one parameter "sets all others to a default value". Floci kept the
stored value of every setting the request left out, so a client could
end up with a combination AWS never produces: an AccessTokenValidity of
60 kept from a minutes client, read in the hours of a units-only update,
was refused as out of range, where AWS resets the validity and accepts.

CreateUserPoolClient and UpdateUserPoolClient now build their settings
in one place, with a new client's default for each one the request
omits, and the update copies them onto the stored client. ClientName is
the exception: the API documents no default for it, so an update without
one keeps the name. The id, the secrets, the dates and the branding are
not settings and stay as they are. An explicitly empty list still clears
the setting.

The AuthSessionValidity tests and the boto3 compatibility test that
asserted the old keep-on-omit behaviour now expect the 3-minute default.

* test: share one self-signed and one user-cert TLS profile across the TLS integration tests

CustomDomainTlsIntegrationTest, TlsEnsureHostIntegrationTest, TlsHttp2HostRoutingIntegrationTest and EcrTlsDataPlaneDockerIntegrationTest each declared a self-signed TLS profile whose static block wrote its own CA-issued leaf before boot, and under @QuarkusTest that leaf is the one served. They now share SelfSignedTlsProfile, which writes one leaf for all four: the SANs TlsConfigSource uses by default, without 127.0.0.1, plus the API Gateway custom domain the HTTP/2 test routes to. The custom domain and ensure-host tests connect by IP and expect a name the leaf doesn't cover yet to be refused, and the JDK falls back to the peer address when the SNI name doesn't match, so a 127.0.0.1 SAN would let those handshakes through. The leaf and its metadata are written fresh every run, which also drops hostnames an earlier run learned at runtime, and the container CA bundle the ECR test relied on is written beside them.

TlsIntegrationTest and TlsUserCertIntegrationTest declared the same user-provided certificate setup apart from paths. They share UserCertTlsProfile, which keeps the certificate file carrying its private key, since TlsUserCertIntegrationTest checks /_floci/ca.pem never echoes it.

Both profiles live in the config test package, beside every class that uses them and the package-private default SAN list, and expose their paths as compile-time constants, so a test can read them without initializing the profile class and rerunning its static block under the running application.

Sharing an application also means no class may leave anything behind for the next. TlsHttp2HostRoutingIntegrationTest now removes the bucket, CloudFront public key, key group and distribution, and the REST API, domain name and base path mapping it creates. EcrTlsDataPlaneDockerIntegrationTest deletes the manifest it pushes, TlsIntegrationTest its queue and TlsUserCertIntegrationTest its parameter. CustomDomainTlsIntegrationTest and TlsEnsureHostIntegrationTest already end with a state reset, which keeps the configured names from the profile's metadata, so neither changes the leaf a later class is served.

The ECR test's registry container also outlived every run: keep-running-on-shutdown defaults to true and the test config never overrides it, and the next application to start adopted the container by name, a developer's own Floci registry included. SelfSignedTlsProfile now names it in the run's sidecar namespace, which SidecarContainersProfile exposes for this, and stops it at shutdown. The test checks for Docker through SidecarContainersProfile.requireDockerAndImage, so a registry a killed run left behind is removed like any other abandoned sidecar.

Part of #4542.

---------

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-10-14 17:40:23 -04:00
Andre Kurait 6442d75115 fix(autoscaling): balance scale-out across zones and subnets (#5525)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-14 13:48:06 -04:00
Andre Kurait 90b9d37fd2 fix(ec2): preserve reserved tags during API and stack updates (#5611)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-14 13:39:45 -04:00
Andre Kurait 984e8187c9 fix(cloudwatch): route Query GET requests through CloudWatch (#5589)
* fix(cloudwatch): route public Query GET requests correctly

Reuse Query dispatch and IAM classification for supported CloudWatch GET requests while preserving S3 and presigned URL routing.

* test(cloudwatch): verify Query header name casing

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(cloudwatch): match signed Query GET errors and add SDK coverage

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(test): isolate TLS fixtures and escape invitation passwords

Signed-off-by: Andre Kurait <akurait@amazon.com>

* chore: declare directly used dependency APIs

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(cloudwatch): enforce Query GET authentication and IAM policies

Signed-off-by: Andre Kurait <akurait@amazon.com>

* chore: follow existing framework dependency declarations

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(cloudwatch): simplify signed Query GET routing

Reuse the existing presigned credential resolver and let the signing scope select CloudWatch before browser or target headers. Match the current and legacy API versions observed in AWS, and cover header/presigned IAM checks. Remove unrelated CI fixture changes from this PR; they remain on the ASG branch.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(cloudwatch): isolate Query GET routing and authentication

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-14 07:02:59 -04:00
Andre Kurait 63e0302c12 fix(apigateway): validate and normalize imported integration types (#5543)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-13 23:48:12 -04:00
Andre Kurait f4c8237229 fix(ec2): expose m6g.large through the shared instance catalog (#5583)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-13 16:13:23 -04:00
Andre Kurait 04dd78d0f6 fix(ec2): filter network interfaces by primary address association (#5531)
* fix(ec2): filter network interfaces by primary address association

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): synchronize EIP associations on supplied interfaces

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): require disassociation before release in nondefault VPCs

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): keep Elastic IP associations aligned with interface lifecycle

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): preserve retained interface association metadata

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-13 11:56:42 -04:00
Andre Kurait e77710d32d fix(apigateway): select request models by content type and default (#5530)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-12 18:44:03 -04:00
Andre Kurait 255ad96168 fix(dynamodb): validate legacy Expected operands without rejecting Value (#5508)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-12 15:08:18 -04:00