Commit Graph
6879 Commits
Author SHA1 Message Date
XuJian f3d5ffc19e fix(apigateway): decide a WebSocket passthrough integration by target policy (#10224) 2026-12-05 08:52:27 -04:00
Jackson PriceandAndre Kurait 387537550e test(firehose): drive the flush tick in the Kinesis source test (#10218)
The source test already advances the clock and drives the ingestion ticks. Drive the final flush before reading S3 so the assertion can run immediately.

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-05 08:48:18 -04:00
Jackson Price 1fcbfea569 test(iot): use the shared TCP probe for MQTT startup checks (#10217)
The MQTT lazy-start suites check the listener with TcpListenerProbe.accepts before endpoint discovery and thing creation and after each starts the broker, and the WebSocket suite after its first upgrade, keeping the 250 ms, 2 s and 1 s connect timeouts. Each assertion names the loopback listener if its state is unexpected.

Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-05 08:42:41 -04:00
Murtuza Chhil c2fe8122e8 fix(paymentcryptography): a key that carries no modes does nothing (#10210) 2026-12-05 08:36:36 -04:00
Hector Ventura a580275083 fix(storage): delete a key's pre-account copy in the default Region (#10215) 2026-12-05 08:34:57 -04:00
Priamo Germosen 508911da33 fix(lightsail): mint an id, not the name, in a resource's ARN (#10219)
Floci minted a Lightsail resource's ARN from its name (arn:aws:lightsail:<region>:<account>:Instance/web), while AWS
mints an id for it: the Lightsail API Reference gives an instance's ARN as
arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE, and a key pair's, a static
IP's and a disk's the same way, and the Service Authorization Reference writes every Lightsail type as <Type>/${Id}.
baseResource now mints a UUID for each instance, disk, static IP and key pair it makes, so an instance made again
under a name a deleted one had gets an ARN of its own, as on AWS. A request still names a resource by its name, and a
tag call by its name or by the stored ARN, which TagResource and UntagResource already matched on the whole ARN. A
resource stored before keeps the ARN it was made with.

This is the mint the request-resources table needs before Lightsail joins it: its rows find a resource by the name a
request gives and check it on the ARN Lightsail stores.

LightsailResourceProviderTest checks that each of the four types' ARNs carries a UUID after its type, that an
instance made again under a deleted one's name gets a new ARN, and that a tag call naming that ARN tags it;
LightsailIntegrationTest checks the ARN GetInstance answers.
2026-12-05 08:33:39 -04:00
Priamo Germosen 6190f6d154 fix(iam): check AWS WAF v2 requests on the resources they name (#10214)
WAF v2 was one of the namespaces the request-resources table left unread ("a later batch"), so every request of it
was checked on *: a grant scoped to a web ACL's ARN never matched, a deny scoped to one never held, and an
aws:ResourceTag condition read nothing. wafv2 joins the table now, so each request is checked on the resources the
Service Reference gives its action, read from the request.

A request giving an ARN member (ARN, ResourceARN, ResourceArn, WebACLArn) is checked on the resource it names, as
regional/<type>/<name>/<id> or global/..., the ARNs WAF v2 mints. UpdateWebACL and UpdateRuleGroup name their
resource by a lock token, which the table reads through LockToken: WafV2StoredResourceArns answers the caller's web
ACL, IP set, regex pattern set or rule group whose current token it is, of either scope the request's Region reaches,
the one the handler checks the token against (WafV2Service.lockHolder). WafV2Resource declares the getLockToken each
model already has. It answers the tags WAF v2 keeps on the resource an ARN names, read in the account, Region and
scope the ARN names without moving it and matched on the whole ARN (WafV2Service.storedTags), which an
aws:ResourceTag condition reads.

A request naming a resource by its Name, Scope and Id alone, and CreateIPSet and CreateRegexPatternSet, are checked
on <Scope>/<type>/*/*, the scope as the request spells it (REGIONAL or CLOUDFRONT) while WAF v2 mints regional/ and
global/, and CreateWebACL and CreateRuleGroup on *, as the generated table reads them.

IamRequestResourceEnforcementIntegrationTest checks that a grant on one web ACL's ARN lets an update giving its lock
token through and refuses the update of another, and that an aws:ResourceTag condition reads the tags of the web ACL
a tag call names. WafV2StoredResourcesTest checks the stored tags of a regional web ACL and a global IP set against
another account, Region, kind, service or no ARN, and the lock holder of either scope against another Region's
regional resource, another account's token and a replaced one.
2026-12-05 01:43:49 -04:00
Jackson PriceandAndre Kurait 85b92d8c68 test(iot): verify the MQTT listener closes after broker stop (#10213)
Wait for the loopback listener to refuse connections before starting the next test or restarting the broker. Reuse the TCP probe in the MQTT and WebSocket suites and fail if the listener stays open.

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-05 01:09:44 -04:00
Allen Sanborn 4188ddf4cf fix(lambda): clear alias routing weights when UpdateAlias sends empty AdditionalVersionWeights (#10111)
UpdateAlias with RoutingConfig {"AdditionalVersionWeights": {}}, or with a RoutingConfig that has no weights at all (what the Terraform AWS provider sends when a routing_config block is removed), was treated like an omitted RoutingConfig, so the alias kept its old weights. Both forms now clear the weighted routing; an UpdateAlias that omits RoutingConfig still leaves the weights unchanged, and weights that are not an object are refused with InvalidParameterValueException.

Closes #7890
2026-12-05 01:07:51 -04:00
Jackson PriceandAndre Kurait 5e3db32af6 test(codepipeline): wait for API results and queued events with Awaitility (#10212)
Use bounded waits for HTTP pipeline results, approval notifications and execution events. Keep the polling intervals, report timeouts by operation and return the response that satisfied each wait.

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-05 01:07:18 -04:00
XuJian 5a8a058f18 fix(apigateway): check the function policy of a WebSocket Lambda integration (#10179) 2026-12-05 00:48:17 -04:00
Hector Ventura e5cc6ea76c refactor(storage): merge the atomic batch methods into one StorageBackend.apply (#10194) 2026-12-05 00:36:10 -04:00
Murtuza Chhil eb2db42f57 docs(paymentcryptography): the AS2805 key cryptogram's byte layout (#10211)
The payment cryptography guide now publishes the AS2805 cryptogram's construction: "HDC2" || IV || TDES-CBC body || HMAC-SHA256 tag, the two derived keys and their labels, the first-byte variant, the raw check value of the original key and the algorithm name in the tag. A test reads a cryptogram the way another producer would, recomputing the tag and decrypting the body under the published labels, and checks the carried key and its check value.

Closes #10207
2026-12-05 00:30:22 -04:00
Murtuza Chhil f431247b5e fix(paymentcryptography): a key that carries no usage is refused (#10209) 2026-12-05 00:29:59 -04:00
Jimmy Liu Jia 693aed796e fix(cognito): reject admin confirmation outside unconfirmed state (#10186)
AdminConfirmSignUp confirmed an AdminCreateUser invitee in FORCE_CHANGE_PASSWORD, bypassing the first password change. AdminConfirmSignUp and ConfirmSignUp now share requireUnconfirmed with ResendConfirmationCode, answering NotAuthorizedException "User cannot be confirmed. Current status is X" under the user lock, before any code is consumed, the status changes or PostConfirmation fires.

Closes #10178
2026-12-05 00:29:39 -04:00
Priamo Germosen 0a8aaf9a19 fix(iam): check AWS Organizations requests on the resources they name (#10208)
Organizations was one of the namespaces the request-resources table left unread ("a later batch"), so every request
of it was checked on *: a grant scoped to an account's or an OU's ARN never matched, a deny scoped to one never held,
and an aws:ResourceTag condition read nothing. organizations joins the table now, so each request is checked on the
resources the Service Reference gives its action, read from the request.

An Organizations ARN carries the organization's id beside the id a request gives
(account/o-<organization>/<account id>), so the table fills one variable of it and asks the service for the rest.
OrganizationsStoredResourceArns finds the account, OU, root or policy a request names by its id alone in the caller's
organization, as the caller's handler finds it, and a handshake where the caller sent it or receives it: the account
it invites, any account for an invitation by email naming none, which may claim it, and each member for one enabling
all features, as AcceptHandshake lets them act on it. It answers the tags Organizations keeps on an account,
root, OU, policy or resource policy, matched on the whole ARN without moving it, which an aws:ResourceTag condition
reads. The lookups of an OU or a policy by its id in an organization move into organizationalUnitIn and policyIn,
beside accountIn, which DescribeOrganizationalUnit's and DescribePolicy's handlers and the new lookups share.

An organization's resources belong to its management account, so a member's request on one is judged across
accounts, the organization's resource policy deciding beside the member's own policies, as the existing
OrganizationsResourcePolicyProvider already supplies it. A handshake's recipient acts on it on its own policies: an
invitee belongs to no organization, and AcceptHandshake and DeclineHandshake are no actions a delegation policy grants
(the Organizations User Guide's supported delegation policy actions). So a handshake the caller receives is reached in
the management account (reachedInItsAccount), as a RAM invitation is, and the provider supplies no delegation policy
for it.

TagResource, UntagResource and ListTagsForResource, and the calls naming a parent or a target by its id (ListChildren,
ListPoliciesForTarget), are checked on *, and AttachPolicy and DetachPolicy on the policy alone, as the generated table
reads them.

IamRequestResourceEnforcementIntegrationTest checks, in an organization of its own, that a grant on one account's ARN
reads it by its id and refuses another, that an aws:ResourceTag condition reads the tags of an OU, that a member's
read of an OU is refused on its own grant alone and allowed where the organization's resource policy grants it too,
and that the account the organization invites reads the handshake on its own policy naming the handshake's ARN, with
that resource policy in place, and is refused on another. OrganizationsServiceTest checks each lookup for a member,
the management account, an outsider, an invitee, a claimant of an invitation by email and the members receiving a
handshake enabling all features, and the stored tags of each kind, the resource policy among them, against another
management account, organization, kind or service.
2026-12-05 00:27:28 -04:00
Jackson PriceandAndre Kurait c79107d96e test(iot): wait for fleet indexing to observe the MQTT disconnect (#10202)
Poll SearchIndex for the disconnected state after the local MQTT client disconnects. Keep the five-second deadline and identify the thing if the index never reports the change.

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-05 00:26:45 -04:00
Kenshin Okinaka 0046794c37 fix(athena): read a timestamp without a zone as UTC in AT TIME ZONE (#10204) 2026-12-05 00:18:01 -04:00
Jackson PriceandAndre Kurait 6498a1b773 test(codepipeline): share execution status waits across three suites (#10201)
The V2 conditions, GitHub source and retry/rollback suites now read GetPipelineExecution through one PipelineExecutionWaits helper and wait on it with Awaitility, replacing the V2 suite's sleep loop. Retry and rollback still wait for the worker to leave activeRuns before the next operation; each suite keeps its own deadline.

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-05 00:10:57 -04:00
Priamo Germosen 933e8523e6 fix(iam): check AWS Network Firewall requests on the resources they name (#10200)
Network Firewall was one of the namespaces the request-resources table left unread ("a later batch"), so every request
of it was checked on *: a grant scoped to a firewall's ARN never matched, a deny scoped to one never held, and an
aws:ResourceTag condition read nothing. network-firewall joins the table now, so each request is checked on the
resources the Service Reference gives its action, read from the request: a firewall or a firewall policy by its ARN
or by the name its ARN ends in (firewall/<name>, firewall-policy/<name>, as Floci mints them), a rule group by its ARN,
and a tag call on its ResourceArn. A rule group named by its name and type alone is checked on *, and CreateRuleGroup
on the rule group its SourceMetadata.SourceArn names or else on *, as the generated table reads them.

The generator stopped on network-firewall. with_through reads CreateFirewall's VpcId as naming a firewall, as the
model's VpcEndpointAssociation structure holds a VpcId beside a FirewallArn, and with_made then marked that through
row made, a key the table's own check refuses on a through row. A resource a create names through another member
exists already, as one it names by its ARN does, so with_made no longer marks a through row; no other namespace's rows
change. The VpcId row stands as generated: Network Firewall answers no through lookup, so it adds no resource.

NetworkFirewallStoredResourceArns answers the tags Network Firewall keeps on the firewall, firewall policy or rule
group an ARN names, read in the ARN's account without moving it, which an aws:ResourceTag condition reads. It finds
nothing: the table builds a firewall's or a policy's ARN from its name, the ARN Floci mints.

IamRequestResourceEnforcementIntegrationTest checks that with no grant a firewall's read is refused, that a grant on
one firewall's ARN reads it by its name and by its ARN and refuses another, that a deny on one refuses it beside an
allow on every resource, and that an aws:ResourceTag condition reads the tags of a firewall and of a firewall policy a
tag call names. It also checks that a grant on one rule group's ARN reads it and refuses another, and the same rule
group named by its name and type, and that CreateFirewall is refused on a grant on every firewall alone and runs with
one on the firewall policy it names beside it. NetworkFirewallStoredTagsTest checks the stored tags of each kind, in
another account too.
2026-12-04 22:59:38 -04:00
Jackson PriceandAndre Kurait 07f3dd3845 test(codepipeline): wait for rollback status and worker cleanup with Awaitility (#10199)
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-04 21:48:43 -04:00
Hector Ventura a0315d07f0 refactor(lifecycle): share one base for the background runtime-restore hooks (#10196)
The nine background runtime-restore hooks (Amazon MQ, DocumentDB, ElastiCache, ElastiCache Memcached, Kinesis Analytics, MemoryDB, MWAA, Neptune, OpenSearch) now extend one BackgroundRestoreStartupHook base and keep only their own name, order, enabled flag, restore call and failure message. The base logs failures under EmulatorLifecycle's category at error level with the stack trace; MemoryDB and the two ElastiCache hooks override the logging so every line stays as it was, ElastiCache using the parameterized warnv form. A unit test of the base covers a disabled service, a successful restore, a restore that does not block startup, a logged failure, a synchronous throw that fails startup, and an overridden log.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-12-04 21:48:26 -04:00
Jackson Price d6023f9873 test(rds): wait for backend reachability with the shared TCP probe (#10198) 2026-12-04 21:45:41 -04:00
Maddog2050 d9bb151b22 feat(dms): import, describe and delete certificates (#10159) 2026-12-04 20:36:18 -04:00
Allen Sanborn b655354ead fix(apigatewayv2): default ConnectionType to INTERNET and return WebSocket integration PassthroughBehavior and ContentHandlingStrategy (#10104) 2026-12-04 20:05:07 -04:00
Hector Ventura 2350eefb46 test(lifecycle): wait on the IMDS join, share LogCapture's listener and check the discovered hooks (#10197)
restoresEksClustersOnlyAfterALateImdsStartCompletes runs onHttpStart on its own thread and waits until it parks on the IMDS join instead of holding the start back with Thread.sleep. LogCapture.listenFromThisThread hands each record to a listener, so recordLifecycleLog no longer copies its handler. LifecycleHookDiscoveryIntegrationTest checks the hooks CDI discovers and that creating a startup or post-HTTP hook creates no service ahead of its step.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-12-04 20:04:45 -04:00
Jackson Price 770d6ebbda test(athena): read terminal query state under the writer lock (#10184) 2026-12-04 20:01:10 -04:00
Hector Ventura 1bff6ec758 test(core): drop the core boundary allowlist now that the boundary is enforced (#10195)
Now that the core boundary allowlist must stay empty, the allowlist file, its stale-entry test and the allowlist lookup can no longer change any outcome. Drop them and rename the check to coreBoundClassesReferenceNoAwsServiceCode; its failure message now points at giving the class a seam, or taking it off core-bound.txt.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-12-04 19:58:38 -04:00
Priamo Germosen de0b1dc485 feat(elasticache): emit the OpenTelemetry bandwidth limit of a node (#10193)
The ElastiCache metrics reference gives system.network.bandwidth.limit
as a vended Gauge in By/s: "The baseline network bandwidth for the
node's instance type. The limit is the same in each direction and
applies to each direction separately."

regen_elasticache_otel_metrics.py now also reads the user guide's
"Supported node types" page. It copies the baseline bandwidth in Gbps
of each node type its "Current Generation (Valkey)" tables list into
the vendored file. Only that section is read: the Memcached section
gives cache.r5.12xlarge 20 Gbps where the Valkey and Redis OSS
sections give 12.

The table converts each baseline to bytes a second, at 125000000 per
Gbps. A node emits the baseline of its group's node type, with no
attribute but valkey.role. A node type the page does not list for
Valkey emits none.

Closes #7030
2026-12-04 19:55:55 -04:00
Jackson Price c4288cdb5a test: share the TCP listener probe across four suites (#10182) 2026-12-04 19:47:05 -04:00
Priamo Germosen e50cdd5eb2 feat(elasticache): emit the OpenTelemetry network rates of a node (#10192)
The ElastiCache metrics reference gives system.network.io.rate and
system.network.packet.rate as exponential histograms: "The interface is
sampled once a second, and each datapoint is the distribution of those
per-second rates".

Each running node's container is now sampled through its Docker stats
stream, which sends a sample about once a second. Each sample and the
one before it give the bytes and packets per second in each direction,
summed over the container's interfaces. A rate metric's data point
drains the rates sampled since its previous one: on the minute when
vended, on every quarter when selected. A node that misses a tick
leaves its rates to its next data point.

The OTLP model Floci emits its own metrics through gains an exponential
histogram instrument. Values are bucketed at the greatest scale, from
20, that holds them in 160 buckets, with zeros in the zero count, and
emitted with delta temporality. The table now maps ExponentialHistogram
to that instrument.
2026-12-04 19:34:22 -04:00
Priamo Germosen 6efeea038f refactor(core): share the network totals of Docker stats samples (#10191)
EcsContainerManager turned two Docker stats samples into receive and
transmit byte rates with three private helpers: a counter summed over
every interface, its movement between the samples, and the seconds
between their read timestamps. ElastiCache's OpenTelemetry network
rates need the same from its nodes' samples, bytes and packets alike.

They move to core.common.docker.DockerStatsNetworks, unchanged, and
EcsContainerManager calls them there.
2026-12-04 19:04:57 -04:00
Priamo Germosen b353320dc9 feat(elasticache): emit the OpenTelemetry host metrics a node's kernel reports (#10190)
The ElastiCache metrics reference lists system.* and process.* metrics,
"reported by the operating system: system.* metrics describe the host as
a whole, and process.* metrics describe the Valkey process
specifically". Floci emitted none of them.

When a metric read from them is due, the publisher reads the kernel's
own files in the node's container with cat, run without a shell: the server process's
/proc/<pid>/stat, for the process id INFO gives, /proc/meminfo and
/proc/net/dev. NodeHost reads from them the major page faults, the
memory available without swapping, the swap in use, and the bytes and
packets each way on every interface but the loopback. process.cpu.time
is the main thread's, from INFO's used_cpu_user_main_thread and
used_cpu_sys_main_thread, as the page reports only the main thread.
system.network.allowance_exceeded is 0 for each reason, since Floci
sets no allowance on a node's network. A node whose host cannot be
read, as in an image with no cat, still emits its other metrics.

EngineNode carries the container id, and ElastiCacheContainerManager
reads the files. The network rates and the bandwidth limit come in
later parts.
2026-12-04 18:10:53 -04:00
Priamo Germosen 7007b5f7fc fix(cloudwatch): check cloudwatch:ResourceArn on the resource metrics configuration operations (#10188)
The Service Reference gives Create, Get, Update and
DeleteResourceMetricsConfiguration the condition key
cloudwatch:ResourceArn, which Floci never put in the request context, so
an Allow scoping them with ArnLike on it allowed nothing and a Deny
conditioned on it denied nothing.

regen_request_condition_keys.py opts cloudwatch in, reading the key from
the ResourceArn member each request carries, as it reads redshift:DbUser
from DbUser, and request-condition-keys.json is regenerated. botocore
models CloudWatch in smithy-rpc-v2-cbor, which the request condition
reader did not read; it now reads such a namespace's request in the
protocol it arrives in, a Query form, or a JSON or CBOR body, as
CloudWatch takes all three.
2026-12-04 17:45:23 -04:00
Priamo Germosen bcd1317202 fix(cloudformation): check the list sizes and unique items a resource schema declares (#10187)
A resource handler's model validation checks a list's minItems, maxItems
and uniqueItems as it checks a string's length and pattern, so AWS fails
an AWS::CloudWatch::ResourceMetricsConfiguration with two
MetricSelections before anything is configured. Floci vendored only the
string constraints, so such a template reached the service, and the
OTelEnrichment provisioner checked uniqueItems by hand.

regen_cfn_property_types.py now vendors minItems, maxItems and
uniqueItems on every list, with --check anchors for the CloudWatch lists,
and cfn-property-types.json is regenerated (no other drift).
CfnPropertyTypes.HandlerReader checks them with the schema validator's
messages and order: too few, too many, then two the same, ahead of the
list's items. "Model validation failed (#/MetricSelections: expected
maximum item count: 1, found: 2)". Items are compared once intrinsic
functions are resolved and values converted. The ECS handler, which
already takes members the schema does not declare, checks none of them.
The OTelEnrichment provisioner's own uniqueness check is removed.

Items are keyed by their JSON with sorted members, not held in a set of
nodes, which slows to comparing each item with every colliding one when
a template makes their hashes collide. S3CfnProvisioner's uniqueness
check now shares this one.
2026-12-04 17:07:17 -04:00
Priamo Germosen bf7af5ca50 fix(iam): check Amazon DLM by its generated routes, resources, passed roles and tags (#10183)
Under enforcement a REST route no vendored model names runs unchecked, and DLM was among them: any caller could
create, read, update or delete a lifecycle policy and read or change its tags with no permission at all. DLM's model is
vendored now (regen_rest_routes.MODELS: dlm), so each request is checked as its operation's action, and dlm joins the
generated tables of request resources, passed roles and tags on create: the tag routes on the policy their path's ARN
names, the role CreateLifecyclePolicy and UpdateLifecyclePolicy pass in ExecutionRoleArn, and the tags a create
carries, which need dlm:TagResource.

The routes naming a policy by its PolicyId (GetLifecyclePolicy, UpdateLifecyclePolicy, DeleteLifecyclePolicy) are
checked on *, as the generated table reads them: a policy's ARN is policy/${ResourceName}, a name variable, which the
rule's compatible() keeps an id member from filling. CreateLifecyclePolicy's tags are checked on the policy the table
fills from DefaultPolicy, and on * when the request leaves it out.

DlmStoredResourceArns answers the tags DLM holds on the policy an ARN names, read in the ARN's account and Region by
the id it ends in without moving it and matched on the whole ARN, which an aws:ResourceTag condition reads. A namespace
the table reads is served on its tag routes only at the ARN its path encodes, so DlmIntegrationTest sends the ARN
encoded, as the SDKs do, and docs/services/dlm.md says so.

IamRestRouteEnforcementIntegrationTest checks that with no grant a policy's tags are refused, that a grant on one
policy's ARN reads them and refuses another's, that a deny on one policy's ARN refuses it and leaves another, that an
aws:ResourceTag condition reads a policy's tags, that GetLifecyclePolicy is checked on *, and that a create needs
iam:PassRole on its execution role and dlm:TagResource for the tags it carries.
2026-12-04 16:52:51 -04:00
Priamo Germosen 54ac584a74 fix(cloudwatch): refuse two OTel enrichment selectors for one namespace in a list (#10185)
The AWS::CloudWatch::OTelEnrichment resource schema says the service
"rejects more than one selector for the same namespace within a
direction". Floci stored both selectors, so IncludeFilters naming
AWS/SQS twice started enrichment with a filter AWS refuses.

StartOTelEnrichment and UpdateOTelEnrichment, over Query, JSON, CBOR and
CloudFormation, now refuse such a list with ValidationError (400), after
the model's constraints and the combined cap of 100 selectors, and
change nothing. AWS quotes no message for it, so the message is that
schema's own sentence. Namespaces match exactly and case-sensitively,
and one namespace may still sit in both lists, where ExcludeFilters
wins.

A CloudFormation rollback puts back the filters a failed update replaced
through OTelEnrichmentService.restore, which skips these checks, as the
filters were accepted when written: an enrichment an older Floci stored
still rolls back, as PipesService.restorePipe does for a pipe.
2026-12-04 16:35:20 -04:00
Priamo Germosen 631f2eface fix(cloudwatch): read every member of a Query list past a gap (#10177)
The CloudWatch Query handler read most lists by counting up from
member.1 and stopping at the first index the request left out, so
AlarmNames.member.1 and AlarmNames.member.3 deleted only the first
alarm, and a datum's third dimension, a GetMetricData query numbered 3
after 1, or an alarm metric numbered 2 were dropped without a word.

Every list now reads through AwsQueryLists, which takes every index the
request numbers, in order: Statistics, AlarmNames, AlarmTypes, TagKeys,
DashboardNames, Names, the alarm actions, Tags, dimensions, metric data
queries, alarm metrics, stream filters and statistics configurations. A
member without its key field is skipped rather than ending the list.

A list nested in each member is read from that member's own keys, which
AwsQueryLists.keysByMember groups in one pass, so a large request is not
scanned again for every member.

IAM reads the request the same way, so it checks what the handler acts
on: RequestResources reads a CloudWatch form's lists past a gap, as its
handler does, while ELBv2's stops at the first missing index, as its
handler does; and TagOnCreate reads CloudWatch's Tags through
AwsQueryLists, so a tag past a gap is a request tag, and a policy
requiring it no longer refuses an alarm that gets it.
2026-12-04 16:04:02 -04:00
Jackson PriceandAndre Kurait 58e2e78077 test(athena): report unexpected terminal query states immediately (#10176)
Wait through queued and running states in the test thread. Report the actual terminal result as soon as the query finishes.

Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-04 15:43:37 -04:00
Jackson PriceandAndre Kurait 63ae18c3de test(tls): wait for the loopback listener with Awaitility (#10175)
Use the existing bounded socket probe to poll the IPv4 listener. Keep the startup deadline and include the port in a timeout.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
2026-12-04 15:31:39 -04:00
Priamo Germosen cf50025eaa fix(iam): check Amazon MQ by its generated routes, resources and tags (#10172)
Under enforcement a REST route no vendored model names runs unchecked, and Amazon MQ was among them: any caller could
list, create, describe, reboot or delete a broker with no permission at all. MQ's model is vendored now
(regen_rest_routes.MODELS: mq), so each request is checked as its operation's action, and mq joins the generated
tables of request resources, passed roles and tags on create: a broker by the id its path gives, a configuration by
its id, and the tags a create carries, which need mq:CreateTags on the broker of the name it gives. The Service
Reference passes a role to mq.amazonaws.com on CreateBroker and UpdateBroker, which the rule reads from
LdapServerMetadata's roleName and userRoleName by their names. AWS gives LDAP metadata to ActiveMQ brokers alone, which
Floci does not create, and Floci serves no UpdateBroker, so the reading reaches no request Floci serves.

A broker's ARN is broker:${BrokerName}:${BrokerId}, and MQ's requests name a broker by its id alone, so the table
fills only BrokerId, and the reader asks the namespace's service for the resource of the one variable a request fills,
as it does for any type. AmazonMqStoredResourceArns answers it with the caller's broker of the id in the Region, so the
request is checked on the broker's whole ARN rather than broker:*:<id>, which no policy naming a broker matches. It also
answers the tags MQ holds on the broker an ARN names, read in the ARN's account and Region by the id it ends in and
matched on the whole ARN, neither read moving a stored broker.

The table also takes the Service Reference's change to SES since main's sync: TagResource, UntagResource and
ListTagsForResource now act on a multi-region-endpoint too, which the drift check of a change to the table requires.

IamRestRouteEnforcementIntegrationTest checks that with no grant a broker's read is refused, that a grant on one
broker's ARN reads it and refuses another, that a deny on one broker's ARN refuses it and leaves another, that an
aws:ResourceTag condition reads a broker's tags, and that a create carrying tags needs mq:CreateTags on the broker of
its name.
2026-12-04 15:20:38 -04:00
Jeremy Chapeau 743c44a0a4 fix(cloudtrail): record callers as CloudTrail's userIdentity types (#10101)
CloudTrail types the caller as Root for the account's credentials,
IAMUser for a user's key, AssumedRole for a role session and
FederatedUser for a federation token. Floci recorded the account root as
an IAMUser named root, and every session as an unknown "anonymous" user.
The account's credentials are now Root, with the account as principalId
and no userName; a role session is AssumedRole, with the role as its
sessionIssuer and the session's creationDate; a session a user's
GetSessionToken issued is that IAMUser.

Every temporary credential now carries its sessionContext attributes,
creationDate and mfaAuthenticated, which is true for a GetSessionToken
session opened with an MFA code. A session opened with a source identity
names it in sessionContext.sourceIdentity. A federation token's
sessionIssuer is the root or the IAM user that called
GetFederationToken. A session opened with AssumeRoleWithWebIdentity
names its identity provider in webIdFederationData. The root of an
account with an alias is named by it in userName.

Credentials GetDelegatedAccessToken exchanged for a request a role
approved now carry the role session's ID, "role-id:session-name", as
their aws:userid and CloudTrail principalId, with the role's ID as the
sessionIssuer's principalId.
2026-12-04 15:12:13 -04:00
Jeremy Chapeau 7be7949c06 fix(kms): answer ScheduleKeyDeletion with KeyState and PendingWindowInDays (#10099) 2026-12-04 15:11:56 -04:00
Priamo Germosen 817fd45089 test(cloudwatch): wait for the slow account's turn before the next tick (#10174)
AlarmEvaluator takes an account when it hands the account's turn to the
PromQL pool, but the turn's first query starts only when a pool thread
picks it up. anAccountWhoseQueriesAreSlowHoldsOneThreadAndDelaysNoOtherAlarm
ran the second tick as soon as the quick account's query had run, so on a
busy runner the slow account's thread could still be waiting to start,
and the check that its query ran exactly once saw 0.

The test now waits for the slow query to start before the second tick,
so the tick always meets the account still taken.
2026-12-04 14:52:39 -04:00
XuJian b365917f01 fix(route53): refuse a record set type given without a name (#10169)
The reference pairs StartRecordType with StartRecordName, so a type on its own has no name to refine
and AWS answers that request with InvalidInput. Floci read the type only inside the branch that runs
when a name is present, which dropped an unpaired type and listed the whole zone instead.

The check goes at the request boundary, beside the other Route 53 parameter constraints, because the
service already handles a type correctly once a name is given with it.

Closes #10167
2026-12-04 14:38:20 -04:00
Maddog2050 6e71231b98 fix(docdb): return cluster and instance AvailabilityZones as AWS does (#10166) 2026-12-04 14:35:09 -04:00
Priamo Germosen bea07871fb feat(elasticache): emit Valkey replication groups' OpenTelemetry metrics to CloudWatch (#10173)
Node-based Valkey replication groups emit the OpenTelemetry metrics of
the ElastiCache user guide's metrics reference to CloudWatch, where
PromQL reads them: the vended metrics every 60 seconds, and those a
resource metrics configuration selects every 15 seconds as detailed.
Each node's INFO is read straight from its server, as the backend's
administrator once a user group has turned the default user off, and
each command's type and category come from COMMAND INFO and COMMAND
DOCS.

The metric table is vendored from the reference page by
regen_elasticache_otel_metrics.py, checked by aws-data-check and the
drift workflow. VendedOtlpMetrics stores the export requests for the
account and Region. Emission is off by default behind
FLOCI_SERVICES_ELASTICACHE_OTEL_METRICS_ENABLED, since each node adds
about 8 KB to the OTLP store every minute.

Part of #7030.
2026-12-04 14:17:30 -04:00
XuJian c8bd295a4e fix(route53resolver): filter and page the endpoint and association listings (#10136) 2026-12-04 14:15:05 -04:00
Jackson PriceandAndre Kurait 3c1f07307a test(eventbridge): verify the token request when OAuth authorization fails (#10161)
Check that the token endpoint received the request before asserting that the destination received no event. An unmatched rule used to pass this test.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
2026-12-04 14:02:37 -04:00
Jackson PriceandAndre Kurait 174741682a test(tls): check disabled and refused listeners before network setup (#10162)
Check that a disabled or refused proxy leaves Vert.x untouched. Both tests used to claim an unused port and probe it after a fixed delay.

Co-authored-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
2026-12-04 14:01:57 -04:00