The archive of a cluster's YARN container logs was covered by
EmrClusterStorageTest only. The Docker case that runs a Spark step in
either deploy mode now gives its cluster a LogUri, and checks that the
cluster-mode driver's own output, which the step's logs do not hold, is
in a container's stdout.gz under
<LogUri>/<cluster-id>/containers/<application>/<container>/, where a
user reads it.
Reading a gzipped object back from S3 was private to two Docker classes
already; it is now S3TestClients.gunzipped, which those two use too.
Every step on a cluster with Hive on emr-6.14.0 failed, as making the
image such a cluster runs in copied /etc/tez-ui, which that release's
Hive image doesn't have.
The folder holds only the Tez UI's configs.js, and nothing in Floci
serves the Tez UI, so it is no longer copied. On later releases, the
Tez UI's link to it is left dangling, in a folder Tez skips.
A bucket request that names a sub-resource Floci does not serve fell through
to the bucket's own operation: DELETE ?metadataConfiguration and
?metadataTable deleted an empty bucket, GET ?abac and ?metadataTable listed
it, PUT ?abac created a bucket that did not exist, and HEAD ?acl ran
HeadBucket. The same happened to a sub-resource sent with a method AWS defines
none for, such as DELETE ?versioning. A POST naming one got a 400 asking for
?delete, and no IAM check at all.
The bucket handlers, HEAD and POST among them, now refuse such a request
where they would have run the bucket's operation. A sub-resource the AWS model
defines for the method is answered 501 NotImplemented, and one it defines for
other methods only 405 MethodNotAllowed, as DELETE ?accelerate already was.
A browser-form upload and DeleteObjects still run first on a POST. The
sub-resources are read from botocore's S3 model in the vendored
rest-routes.json, so one AWS adds is refused once the table is regenerated,
not run as the bucket, and their names from the parsed query parameters, so
an escaped & inside a value, ?prefix=reports%26abac, names none. The IAM
check matches: an unserved sub-resource is checked as the action the Service
Reference gives the operation it names (DELETE ?metadataTable needs
s3:DeleteBucketMetadataTableConfiguration, not s3:DeleteBucket, and
POST ?metadataTable s3:CreateBucketMetadataTableConfiguration), which lets
the route coverage test drop the two operations it exempted.
A key made only of slashes was read as the bucket too: JAX-RS collapses
PUT /bucket// to the bucket's path, so it ran CreateBucket and was checked as
s3:CreateBucket, where it writes the key "/". A filter now escapes such a
key's slashes in the path the router matches, path-style and virtual-hosted,
so S3 and the IAM check both act on the object, arn:aws:s3:::bucket//. One
trailing slash, /bucket/, is still the bucket.
The resource ARN a request is checked against read the same collapsed path,
which named another object whenever a key carried a slash of its own.
PUT /bucket//email.txt stores the key "/email.txt" and the controller and the
condition resolver both read it that way, from the path as it arrived, while
the ARN came out as arn:aws:s3:::bucket/email.txt: a grant on that object
covered this one, and a statement naming bucket//* matched nothing it names.
A key with a double slash inside it, a//b.txt, was checked as a/b.txt the
same way. The ARN is now built from the key those two already read, through
one reader the three share, so the object stored, the object a condition
describes and the object a policy is matched against are the same one. An S3
Control operation, told apart by the operation as before and not by its path,
names no object and is left as it was: the ARN in its path is still taken as
written.
A job failure (SQLState 42xx or 0A000) cannot clear on its own, so re-marking the bucket made every sweep reconnect and log a WARN. The job now waits for the next upload. The predicate is shared with CopyJobRunner via S3TransferException.isJobFailure.
* fix(dynamodb): honor OR in legacy Query and Scan filters
Pass ConditionalOperator to the shared legacy read-filter evaluator while retaining default AND behavior and read-before-filter pagination. Reuse one nested-map fixture builder for the four existing expressions. Separate follow-up requested in upstream #8023.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(dynamodb): validate legacy binary filters before matching
Validate every legacy QueryFilter and ScanFilter binary operand through the existing attribute validator before evaluating items. Keep ConditionalOperator validation first and retain valid-filter short circuit behavior. Add actual JSON wire invalid and valid binary controls.
Signed-off-by: Andre Kurait <akurait@amazon.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
* feat(redshift-serverless): allow cross-account restore of a snapshot its policy shares (#7801)
RestoreFromSnapshot with an ownerAccount other than the caller's now reads the
snapshot from the owner's account and evaluates its resource policy for
redshift-serverless:RestoreFromSnapshot. A policy that allows the caller or the
caller's account grants the restore, an explicit Deny wins, and a snapshot with
no policy is not shared (AccessDeniedException). The dump is read from the
owner's directory and the restore targets the caller's namespace and workgroup.
* fix(redshift-serverless): restore a shared snapshot by the owner's ARN and check its policy under the service lock
A cross-account RestoreFromSnapshot with the owner's snapshotArn failed validation
because only the caller's account was accepted. The snapshot and its policy were also
checked before the service lock was taken, so a deletion, expiry or policy revocation
could land between the check and the restore. The check now runs under the lock.
* fix(redshift-serverless): evaluate a shared snapshot's policy through a ResourcePolicyProvider (#7801)
Move the snapshot policy check out of the service and into IAM enforcement, as SQS, SNS and S3 do:
- RedshiftServerlessResourcePolicyProvider supplies the snapshot's policy and the account in its ARN.
A statement with no Resource, as in AWS's own PutResourcePolicy example, applies to the snapshot.
- redshift-serverless leaves NOT_COVERED: namespaces, workgroups and snapshots are found by name through
StoredResourceArns, and RestoreFromSnapshot and GetSnapshot name the owner's snapshot when ownerAccount is set.
- Drop RedshiftServerlessSharedSnapshots and the snapshot-taking restoreFromSharedSnapshot overload.
* fix(redshift-serverless): derive snapshot account from the generator and find endpoint access ARNs (#7801)
Take ownerAccount as an account member in the request-resources generator and honor
account on found resources, replacing the hand-written CORRECTIONS entries and the
two-name branch in find. Answer endpointAccess in find. Share one call in
handleRestoreFromSnapshot.
* fix: derive account members from service models and reuse endpoint lookup
Migrate the four remaining DNS query builders to DnsTestQuery.query. Preserve each query type and transaction ID, packet transport, and all existing assertions. Separate follow-up requested in review of #7988.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Bind the embedded DNS listener to the advertised address so connected resolvers accept replies on multi-interface hosts. Preserve the current network-selection behavior.
Ensure the test-owned Vert.x instance is closed even if closing its DNS socket fails. Preserve all UDP source assertions.
Extract a package-private query helper accepting name, type and transaction ID and use it in the reply-source regression. Preserve production DNS behavior and all existing assertions.
Signed-off-by: Andre Kurait <akurait@amazon.com>
UpdateItem applied the paths of a REMOVE clause one after another, so removing
L[0] shifted the list and L[2] then named a different element or none at all.
Every action in an update expression addresses the item as it was before the
update, so remove a list's higher indexes first.
Closes#7971
X-Ray is the one AWS service local stacks ask for and Floci does not have: SQS
and SNS already carry AWSTraceHeader, and nothing on the other end accepts the
segments that header points at. This serves the ingest loop, the summaries that
read it back, the service graph a console draws from it, and the sampling the
X-Ray daemon polls on its own timers.
The API is REST JSON on literal paths (/TraceSegments, /Traces, /TraceSummaries,
/ServiceGraph, /TraceGraph, /GetSamplingRules, ...), which S3's path-style routes
would swallow as a bucket name, so a request signed for the xray credential scope
is rewritten onto an internal prefix and every other request keeps its path. Only
the paths Floci serves are claimed.
What Floci stores is the segment document as sent: BatchGetTraces has to answer
exactly what PutTraceSegments accepted, so re-serialising through a model would
change what the caller reads. The summaries and the graph parse those documents
on read, which keeps the stored bytes the caller's and costs nothing while a local
stack is idle.
A filter expression is parsed, not pattern-matched: service("name"), hasError,
hasFault, hasThrottle, duration, responsetime, http.status, annotation.key,
comparisons, AND, OR, NOT and parentheses. Anything outside that set is refused
with InvalidRequestException naming what it could not read, because accepting a
filter and ignoring half of it hands a caller a superset and looks like a pass. A
lone '!' is refused the same way rather than left as a delimiter no branch
consumes, and responsetime is compared in seconds, the unit AWS uses.
The graph collapses segments into services by name, derives edges from parent ids,
and reports AWS's SummaryStatistics and cumulative DurationHistogram per node and
per edge. A node is a service, not a document shape: the same service seen once
with an http block and once without is one node.
Sampling answers the Default rule AWS serves in every Region, so a daemon has
something to sample at before any rule exists, and five rules per Region on top of
it. It is answered, not adapted: the reservoir is reported as the quota and
renewed every 10 seconds rather than decremented per report, and the service page
says so.
A local emulator runs for days, so the store is bounded to 10000 traces per Region
with AWS's 30 day window, oldest evicted first. A bad document is reported under
UnprocessedTraceSegments with its reason instead of failing the whole call, and
100 documents per call is the AWS limit, enforced.
Co-authored-by: David Guardiola <davidguardiola@gmail.com>
* fix(apigateway): key stage method settings by the patch path as sent
UpdateStage decoded the JSON Pointer escapes in a method-settings patch
path before using it as the methodSettings key, so
/~1webhook~1status/POST/logging/loglevel was stored as
webhook/status/POST. API Gateway keeps the path as written and GetStage
reports ~1webhook~1status/POST, which is the key the Terraform provider
looks up for aws_api_gateway_method_settings; on Floci the lookup found
nothing and the read failed with "empty result".
The method-settings key is now the patch path between the leading slash
and the setting name, unchanged, so the escaped and plain spellings each
round-trip under the key the client sent.
* fix(apigateway): find escaped method-settings keys at invoke time
Method settings are now stored under the patch path as sent, so a
caching patch to /~1widget/GET/caching/enabled lands under ~1widget/GET.
The invoke-time lookup only tried the decoded resource path (widget/GET)
and fell through to */*, so caching enabled that way never applied.
methodSettingFor now tries the JSON Pointer escaped resource path first,
then the plain path, then the */* wildcard.
* style(apigateway): brace single-line ifs in method-settings lookup
CreateIntegration, UpdateIntegration, GetIntegration(s), OpenAPI import and
AWS::ApiGatewayV2::Integration now carry IntegrationSubtype. A subtype is
accepted only on an HTTP API AWS_PROXY integration with payload format 1.0
(the default when a subtype is set), and its RequestParameters must map every
required member of the action and nothing it does not take. SQS-SendMessage is
the supported subtype. The JSON 1.1 path keeps RequestParameters keys as sent,
since subtype parameters are PascalCase member names.
An HTTP API route whose AWS_PROXY integration has an IntegrationSubtype now
runs that AWS service action instead of resolving a Lambda function from the
integration URI. RequestParameters are mapped at invoke time: static values,
whole expressions such as $request.body, $request.body.<JSONPath>,
$request.header/querystring/path, $context and $stageVariables, and
expressions embedded as ${request.header.X}. Region selects the action's
region. A required parameter that maps to nothing answers 400
MissingParameter. The response is 200 with the action's result in the
<Action>Response/<Action>Result envelope; an action error keeps its status.
Lambda AWS_PROXY and HTTP_PROXY dispatch are unchanged.
Every subtype AWS defines is now known, with its required and optional parameters from the AWS reference, so create and update validate all of them instead of rejecting the ones Floci does not invoke. Only SQS-SendMessage carries a service action.
The subtype check is a package-private static method, and OpenAPI import and reimport run it over every x-amazon-apigateway-integration while planning, before any route or integration is deleted or created.
$request.body.<path> read a scalar through json-path as a JsonNode and threw ClassCastException, which escaped as a 500. The value is now read as an Object and converted, and resolution runs inside the dispatch error handling.
MessageAttributes and MessageSystemAttributes are parsed as JSON templates first and expressions are resolved only inside their string values, so a header holding quotes or braces stays one literal string instead of adding attributes.
Subtype parameters also resolve accountId, apiId, domainName, httpMethod, path, requestTime, requestTimeEpoch, routeKey and stage from $context. A subtype without a service action answers 500 at invoke.
UpdateIntegration keeps a field the request leaves out, so an AWS::ApiGatewayV2::Integration update that drops IntegrationSubtype kept the old one. The provisioner now clears it explicitly, records the prior subtype in the rollback snapshot and restores it when the update fails.
A number or boolean value is read as its text, and an object or array value is a 400 BadRequestException instead of an unchecked conversion error.
Adds invoke cases for $request.body.<field>, a header that tries to break out of its MessageAttributes value, and $context variables; a stored-but-not-invoked SQS-PurgeQueue integration; a reimport with an invalid subtype that leaves the API unchanged; and number and object RequestParameters values on the JSON protocol. Queue creation now sits inside the cleanup block.
A MessageAttributes or MessageSystemAttributes value that does not parse as a JSON object was interpolated as raw text, so a request value could add or change members of the attributes object. It is now an InvalidParameterValue 400; whole source expressions such as $request.body.attributes or ${request.body.attributes} still resolve as before.
- A required parameter mapped to null or a blank string is rejected like a missing one.
- A MessageAttributes or MessageSystemAttributes value must be a JSON object or a source expression.
- Number and boolean RequestParameters values sent to the REST endpoints are read as text, and object or array values are a 400 instead of a ClassCastException.
- UpdateIntegration that adds a subtype to an integration without one, and sends no PayloadFormatVersion, stores 1.0 as CreateIntegration does.
- The create, update and OpenAPI import paths share one payload format default.
- $context.requestId is the request's gateway id, honouring a valid x-amzn-RequestId override, instead of a fresh UUID.
- $context.domainName is the Host the request arrived on, falling back to the execute-api host, and $context.domainPrefix, extendedRequestId and protocol resolve.
- $context.path carries the stage prefix for a named stage, as HTTP API authorizer identity sources do.
- An integration without a Region parameter calls the service in the API's region, or the default region when the request carried none.
An x-amazon-apigateway-integration in an AWS::ApiGatewayV2::Api Body dropped integrationSubtype and requestParameters, so the API was created with a plain AWS_PROXY integration that never reached the service action. Both are now passed to CreateIntegration, which validates them as it does for every other caller. The PayloadFormatVersion default for AWS::ApiGatewayV2::Integration uses the shared helper.
The rollback snapshot restored the subtype only when the integration had one, so a failed update that added a subtype left it in place. The snapshot's subtype is now restored as recorded, null included, and a subtype change no longer marks the update as one whose other fields cannot be rolled back.
The template reader now fails on trailing tokens, so a value such as {"a":1} trailing no longer passes CreateIntegration and then has its tail dropped. The call-time check on a resolved JSON parameter uses the same reader instead of the application ObjectMapper, so create and invoke accept the same values.
A parameter value starting with $ was taken as an expression even when it named no source, such as "$5 off" or the typo $request.heder.x, so it passed CreateIntegration and resolved to nothing on every call. CreateIntegration, UpdateIntegration and OpenAPI import now answer it with a BadRequestException. The accepted sources are $request.header., $request.querystring., $request.path., $request.body and $request.body., $context. and $stageVariables., checked for a whole-value expression, each embedded ${...} expression, and the string values of a JSON parameter's object. A $ elsewhere in a value stays static text, so mixed templates are unchanged.
UpdateIntegration replaced RequestParameters wholesale, so an update that
set one optional parameter on an SQS-SendMessage integration dropped
QueueUrl and MessageBody and then failed the required-parameter check.
AWS merges: a named key is added or replaced, a key sent as an empty
string is removed, and an omitted key is kept. The merge applies to every
HTTP API integration, and the subtype check runs on the merged map.
The AWS::ApiGatewayV2::Api Body path passed requestParameters through as
objects, so an object-valued MessageAttributes was rejected as not a
string. It now reads every value with the importer's own conversion: a
number or boolean as its text, and an object or array as its JSON text.
A whitespace-only value is a valid SQS message body, and how API Gateway
treats one is unmeasured, so create now applies the same isEmpty check
invoke does instead of rejecting blank values.
ApiGatewayV2Service.stringParameters already reads number and boolean values as text and rejects object and array values, so the handler no longer converts them too.
* fix(dynamodb): list every CreateTable constraint error in one message
DynamoDB checks the members of a CreateTable request in a fixed order,
whatever order the request gives them: GlobalSecondaryIndexes,
BillingMode, SSESpecification, KeySchema, ProvisionedThroughput,
StreamSpecification, AttributeDefinitions and LocalSecondaryIndexes.
It lists every constraint error in one ValidationException and reports
the first 10. An index name gets its length error before its pattern
error.
* fix(dynamodb): count null list members in CreateTable constraint positions
DynamoDB skips a null list member in the CreateTable constraint checks,
but it still counts it in the positions and in the list length. So
[null] is not an empty list. A quoted NonKeyAttributes list shows the
member as null.
* fix(dynamodb): refuse an empty CreateTable KMSMasterKeyId
DynamoDB refuses a KMSMasterKeyId outside 1 to 2048 characters, counted
in code points, though the API reference gives no length for it.
The billing mode and SSE type checks now print their enum sets from the
same ordered lists as the CreateTable constraint checks.
An AWS::RDS::DBInstance created through CloudFormation never received
its VPCSecurityGroups or StorageEncrypted, so describe-db-instances
showed neither. Both now reach the instance on create.
A stack update that changes the groups moves the instance to them in
place, and one that drops them puts a standalone instance on its VPC's
default group, as AWS does; a cluster member keeps its groups. A
rollback puts the previous groups back. StorageEncrypted can only be
set at create, so changing or dropping it replaces the instance: the
old one is deleted once the update commits and kept when it rolls
back. A custom-named instance refuses the change, as on AWS.
Part of #7603
The rollback test of a security group change now starts from two groups
and from none, as well as from one, so a saved list that kept only its
last group, or saved nothing for an instance that had none, fails it.
The line that saves the list now creates the array first, which reads
more plainly.
The docs and the encryption record's Javadoc now say that an instance
created before StorageEncrypted was applied, whose template sets it
through a parameter, does not see a change made only through that
parameter on its first update, as Ec2Tags.ownedKeys already notes for
tags.
The DB instance and DB cluster arms refuse a custom-named replacement
through CfnExceptions.customNamedReplacement, and the private copy is
gone.
The DB cluster's createOnly record and the AssociatedRoles record are
CreateOnlyInputs constants now, beside the DB instance's encryption
record, so all three are read, written, put back on a rollback and
cleared on commit through it. The attribute names are unchanged, so a
stack created before keeps its records, and an update that leaves the
cluster record as it was still saves no copy of it.
One thing changes with it: the roles record an update overwrites is now
saved every time, where it used to be saved only when no saved copy was
there. A committed in-place update used to leave that copy on the
resource, so a stack from then could have its roles record rolled back
to an older one by the first update that fails; a test covers it.
The encryption record's Javadoc and the docs now say that the previous
template resolves on the update, so a change made only through a
parameter, or anything else the update changes, is not seen.
An update whose template changed a cluster member's VPCSecurityGroups
moved the member to the new groups. On AWS the handler sends that change
to ModifyDBInstance and RDS refuses it for a member, whose groups are
its cluster's, so the update fails. It now fails the same way, with
InvalidParameterCombination and RDS's message, before anything on the
instance changes.
The change is read from the template, as AWS's handler reads it, so a
member whose list stays the same still updates, including one a stack
created before Floci applied the groups. Refusing the property outright
would fail a list that matches the cluster's, which the schema allows.
A Hive step or an EMR Serverless Hive run on a table in S3 failed on
emr-6.15.0 with NoSuchFieldError: AWS_S3_DISABLE_EXPRESS_SESSION_AUTH as
soon as S3A built its client.
Those images' Hive lib folder has the stock AWS SDK v2 modules, and the
S3 client is only in Tez's plug-in, EMR's own build of the SDK, later on
the class path, so that client ran on the stock sdk-core.
The modules the plug-in also holds now go, by name, before Hive starts,
while the container is still root: in a Hive run's wrapper, and in the
primary node's script, as the metastore service opens a table's S3
location with S3A too. An image with no loose sdk-core, as emr-7.5.0 and
emr-7.10.0 have, or without the plug-in keeps every jar.
partition.sh balances shards by class count, which says nothing of how
long a class runs. EmrDockerRunnerDockerIntegrationTest and
EmrHiveStepsDockerIntegrationTest take about 540s between them, so the
shard holding them ran 1246s of Surefire's 1500s while the others ran
641s to 869s, and one run has already been cut at the limit.
- SLOW_CLASSES gives the seconds of those two, by class name, so a
package rename leaves them alone. A class counts for that many average
classes, and every other class counts as one, so with none listed the
assignment is what it was.
- Groups are packed heaviest first by that weight rather than by their
number of classes, and a slow class without a profile goes before the
others, so the rest are placed around them.
- A name that no longer matches a class is an annotation, not a failure,
as a stale key is for the image prefetch: the shards are only uneven.
Summing the 2026-11-09 run's class timings over the classes at this
commit, the slowest shard goes from 1136s to 989s. A profile of its own
for the EMR classes gave 1321s and a sixth shard 1117s, as neither tells
the partition that those classes are slow.
Under enforcement a REST route no rule maps and no vendored model names
runs unchecked. Lake Formation, Macie and Inspector were among those:
of their 33 served routes only Inspector's Disable had a rule, added by
hand. AWS's Service Reference gives 32 of those 33 actions no resource
type, so each is authorized on "*", which is what the route join added
in #7461 already checks when the model is vendored.
Vendors the three models, so all 33 are checked as their operation's
action. A caller holding no grant for them is now refused where the
request used to pass; that is the behaviour change.
The 33rd is Macie's CreateMember, on the POST /members it shares with
Security Hub, which AWS authorizes on the member it makes and with the
tags it carries. A correction fills the member from account.accountId,
so a grant or a deny scoped to one member holds, and Macie joins the
tag-on-create table, so a request with tags needs macie2:TagResource
and its tags are what aws:RequestTag and aws:TagKeys see.
Inspector's Disable rule goes, since the vendored route gives the same
action. Macie and Inspector move into the table of request resources,
their reason for staying out (no model vendored) no longer being true.
Lake Formation has no resource type at all, so that table does not
list it.
Regenerating the tables also brings in es:UpdateClone, which AWS has
added since. Floci does not serve it.
`SimulatePrincipalPolicy`'s `PolicyExclusionList` was read by nothing, so a caller
excluding a policy was given a simulation that still counted it, which is the
decision it had asked not to be given. The member is read now: each
`PolicyIdentifier` drops a policy from the set this one simulation evaluates and
from nothing else, the attachment and every listing left as they were.
The reference states both answers an entry gets, and those are the answers here:
"Syntactically invalid identifiers, such as malformed ARNs or wildcards in
disallowed positions, cause the request to fail with an InvalidInput error.
Syntactically valid identifiers that don't match any attached policy are
ignored." The constraints ahead of the operation already hold each member of an
entry to the shape the model declares, so an unknown `PolicyType` is the
`ValidationError` it always was; what the vendored data does not carry is the
union marker, so the rule that an entry names exactly one of the three is held
where the entry is read.
A `PolicyArn` is held to the one position the member admits a wildcard in, the
resource name, so a wildcard in the resource type an ARN carries ahead of it is
refused rather than matched: a `poli?y/reader` reads like the `policy/reader` it
would reach. It is held to carrying the fields every ARN carries too, its
partition, its service and its resource, a blank one being a malformed ARN rather
than an identifier that matches nothing. The region and the account are not among
those, an AWS managed policy carrying no region.
`PolicyType` reads as the part a policy plays rather than the kind of document it
is, which is what keeps `permission-boundary` in a value set beside
`user-managed`: a boundary is itself a customer managed policy, so a type meaning
the kind would match it twice. `scp` matches nothing, this simulation carrying no
SCP ceiling, and `rcp` is published as ignored. An ARN names the policy itself,
so it reaches that policy in whatever part it plays, the boundary included. The
account-level grant an account password policy carries is attached to nothing and
reached by nothing.
The wording of the two refusals no source gives, and the reading of a wildcard in
`AttachmentName`, which the member documents and its own declared pattern admits
no character for, are recorded under Policy Simulation in docs/services/iam.md.
A docker cluster's Spark steps ran in local mode, in one container, so a
script's own spark-submit --master yarn failed and a step's --deploy-mode
was dropped. On EMR "the primary node runs the YARN ResourceManager
service" and a core node "YARN NodeManager daemons, Hadoop MapReduce
tasks, and Spark executors".
- On a Docker network of the cluster's own, the primary node's container
also runs a ResourceManager and a NodeManager, whose capacity is
yarn-node-memory-mb and yarn-node-vcores.
- The node needs Spark, Python and what the bootstrap actions installed,
so it runs from the image the steps run in: the bootstrap's, else the
release's EMR Serverless image with its Hive image's HDFS, MapReduce
and YARN, and Hive on a cluster with Hive. A cluster without Hive gets
no hive, so its Hive step still says "Hive isn't installed.".
- Spark steps submit with --master yarn, keeping the step's own --master
and --deploy-mode; a command's own spark-submit reads the same from its
spark-defaults. Executors and a cluster-mode driver are sized for the
NodeManager, which the cluster's spark-defaults replace, get the step's
AWS environment, and reach Floci at its address on the cluster's
network; a client-mode driver is reached at its container's name there.
- A YARN application's container logs go to
<LogUri>/<cluster-id>/containers/<application>/<container>/ when a step
ends, as a cluster-mode driver's output is there and not in the step's,
without launch_container.sh, which holds the step's session.
A node that does not become ready leaves the last of its output in
Floci's log, as the container goes with its cluster.
YARN's Java 17 options go through JDK_JAVA_OPTIONS, which the Java 8 of
an emr-6.x image ignores.
An emr-spark-* release has no Hive image, and emr-7.5.0's HDFS and YARN
do not run on its newer Hadoop, so its image holds the whole of
emr-7.5.0's Hadoop in /opt, which only the node's daemons run from, and
Spark keeps the release's own. Those daemons are Hadoop 3.4.0's, where
the Release Guide lists 3.4.2 for these releases.
Clusters in a namespace the steps share or with no network stay in local
mode, as do MapReduce and Tez, and core and task instances get no
NodeManager yet.
* perf(core): build the query parameter map only for a request with a query string
RESTEasy builds the query parameter map on the first read and wraps it in a
new map on every read. The protocol claim, the account filter, the signing
service lookup and the Query protocol entry point read it on every request of
every service, even when the request has no query string. Such a request now
gets a shared empty map.
* perf(core): read the Query protocol query string only without an Authorization header
The injected request context in the Query POST entry point is a CDI proxy, so
the shared helper could not see the server request and built the map anyway.
The query is only needed when the Authorization header is absent.
SSO OIDC errors carried the OAuth error code in the body but no
x-amzn-ErrorType header. AWS sends both, and the SDKs resolve the modeled
exception from the header, so a pending device authorization surfaced as
an unmodeled 400 instead of AuthorizationPendingException: `aws sso login`
stopped polling and failed with "An error occurred (400) when calling the
CreateToken operation".
Every OIDC error now names its exception, derived from the OAuth code
(authorization_pending -> AuthorizationPendingException, slow_down ->
SlowDownException, invalid_grant -> InvalidGrantException, ...).
Address review on #7919: server_error is the one SSO OIDC error whose
modeled exception is not named after its OAuth code, so it mapped to
ServerErrorException, which the SDKs cannot resolve. It now maps to
InternalServerException. A unit test pins the header name for every OAuth
code Floci returns.
Keep the stopped-listener timeout assertion without requiring multiple polls within 350 ms. Dedicated refusal and handshake tests still assert the retry behavior.
Signed-off-by: Andre Kurait <akurait@amazon.com>
EKS clusters are stored per account by name, and ListClusters returned every
cluster of the account whatever Region the request named. DescribeCluster and
every other cluster-scoped call also reached a cluster created in another
Region. On AWS cluster names are Regional: ListClusters only lists the
requesting Region's clusters, and the others answer ResourceNotFoundException.
ListClusters now filters on the cluster's Region (from its ARN), and the
cluster-scoped handlers answer ResourceNotFoundException for a cluster in
another Region. The ListClusters pagination token is bound to the Region
too. Floci's own restore and node-join paths still act on any Region.
requireClusterInRequestRegion now returns the cluster it checked, so handlers that looked the cluster up again with describeCluster use it directly. DeleteCluster checks the Region on the cluster it reads under its capacity lock, so the check and the delete act on the same cluster.
IAM resolved an EKS route's resource from the cluster EKS holds under that name in any Region. Clusters are Regional, so a request signed for another Region is now checked against that Region's cluster ARN, as a create there would mint it, and EKS then answers ResourceNotFoundException. IamRestRouteEnforcementIntegrationTest and ResourceArnBuilderTest relied on the cross-Region lookup and now check both sides.
Serialize stop metadata and completion while keeping event publication outside the execution monitor. Preserve ordinary stop and abandon regressions.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Keep the original listener bound instead of racing another listener to its released port. Verify the replacement registers a distinct port and retains forwarding. Separate fixture fix requested in upstream #7910.
Require a greeting sent only by the replacement backend while retaining the original occupied port, SDK target registration and binary echo checks. Name the non-closing mock for its retained listener.
Reuse the greeting backend setup and read-before-write check in both TCP forwarding fixtures. Preserve their distinct payloads, occupied-port and target-registration assertions.
Signed-off-by: Andre Kurait <akurait@amazon.com>
DynamoDB counts the conditions of a KeyConditionExpression or KeyConditions
after it finds the table and index. When there are more conditions than key
attributes in the table or index key schema, it gives "The number of query
conditions (n) exceeds the number of key attributes defined in the schema (k)".
This comes before the missing key, unsupported condition and key type checks.
The Cognito custom domain filter and the S3 virtual host filter run on every
request of every service. Each read the full request URI first, which parses
it and allocates about 340 bytes. RESTEasy keeps the first parse for the
request, so both filters had to change.
The Cognito filter now checks the routed path before it reads the URI. The S3
filter reads the URI only when the Host header is missing or a bucket matched.
* fix(logs): support or in Logs Insights filters
A filter or where stage now keeps rows matching any or-joined comparison, case-insensitive, with parenthesized and nested groups. Syntax the engine does not model (and, not, ||, escapes, backtick fields, expressions in place of a field, empty stages) fails the query instead of returning a silently wrong result set.
Closes#7907
* fix(logs): limit Insights bare filter values to numbers and enforce the queryString length
An unquoted filter value is now a number compared by value, as on AWS (n = 2 matches 2 and 2.0).
Other unquoted values, such as a word or 1+1, fail the query instead of being read as text.
StartQuery rejects a queryString over 10,000 characters with InvalidParameterException, which
also bounds the nesting the or parser walks.
* fix(logs): keep Insights field parsing stack-safe and count queryString in code points
A long dotted field such as a.a.a... overflowed the stack in the field regex, which repeated a
group recursively; the repetition is now possessive and runs in a loop. The queryString limit
uses the shared Smithy length check, which counts code points as AWS does, so a query of
emoji under 10,000 code points is no longer rejected.
* refactor(logs): share one quote-skipping scanner across the Insights parser
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>
* fix(athena): report each result column's SQL type in GetQueryResults
GetQueryResults read the result CSV back and reported every column as varchar,
so clients that build typed results from ColumnInfo got strings for numbers,
booleans and dates. After the query runs, ask floci-duck to DESCRIBE it, map
the DuckDB types to Athena type names, keep them with the query execution and
use them when the result set is built. A statement DuckDB cannot describe
keeps varchar.
Closes#7897
* fix(athena): report decimal precision and scale and time types in GetQueryResults
Keep the type DuckDB describes and map it when the result set is built, so a
decimal column reports its precision and scale in their own fields. Time and
the timestamp variants map to their Athena names, and a failed DESCRIBE is
logged at warn with its cause.