* fix(lambda): retain MicroVM run settings and image version
Retain execution settings in run responses and stored MicroVM metadata, and select the requested image version. Validate request bodies with vendored model constraints through the shared request validator.
* fix(lambda): share connector defaults and verify list summaries
Use the same managed connector projection for image and MicroVM responses. Cover the requested version and unchanged summary fields in ListMicrovms, including explicit-version and omitted-version controls.
Systemd guests ran with --cgroupns=host and the host's /sys/fs/cgroup bound
in, so every guest's systemd managed the same cgroup tree as the Docker
host and as each other. Two guests running Kubernetes nodes (kubelet with
the systemd cgroup driver, as Kubernetes The Hard Way configures it)
shared one kubepods.slice: both nodes saw the same inode, and each kubelet
tore down the other's pod sandboxes, so every pod restarted in a loop
(SandboxChanged, "network namespace for sandbox ... is closed").
A private namespace without the bind, as kind runs its nodes, gives each
guest's systemd its own writable subtree, because Docker mounts it
read-write for a privileged container. Measured on OrbStack (cgroup v2):
two guests boot to 'running', each with cgroup 0::/init.scope on a
distinct cgroupfs root.
A guest under security-group enforcement runs unprivileged, and Docker
mounts an unprivileged container's private cgroupfs read-only, where
systemd cannot create its slices. That guest keeps the host namespace and
the read-write bind, so it boots as before; the docs say its cgroups stay
shared.
fix(ec2): keep the IMDS proxy out of a systemd guest's root cgroup
A privileged systemd guest now has a private cgroup namespace, and a
docker exec lands in that namespace's root. Floci leaves its link-local
IMDS proxy (socat) running from such an exec, so the guest's root cgroup
held a process. cgroup v2 will not enable controllers in a cgroup's
subtree_control while it holds processes, so the root's stayed empty and
kubelet with the cgroupfs driver died creating kubepods.slice
("openat2 /sys/fs/cgroup/kubepods.slice/pids.max: no such file or
directory"). Whether a node hit it depended on whether anything else
enabled the controllers before the proxy started.
The proxy's install and start scripts now move their own shell into the
leaf /sys/fs/cgroup/floci first, so socat and everything else they start
stay out of the root. They do so only at the root of a cgroup v2
namespace whose cgroupfs is writable; a host-namespace container, a
cgroup v1 host and a read-only mount run as before. A plain directory
rather than systemd-run, because the proxy starts while the guest's
systemd may still be booting, and systemd neither reaps nor moves a
cgroup it did not create. EKS's pod-identity proxy shares the script.
The Docker integration test launches a privileged systemd guest through the real
container spec. It now also reads /proc/self/cgroup, which must be 0::/ at the
namespace root, and creates and removes a directory under /sys/fs/cgroup, so
native Linux CI fails if the guest falls back to the host cgroup namespace.
Rewrap the class javadoc, rename the test to cover both the modules and the
cgroup namespace, and comment what each cgroup probe does and does not prove.
* fix(eventbridge): validate scheduled rule rate expressions
Validate schedule expressions before PutRule creates or mutates a rule. Reject mismatched rate units with the AWS ValidationException while preserving existing rule state and timers. Keep stored-expression parsing tolerant.
Add service, SDK and scheduler regression coverage.
Closes#7996.
* refactor(eventbridge): share rate parsing and cover legacy stack updates
Use one matcher and parsed value/unit helper for strict API validation and tolerant stored-expression execution. Keep unit agreement checks at the API boundary.
Add a CloudFormation SDK regression proving that unrelated stack updates already skip unchanged legacy rules while direct PutRule calls remain strict. Correct the outdated test comment suggesting every resource is re-provisioned.
* refactor(eventbridge): share AWS rate validation with Scheduler
Move positive value, supported unit and singular/plural constraints into core.common.AwsRateExpressions. Both API validators call the shared checks while their execution parsers retain support for legacy stored expressions.
Parse Scheduler rates once per call and retain its checked interval conversion. Add cross-service tests for matching acceptance and rejection reasons.
Addresses review 5876298647 on #8113.
Keep the current tags when replacing an imported certificate under its
existing ARN. Certificate.setTags already copies the map and normalizes
null, so use that boundary for initial imports and reimports alike.
Cover tag retention and replacement material through the AWS SDK in
commercial and GovCloud regions, including later tag additions/removals
and an untagged certificate.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
CreateBlueGreenDeployment stages a green copy of a PostgreSQL, MySQL or
MariaDB instance with the target engine version, parameter group, class
and storage, linked to the blue instance as a read replica and loaded
from a dump of it. SwitchoverBlueGreenDeployment gives green the blue
identifier, ARN, endpoint and tags and renames blue to <name>-old<n>;
the container manager moves each running container to its new ARN so
stop and delete still find it. DescribeBlueGreenDeployments supports the
four documented filters and paging, and reports INVALID_CONFIGURATION
when a member is gone. DeleteBlueGreenDeployment honours DeleteTarget
before switchover. Deployments are taggable by their deployment ARN.
Closes#8069
TagResource, UntagResource and ListTagsForResource answered
TargetNotFoundException for the organization's resource policy, because
resolveTagOwner matched account, root, OU and policy IDs only. The
model's TaggableResourceId pattern accepts rp- IDs, and AWS's own
CloudFormation handler for AWS::Organizations::ResourcePolicy tags the
policy and lists its tags through that ID.
resolveTagOwner now matches the organization's resource policy ID and
saves the organization, as the root branch does. Any other rp- ID still
answers TargetNotFoundException. The code comments that said a resource
policy is not a TagResource target are corrected, and the docs table
lists the resource policy among the tag targets.
PutReportDefinition now stores its Tags on the report definition, and
TagResource, UntagResource and ListTagsForResource read and change them
by ReportName instead of answering empty stubs. ModifyReportDefinition
keeps the tags, a missing report answers ResourceNotFoundException, and
the TagList and TagKeyList constraints from the model are checked.
Closes#7952
PutReportDefinition and TagResource now fail with ValidationException when the report would hold more than 50 tags, when Tags is not a list, or when a tag key, value or TagKeys entry is not a string.
tools/aws/regen_cur_shapes.py vendors the TagResource, UntagResource and ListTagsForResource input constraints from botocore, and CurRequestShapes checks them, and the Tags of PutReportDefinition, through RequestConstraintCheck in place of the hand-written limits.
Closesfloci-io/floci#8007
Persist whether a standalone instance has never initialized its database. Protect engine versions before backend startup so runtime loss and proxy failures cannot expose existing storage to a metadata-only version change. Update SDK compatibility assertions to reject unsupported upgrades and verify resizing separately.
Apply supported minor upgrades using the version-specific image on the existing volume and endpoint. Keep major upgrades, downgrades, and pinned-image changes blocked before mutation. Preserve the never-started case, report failed restarts honestly, and restore successful minor-upgrade coverage in the Java SDK compatibility suite.
Closes#7979
Resolve symlinks on the working directory's path, relative or absolute,
and check every directory on the resolved path. Stop the check at a
function's EFS mount path, which Lambda enters as the access point's user.
Build the Dockerfile-only build context in one place,
DockerBuildContext.ofDockerfile, for the helper image and the two Docker
tests that built it by hand.
It created an application named test-app, which AppConfigIntegrationTest looks up by name when both run in one shard.
* feat(dynamodb): serve DescribeLimits and DescribeEndpoints
DynamoDB reports the default quotas of 80,000 read and write capacity
units per account and 40,000 per table. It names its Regional endpoint
with a cache period of 1,440 minutes.
* fix(dynamodb): name Floci's own address in DescribeEndpoints
With endpoint discovery on, the AWS SDK for Java 2.x sends later
requests to the address DescribeEndpoints names, even when the client
sets an endpoint. The Regional AWS host sent them to real DynamoDB.
Stream records through CopyBulkLoader.Cursor in loadRecords and reuse writeRecord, eliminating duplicate decompression, line skipping, record reading, heap tracking and blank line filtering.
Verify Cursor record iteration, line tracking and raw byte capture, along with writeRecord chunking across PostgreSQL CopyData wire frames.
GetSnapshot and ListSnapshots with an ownerAccount other than the caller's now read the
owner's snapshots and return only the ones the snapshot resource policy shares with the
caller. A snapshot is never shared across partitions.
* fix(bedrock-agentcore): use runtime IDs and endpoint names in ARNs
Keep runtime ARNs stable across versions and use the parent runtime ID and endpoint name for endpoint ARNs. Update API responses, ARN lookups, tagging dispatch and CloudFormation references together.
* fix(bedrock-agentcore): preserve legacy and harness runtime lookups
Validate the compact UTF-8 JSON environment before function creation or configuration mutation. Both paths previously accepted the 5,000-character value reported in #7995. Cover exact byte boundaries, aggregate variables, Unicode, JSON escaping, and rejected-update atomicity through the AWS SDK.
Stop quota serialization through a bounded UTF-8 counting sink without allocating complete JSON and byte-array copies. Keep unchanged legacy environments out of CloudFormation configuration updates while validating changed variables and preserving environment removal. Add early-stop, one-megabyte input, Unicode buffer-boundary, and legacy-stack rollback regressions.
Include AWS's String measured diagnostic while retaining at most 5,120 UTF-8 bytes and terminating larger input early. Drop incomplete trailing UTF-8 characters before adding an ellipsis. Keep the 1 MB robustness request on CreateFunction, and assert every SDK configuration-update body stays below the separate 5,120-byte request limit. Cover complete measured JSON and bounded Unicode previews.
CreateUser and CreateACL never read their Tags member, and ListTags,
TagResource and UntagResource resolved every ARN as a cluster, so a
user or ACL ARN answered ClusterNotFoundFault and neither resource
could be tagged at all.
User and Acl now keep a tag map, set from Tags on create as
CreateCluster already does. The three tag operations pick the
resource from the ARN: user/ and acl/ look the name up in the current
Region and require the stored ARN to match, answering
UserNotFoundFault or ACLNotFoundFault, and any other ARN goes through
clusterByArn as before. The built-in default user and open-access ACL
are not stored, so they still answer the not-found fault. Users and
ACLs saved before this change have no tags field and load with an
empty map.
Fixes#7956
Recreate the reviewed Rekognition changes on the existing upstream main base using a verified commit. The complete file tree is identical to PR head 19f259b43e1ec8a3ce5fd2a50eb9c21e4ed604df, preserving the collection, pagination, persistence and model-validation fixes while removing the unsigned merge.
Generate constraints for every modeled operation with constraints=True. Select the served operation in the handler, validate its request once, then dispatch. Preserve UnknownOperationException for unserved actions.
Move constraint tests to the handler boundary and verify newly modeled operations are detected without maintaining an allowlist. Verified 189 Java tests, 55 generator tests, Checkstyle, generated-data, documentation and partition checks. Addresses review 5865133468.
GetManagedScalingPolicy returned the policy of a cluster that was
shutting down or had ended. AWS answers ValidationException "A job flow
that is shutting down, terminated, or finished may not be modified."
there, as Terraform's acceptance runs recorded, and Terraform's provider
reads that answer as the policy being gone. Floci kept returning it, so
a refresh after termination kept a policy AWS reports gone.
A TERMINATING, TERMINATED or TERMINATED_WITH_ERRORS cluster now gets
that answer. emr.md no longer says no answer is recorded for the managed
scaling calls: Terraform's provider also expects it from
RemoveManagedScalingPolicy.
ModifyCluster, the four Set* setters, and Put and Remove of a cluster's
managed scaling, auto-termination and automatic scaling policies all
changed a TERMINATED cluster, and AddTags and RemoveTags its tags.
AWS documents these for running clusters, but no answer for an ended
one is recorded. So they give the one AWS gives AddJobFlowSteps and
ModifyInstanceFleet, "A job flow that is shutting down, terminated, or
finished may not be modified.", in the code each operation's model
points at, as AddInstanceGroups and AddInstanceFleet already did for a
TERMINATING cluster: InvalidRequestException with ErrorCode
INVALID_JOB_SHUT_DOWN for ModifyCluster, ValidationException for the
others, whose models declare no InvalidRequestException. A Set* request
naming such a cluster changes none of the clusters it names.
AddInstanceGroups and AddInstanceFleet now answer a TERMINATED cluster
that way too, in place of "Cluster <id> is terminated.", which no source
has.
The Management Guide says "you cannot add, edit, or remove tags from a
terminated cluster" and names no error. AddTags and RemoveTags refuse an
ended cluster with InvalidRequestException "Tags cannot be modified on
terminated clusters.", the message a tagging tool matches from AWS.
StopApplication stopped an application whose runs had not finished,
where the API reference says "All scheduled and running jobs must be
completed or cancelled before stopping an application."
A run that has not finished, a STREAMING or CANCELLING one included, now
refuses the stop with ValidationException, the one error the model
declares for it, carrying that sentence, as AWS's own message is not
recorded. The check holds the job runs' lock, as StartJobRun's admission
does, so no run starts between it and the stop. Step Functions'
stopApplication goes the same way.
A distribution could name a certificate in ACMCertificateArn and in
IAMCertificateId at once, and could name one in either of them without the
MinimumProtocolVersion and SSLSupportMethod that go with it. It could also
carry a security policy or a viewer support method outside the values those
members admit, carry SSLv3 alongside sni-only, and claim
CloudFrontDefaultCertificate while naming a certificate of its own. The
ViewerCertificate entry states every one of those rules, and nothing here
read any of them, so a configuration AWS refuses was taken and the
distribution went on to serve it.
They are read now on the distribution create and the distribution update,
and the shape of the protocol members before any of it, so a request that
breaks a rule is refused for the rule and not for a certificate nothing
matches. A member carried blank counts as no value, the way a blank location
member already names no certificate, and a distribution on the CloudFront
domain name needs neither location member.
Two of the refusals are published. A MinimumProtocolVersion outside its
enumeration is InvalidMinimumProtocolVersion, whose own sentence is that the
minimum protocol version specified is not valid. SSLv3 alongside sni-only is
InvalidProtocolSettings, whose sentence names that pair and nothing else and
which is the same rule as the floor the member states for SNI, "you must
specify TLSv1 or higher", SSLv3 being the only value below TLSv1. That code
is declared on CreateDistribution, CreateDistributionWithTags and
CopyDistribution and has never been declared on UpdateDistribution, which
has declared InvalidMinimumProtocolVersion since 2015, so the update answers
the pair with the code it declares and keeps the pair's published sentence.
The declared code is the one a caller's SDK can map, an undeclared one
reaching it as a generic error, and the sentence keeps the two causes the
update answers under that one code apart.
The others are readings. An SSLSupportMethod outside its enumeration has no
code of its own and answers InvalidArgument, what this service already
answers a member outside its shape with. The three rules about the
certificate itself answer InvalidViewerCertificate 400: InvalidArgument and
InvalidMinimumProtocolVersion are modelled on both writes as well and no
sentence says which one a caller gets, and the Developer Guide page that
enumerates what InvalidViewerCertificate answers reaches none of those
cases, naming the certificate's own trust, its chain, its format and the
names it covers. That code's own documentation is that a viewer certificate
specified is not valid, which is what each of the three carries.
One rule in the group replaces a value instead of refusing the request.
MinimumProtocolVersion's entry says that when CloudFrontDefaultCertificate
is true CloudFront "automatically sets the security policy to TLSv1
regardless of the value that you set here", so the policy such a request
asks for is overwritten and the config reads back TLSv1. A distribution
created with no ViewerCertificate at all already read as the default
certificate and reads TLSv1 with it now, where it had been answering
TLSv1.2_2021.
Two more readings go with the group. The claim itself is a member declared
boolean, so it is held to the four forms XML gives a boolean, true, false, 1
and 0, rather than read for the word true alone: taken for false, a request
saying yes would dodge every rule the member governs, the refusal beside a
named certificate and the replaced policy alike. Anything else answers the
InvalidArgument this service answers a member outside its shape with,
CloudFront modelling no error for a malformed document. And the SSLv3 pair
is read for a distribution on a certificate of its own alone, since on the
CloudFront certificate the policy is replaced and the value that would make
the pair is discarded, so refusing the request for it would contradict the
override. Both enumerations are read either way.
The us-east-1 restriction AWS states for ACM certificates is left
unenforced, as is the /cloudfront upload path before it: refusing either
here could meet a distribution somebody already built. All of the above,
that included, is set out in docs/services/cloudfront.md.
* feat(logs): support saved query definitions
Closes#7999
* fix: preserve saved-query retries and fence reset writes
Keep client-token request snapshots and returned IDs separate from mutable query definitions. Delayed create and update retries preserve newer content, reject conflicting input, and do not resurrect deleted definitions. Persist retry records with the configured account-aware CloudWatch Logs storage until reset.
Gate saves and deletes through beforeReset/afterReset under the service monitor so reset drains active writes and rejects new writes throughout the storage wipe.
Validation: 137 focused service, SDK integration, reset, and existing CloudWatch Logs regression tests passed. Checkstyle, docs-check, partition-check, and git diff --check passed.
* fix: validate saved queries against vendored Logs constraints
Include all three saved-query actions in the existing botocore constraint generator and share RequestConstraintCheck with delivery handlers. Return InvalidParameterException for saved-query constraints while preserving delivery ValidationException messages. Remove duplicated lengths, patterns, enums, list sizes, and type checks from the service and handler; retain domain checks for retries and query-language compatibility.
Reuse AwsTestClients for SDK integration fixtures. Cover modeled errors before service calls, nested parameters, valid maximum sizes, and existing saved-query retry/reset behavior.
Validation: 179 focused Java tests and 50 request-shape generator tests passed. Generated-data freshness, Checkstyle, docs-check, partition-check, and git diff --check passed.
Neither REST model was vendored in rest-routes.json and no rule mapped
their routes, so under enforcement every Security Hub and GuardDuty
request resolved to no action and was let through: a user with no
policies could EnableSecurityHub or ListDetectors.
- regen_rest_routes.MODELS reads securityhub and guardduty;
rest-routes.json takes their routes from botocore 1.43.118, and
iam-authorized-actions.json their actions of no resource type
(securityhub 31, guardduty 70). Nothing else changed.
- Both move from NOT_COVERED to NAMESPACES in the table of request
resources: 228 operations, 3350 over 46 namespaces, no other entry
changed. Security Hub's hub actions are checked on the caller's hub
in the Region, hub/default, the ARN Security Hub gives it, and
GuardDuty's detector and publishing destination operations on the
detector their path names.
- The generator gains a rule: an optional top-level member holding the
ARN of a type whose format has no variable of its own also names
that type when the request leaves it out. DescribeHub with no HubArn
is so checked on hub/default, as AWS checks it, rather than on *,
which would refuse a grant scoped to the hub. The rule changes no
other operation.
- Both move to NAMESPACES in the tag-on-create table too: an
EnableSecurityHub carrying tags also needs securityhub:TagResource on
the hub, a GuardDuty create carrying tags guardduty:TagResource, and
the create is checked with aws:RequestTag and aws:TagKeys.
Regenerated from the Service Reference retrieved 2026-11-11. It now
also gives two Lake Formation operations, GetGlueFunctionSessionContext
and GetTemporaryGlueFunctionCredentials, checked as
lakeformation:GetDataAccess; they are left to the next sync, which
--verify reports without failing. Macie is read by #7869.
IamRestRouteEnforcementIntegrationTest checks both services: a caller
with no grant refused, a grant scoped to the hub or detector let
through, another Region's hub and another detector refused, and a deny
holding under an allow on everything. IamTagOnCreateEnforcementIntegrationTest
checks a hub enabled and a detector created with tags: TagResource
needed, a request tag condition applied, and an untagged create
needing its own action alone. All four fail on main. iam.md says so.
Closes#7830
Closes#8000
Workgroup deletion bypassed saved-query storage and ignored RecursiveDeleteOption. Reject non-recursive deletion when saved queries exist, and remove saved queries and retry records before deleting the workgroup. Serialize deletion with named-query creation to prevent orphaned records.
Vendor all Athena input constraints from pinned botocore and check requests through RequestConstraintCheck. Remove copied named-query bounds and type checks, allow creation without a client request token, and share workgroup scans and isolated test-client setup. Update required-field expectations and cover generation drift, nested constraints, Unicode bounds, and untokened creation.
Move the standard member-constraint Messages implementation and formatter into RequestConstraintCheck, parameterized by error code. Migrate Athena, ECR, and both Payment Cryptography APIs and remove the redundant PaymentCryptographyShapeErrors class. Preserve HTTP 400, existing rule wording, operation-prefix removal, nested list paths, and each service error code with shared contract and service tests.
The Service Matrix documents these four services, but the README's Supported Services table never named them, and it called SageMaker by a name that matches no matrix row. Also drop a stray SageMaker bullet left at the bottom of the matrix page, under Common Setup, since #1949; the matrix row covers it.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
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
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>
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>
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.
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.
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.