Floci sent no event as a stack's status changed, so a rule on `CloudFormation Stack Status Change`
never fired, and whatever starts on one, a deploy waiting for its stack to finish among them, never
started. It also dropped `ClientRequestToken`, which is how a consumer ties an event to the
operation that caused it.
- CloudFormation User Guide, "Using Amazon EventBridge with CloudFormation": events go to the
default bus, "guaranteed to be delivered, and they might be delivered out of order".
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/eventbridge-integration.html
- CloudFormation User Guide, "CloudFormation stack status change event detail": the envelope,
`stack-id`, `status-details`, and "All events that are initiated by a given stack operation are
assigned the same client request token".
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/event-detail-stack-status-change.html
The pages say nothing of nested stacks, and their sample shows an empty token. Rules read on a real
account on 2026-10-30, for a root nesting one stack, showed one event per status. Through a create
change set, an update change set and DeleteStack, each with its own token, the root's events carried
their operation's token but for REVIEW_IN_PROGRESS, which had no key, and the nested stack's had no
key at all. Through a create and an update that failed in the nested stack, the root's rollback
statuses carried the create's or the update's token, the nested stack's again had no key, neither the
root's CREATE_FAILED nor any UPDATE_FAILED reached the bus, and the nested stack's failed create was
CREATE_FAILED and then DELETE_IN_PROGRESS and DELETE_COMPLETE, with no ROLLBACK_* status. Floci now
records and sends that: a nested stack records CREATE_IN_PROGRESS or UPDATE_IN_PROGRESS as its
operation starts, its failed create ends in CREATE_FAILED for its parent's rollback to delete, without
the "Rollback requested by user." CloudFormation's reason did not carry, and an update's first rollback
passes through UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS. An operation given no token leaves the key
out too.
Two cases were not read and no test asserts them: a failure in the root's own resource with the
nested stack healthy, and a delete that fails. They send CloudFormation's documented statuses from the
same code. UPDATE_COMPLETE_CLEANUP_IN_PROGRESS stays where Floci has cleanup to do, though
CloudFormation sent it on every update. A template Floci cannot execute at all still ends a root in
CREATE_FAILED and sends it, so that stack's end is not silent; the reading has no such path.
CloudFormationService.addEvent is the one place a status is recorded, so it queues an event for a
stack's own record, and CloudFormationEventPublisher delivers them in order on one daemon thread. A
status can be recorded under the stack's lock in stacks.compute and delivery calls a rule's targets
before it returns, so delivering in place would hold that lock and the operation for as long as the
targets take. A failed path records its event before it writes the status, so delivery waits a
moment for that write. The queue is in memory: an event still in it when Floci stops is dropped and
counted in the log, and is not sent on the next start.
The query handler hands each operation's token to the service, which sets it on the stack before the
operation's first record and clears it where the operation has none. It is not persisted.
test(cloudformation): an update failing outside a resource sends no UPDATE_FAILED
An update that fails before any resource, on an SSM parameter or a template that fails at execute,
goes straight to its rollback, and CloudFormation sends no UPDATE_FAILED, as for a failure in a
resource. On 2.4.0 the failed-execute path already sends none, so this commit carries the test alone
that keeps it so: the bus hears UPDATE_IN_PROGRESS, the rollback's statuses and nothing else, each
with the operation's request token.
(test cherry picked from commit 9314dad130116c5d4c809072800c787a4d640446, whose code change 2.4.0
makes moot)
fix(cloudformation): roll back a failed nested create's RetainExceptOnCreate, and send a start only once it runs
A nested stack's failed create is deleted by its parent's rollback through the
ordinary delete path, which kept what RetainExceptOnCreate marks. The delete of
a child in CREATE_FAILED now carries the create-rollback flag, so those
resources go as they did when the child rolled itself back, and a nested case
in CloudFormationDeletionPolicyIntegrationTest keeps it so.
The status an operation starts with is recorded under the stack's lock but
sent by the operation as its first act, so an operation the executor refuses
sends nothing. A successful create or update records its completion before
the terminal status is exposed, as the failed paths do, so the event carries
the operation's own token and not a later request's.
The publisher test waits for the worker to be sleeping or stopped instead of a
fixed 200 ms, and the status events test has one wait loop for the root's and
the nested stack's events.
fix(cloudformation): a delete deferred behind a running create sends its own token
A DeleteStack accepted while an execution runs waits for it, and until now
only its retain list waited: when the execution ended and the delete began,
the stack still held the execution's token, so DELETE_IN_PROGRESS and
DELETE_COMPLETE went out with it. The deferred delete now keeps its token
beside what it retains, and the stack takes it as the delete starts.
aDeleteLandingMidCreateCarriesItsOwnToken holds a custom resource's Create
open, lands the delete, and reads the tokens on the bus; it was red before.
The stale Javadoc above awaitEvents goes.
The mid-create test stubbed the ServiceToken Lambda and PUT the response itself,
which CustomResourceProbe already does. The probe takes a hold: the requests a
predicate matches wait before they are answered until the test releases them,
and the test reads when one has arrived. The status events test holds the
Create that way.
ListBuckets returned every bucket in one response and ignored both
pagination parameters. Buckets now come back in name order, at most
max-buckets per page (1 to 10000), with a ContinuationToken on every page
but the last. A max-buckets out of range, or a continuation token that
is unreadable or was issued to another account, is refused with
InvalidArgument. Without max-buckets the whole list is still returned.
Fixes#7618
CloudFront resolves ViewerCertificate.IAMCertificateId by id alone, and two
questions about that have sat open. A server certificate meant for CloudFront
must be uploaded under /cloudfront, which nothing here enforces, and a blank
value is read as naming no certificate at all.
The blank is settled by AWS's own text, twice over. The member is declared with
a minimum length of 0, so an empty string breaks no bound it carries, and the
ViewerCertificate entry tells a caller on the CloudFront domain name to set
CloudFrontDefaultCertificate and leave all other fields empty. An element left
empty arrives as a blank on this REST XML protocol, so reading it as an id
would refuse the very request the reference asks for.
The path is a published obligation on the caller, in IAM's
UploadServerCertificate note and again in CloudFront's own procedure for
uploading a third-party certificate to IAM, and this emulator does not hold
callers to it. That is a deliberate divergence rather than a reading of what
AWS accepts. What is published is the obligation on the upload rather than a
refusal on the write: the Developer Guide's InvalidViewerCertificate page
enumerates what CloudFront verifies when an alternate domain name is added, in
the order it verifies them, and the certificate's path is not among those
checks. Holding a distribution to the path would refuse a write on a rule
published for the upload, so the id alone decides until something records
otherwise, and a capture of such a refusal moves the reader, the page and the
test.
The reasoning lives in docs/services/iam.md, with the CloudFront page and the
reader's javadoc pointing at it, and two tests pin what each case does: a
distribution created through the API with an empty IAMCertificateId element is
accepted and holds no certificate, and a certificate uploaded outside
/cloudfront serves a distribution and cannot be deleted while it does.
The tag-on-create check reads a body's tags under any spelling a handler
might read, so that no tag a handler applies goes unchecked. An object at
the tags member was read both ways into one set: its structures as tags
and its members as a map's tags. A member named as a structure's key then
replaced that structure's tag, so KMS's CreateKey with
{"Tags":{"team":{"TagKey":"team","TagValue":"red"}}} was checked as
team="" while its handler, which iterates Tags whatever it holds, stored
team=red: a deny on aws:RequestTag/team held on neither kms:CreateKey nor
kms:TagResource.
The two readings are now sets of their own, each checked, so the tag the
handler applies is checked whatever the members are named.
OpenSearch's creates refuse such an object as a TagList, but a deny on a
tag in its structure now refuses it first, as it does a list.
Port the independent ActivityIds filter from AndreKurait/floci#599,
commit ffb5ce8e4008a4e5ad89a1c1741eca22d267fd92. Preserve the existing
account, region, group and ordering behavior. Cover the Query boundary
with signed SDK requests and sparse member indices.
Keep the Query handler responsible for parsing IDs and rendering XML.
Preserve the unfiltered service interface for reconciliation callers and
cover the filtered service path directly. Share SDK activity ID extraction.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
* fix(eks): page ListClusters with maxResults and nextToken
ListClusters returned every cluster in one response and ignored both
pagination parameters. It now returns cluster names in a stable order,
at most maxResults per page (default and maximum 100), with a nextToken
on every page but the last. A maxResults outside 1 to 100 or an
unreadable nextToken is refused with InvalidParameterException, as EKS
does.
Fixes#7625
* fix(eks): bind ListClusters tokens to the calling account
A nextToken issued in one account was accepted in another and skipped
the cluster names that sort before its cursor. The token now carries the
account it was issued to, and another account refuses it with
InvalidParameterException. The pagination tests also get distinct
@Order values.
* fix(eks): reuse the access entries page-size check in ListClusters
ListClusters repeated the 1 to 100 maxResults check that
EksAccessEntryService.pageSize already makes. That method is now
package-private and ListClusters calls it.
The broker fanned a live publish out without its MQTT 5 properties, so an
MQTT 5 subscriber received none of the user properties the publisher sent,
over 1883, 8883 and /mqtt alike. AWS IoT forwards them unchanged and in the
order sent, a repeated name included. The broker now copies the publish's
user properties onto each live copy; Netty encodes them only for an MQTT 5
subscriber, so an MQTT 3.1.1 subscriber gets the message without them.
Pin JSONPath and JSONata mapping updates, state transitions, and response casing. Consolidate invalid request coverage and reject the legacy UUID spelling with the expected error message.
Related to floci-io/floci#7697; the runtime fix landed in #7720.
Use the existing VPC-specific default-group lookup for instance launch, with
service and SDK placement regressions and documentation.
Source: AndreKurait/floci#524 (94f76eae34e46dc1e740b6349bbaed578a15e372).
Remove the obsolete regional resolver and its dedicated test assertions now
that instance launch uses the VPC-specific lookup. Keep legacy VPC resolution
coverage and remove its unused security-group fixture.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Add CreateMembers, ListMembers, GetMembers, DisassociateMembers, DeleteMembers and
DisableOrganizationAdminAccount, the operations Landing Zone Accelerator and Terraform's
aws_securityhub_member use to manage Security Hub members.
Organization accounts added by the delegated administrator become Enabled members and have
Security Hub and its default standards enabled for them; other accounts are Created. Organization
members can be disassociated but not deleted. Disabling the delegated administrator marks its
organization members Removed.
Macie already served POST /members and GET /members, so Security Hub calls on those paths were
answered by Macie. Both routes now dispatch on the SigV4 credential scope in
SecurityAdminController, as GET /admin already does; unsigned requests still reach Macie.
Closes#2197
* feat(paymentcryptography): the single DES decryption
The retail MAC closes its tag with a decryption under the right half of the
key, so the cipher package needs the Single DES decryption as well as the
encryption. It is the same cipher the encryption is, the other way round, and
it is BouncyCastle's like every other cipher here.
* feat(paymentcryptography): the card values and the authorization cryptograms
The card validation value is the three digit value of the X9 algorithm: the
account number, the expiry and the service code, enciphered under the card
verification key, and decimalized. The dynamic variants compute the value
from the transaction rather than from the card's own fields, and they take a
key of their own usage that may derive.
The authorization cryptogram is the ARQC of the transaction: the ISO 9797-1
algorithm 3 retail MAC over the transaction data, cut to eight bytes, under a
session key the request's derivation produces. The EMV common session key, the
EMV 2000 one, the Mastercard one and the Visa one are served. The American
Express derivation is refused rather than approximated: the AEIPS session key
derivation is proprietary and there is nothing to verify it against, and a
plausible wrong cryptogram is worse than an error.
The operations are written on the data plane as it is now: the hexadecimal is
java.util.HexFormat, the digests are the shared Digests, and the ciphers are
the BouncyCastle ones the package already uses. The routes of the card
operations are in the vendored rest-routes.json already, so they are
authorized by the generated rules and need no hand-written ones.
* test(paymentcryptography): the card operations over the SDK and the CLI
The unit tests call the operations directly, so they do not reach the routes
the requests travel, the JSON the body carries, or the rules that decide which
action a request is. The suite does, through a client that signs the request
the way a client of the data plane signs it.
The Java suite drives the card verification value and the authorization
cryptogram with the AWS SDK for Java v2, and the CLI suite drives them with
the AWS CLI. Both refuse the American Express derivation, the key of another
usage, and the value or the cryptogram that does not verify.
* fix(paymentcryptography): the card requests are checked against the model
The card operations' constraints were not vendored, so their requests were
checked by hand and only partly: the account number was read as the digits it
carried, the expiry and the service code were not checked at all for the
first card verification value, and the key an operation acted on was not
checked to be a key.
The constraints are in the model, so they are vendored now, the four
operations are checked against them before they look at the request, and the
checks that repeat them are gone.
The model states that the PAN sequence number is two digits and that the
application transaction counter is two bytes. The derivation reads the last
eight bytes of the packed PAN || PSN and the first two bytes of the counter,
so the longer values the hand-rolled checks allowed were read as something
other than the counter they stood for. The vectors are the ones the EMV
derivation gives for the model's inputs.
* docs(paymentcryptography): the card requests are checked against the model
The account number is digits, the expiry is four of them, the service code is
three and the PAN sequence number is two, the EMV ones as the model states
them. A formatted account number and a longer sequence number are refused
rather than read as the digits they carry.
* docs(paymentcryptography): the data plane's operation count
The Service Matrix counts the operations a service documents, and the data
plane documents four more now: the card verification value and the
authorization cryptogram.
* fix(paymentcryptography): the card operations raise the errors the model names
Three findings from the review, all in the card operations.
A key that may not be used for the operation was refused with
InvalidKeyUsageException, which the data plane's model does not name, so a
client cannot catch it as its own type. The data plane names three errors,
and a refusal that is not one of them is a ValidationException.
The ARPC method 2 read an ArpcInputFormat member that no model, and no SDK,
carries, so the branch it guarded could never be taken. The member is gone
and the response value is always made the way the reference makes it.
And a hexadecimal member of an odd length is a request the model allows and
the cipher cannot read, so it was answered with an internal failure the
caller cannot catch. It is refused with the error the model names, and the
refusal names the member.
* test(paymentcryptography): the card operations' members are covered
Seven members the card operations read were read by no test, so nothing
proved they work: the response attributes and the response code, the card
status update and the proprietary data, the track data, the unpredictable
number and the validation data length. Each is sent now, and the shape the
service receives with them is exercised.
The response value is made by both ARPC methods, and a request that asks for
none is answered without one.
* test(paymentcryptography): the padding type is refused
The padding type belongs to RSA, and the symmetric cipher does not pad, so a
request that names one is refused rather than answered with a cipher that
ignored it. Nothing sent one, so the refusal was never exercised.
* fix(paymentcryptography): the wrapped key is refused on every operation that carries one
The encrypt, decrypt and re-encrypt requests hold a wrapped key for the key
exchange, and the unwrapping is part of that exchange rather than part of the
cipher. A request that carries one is refused, as the PIN operations already
refused it, rather than answered as if the key were a fixed one.
The rule now lives in one place, so the two paths cannot disagree on it.
* fix(paymentcryptography): the master key is derived over the rightmost sixteen digits
The block the ICC master key is derived over is the rightmost sixteen digits of
the account number and the PAN sequence number, padded on the left with zeros
when they are shorter. That is the rule EMV 4.4 Book 2 Annex A1.4.1 gives for
Option A, and the Visa Integrated Circuit Card Specification states it the same
way.
An account number of twelve digits is therefore read and derived from, where
the derivation used to refuse it, and the refusal in the request layer goes
with it.
A derivation the request cannot be read for is refused with the error the
model names, rather than answered with a failure the caller cannot catch.
* test(paymentcryptography): the derivations are the ones the specifications give
The vectors are the ones the specifications publish: the ICC master key from
the EMV Option A derivation, the MasterCard proprietary session key and the
application cryptogram it produces over the same data from the M/Chip worked
example, and the common session key from the same document.
The common session key is compared with the parity bits masked, because the
document does not force the parity of the derived key and the derivation does
not affect the computation.
* fix(paymentcryptography): the dynamic value is the one Visa describes
The Visa Contactless Payment Specification gives the dynamic card
verification value in full: the leftmost four digits of the account number are
replaced by the transaction counter, and the result, the expiry and the service
code are enciphered under the card's unique derived key, which the issuer
derives from the master key with the account number and the PAN sequence
number. The three leftmost decimal digits of the result are the value.
The derivation used a session key and covered the account number as it stands,
so it was the emulator's own construction and not the value Visa describes.
The key it needs is the one the unique derived key derivation already makes,
and the request carries the PAN sequence number that derivation takes.
The counter is a binary coded decimal counter, so a counter that is not one
is refused rather than read.
* docs(paymentcryptography): the dynamic code is the emulator's one
* fix(paymentcryptography): the card value carries the length asked for
The model states the length of a card validation value as three to five, and
the service refused every length but three. The value now carries the number
of digits the request asks for, and the verification compares as many.
The dynamic value's counter is a binary coded decimal counter, so the digits
that replace the leftmost ones of the account number are zero padded on the
left to the four the field holds.
* fix(paymentcryptography): the card values and cryptograms as specified
The review of the branch found that the card values and the authorization
cryptograms did not follow the rules they are made by.
The Option B master key derivation turned the hexadecimal digits of the
hash into digits as it scanned them. The specification takes the decimal
digits of the hash first and only then the nibbles that are not decimal
digits, each reduced modulo ten, so the derivation now follows it.
The transaction data reaches the service already padded, because the
caller pads it the way the card padded it before the card enciphered it.
The service was padding it a second time, which enciphered a block the
card never enciphered. The data is enciphered as it was sent now, and a
length that is not a whole number of eight-byte blocks is refused,
because the ISO 9797-1 MAC runs over whole blocks.
The key table names the application cryptogram usage, the TDES_2KEY
algorithm and the DeriveKey mode of use for the ARQC key, so a key of
another usage, another algorithm or without the mode of use is refused.
The rules are asked in one place now, so the card operations and the
cryptogram operations cannot drift apart on what they accept.
The response value of the second issuer authentication method is made of
the card status update and the proprietary data, as the specification has
it. The response code belongs to the first method.
The EMV 4.1 tree derivation and the dynamic card verification code are
refused rather than approximated: the first is proprietary, and the
second was the emulator's own construction.
A verification that fails carries the reason the model names, and a key
that is not there is answered with a 404.
* refactor(paymentcryptography): the model settles the card value's length
The card operations refused a validation data length that was not three to
five digits, and a validation data that was not, while the model states
both. The model is checked before the operation runs, so the two checks
never reached the point where they could answer, and the model answers
the same request with the same error. The checks are gone, and the
model's own constraints have a test each, so the refusal is proved.
The class comment of EmvCrypto said the ARQC is made over the CDOL, and
it is made over the transaction data as the caller sent it, so the
comment says that now.
* refactor(paymentcryptography): the card side reads the shared helpers
The review found the card side holding copies of what the service already
holds, and the comments around them out of date.
The card operations read the request members through
PaymentCryptographyAttributes now, the same as the cryptogram operations,
instead of carrying their own text and soleVariant.
They read the key's material through PaymentCryptographyKeyRules.materialHex
as well. A key read back after a restart holds no material, and the shared
rule says so, where the raw accessor gave a null that the derivation failed
on.
The refused dynamic card verification code left its branch in the
computation and the track data and unpredictable number fields behind, and
the two-argument retailMac had no callers. They are gone.
The comments are in step with the code now: the class comment of the
cryptogram operations no longer calls the EMV 2000 derivation the common
one, the comment on the second issuer authentication method no longer
carries the response code in its input, and the class comment of EmvCrypto
no longer names OpenSSL or the original engine.
* feat(redshift): support COMPUPDATE, STATUPDATE, and TRIMBLANKS in COPY (#7751)
* fix(redshift): keep NULL markers and empty strings correct under COPY TRIMBLANKS (#7751)
Skip trimming for a field that is the NULL marker, and quote a CSV field that trims to an empty string so it is not read as NULL.
* fix(redshift): accept COMPUPDATE PRESET and trim trailing tabs under TRIMBLANKS (#7751)
RunTask and StartTask pulled the images and started the containers inside the
request, so an unreachable registry held the call for minutes. They now answer
PROVISIONING (awsvpc) or PENDING with PENDING containers, as AWS does, and the
launch runs on a virtual-thread executor. A failed pull shows on DescribeTasks
as STOPPED / TaskFailedToStart, and a StopTask during the pull is no longer
overwritten when the containers start.
A RunTask response's PENDING containers carried the ExecuteCommandAgent as
RUNNING with a lastStartedAt; AWS reports it PENDING with neither. A start
failure after a StopTask overwrote the user's reason and UserInitiated code
with TaskFailedToStart.
AWS reports a container's memoryReservation from the moment RunTask answers.
Docker-mode responses had it from the started container; the pending
placeholders now carry it too.
ECS reports a task as pending from RunTask until it runs, through
PROVISIONING as well as PENDING. The cluster's pendingTasksCount was a
stored field nothing ever set, and the pending statistics counted only
PENDING, so both read 0 while a background launch pulled its image.
RunTask now answers before the task's images are pulled, so the test
waits for the launch to land the task instead of expecting RUNNING
straight away.
Closes#7670
Signer was the last control plane Floci's CloudFormation provisioner stubbed:
SignerCfnProvisioner recorded only the identifiers a template handed it, with
a comment saying Floci has no Signer API. This serves the API, so an SDK, the
CLI or a stack sees the profile it actually created.
Cancellation keeps the profile, as AWS does: it stays readable through
GetSigningProfile with the same ARN and version and the status Canceled, it
stops accepting jobs, and ListSigningProfiles hides it unless includeCanceled
is set or statuses names Canceled. A PutSigningProfile on the same name brings
it back as a new active version.
A signing job fails by default, and says why. Nothing on this machine signs the
artifact, so a succeeded job would advertise a signedObject key that does not
exist and every download of it would fail; the job instead completes as Failed
with a statusReason naming the object that was not written, and RevokeSignature
refuses it because there is no signature to revoke. Metadata-only callers can
set floci.services.signer.mock-signing-jobs=true, which records jobs as
succeeded and is documented as a mock rather than as AWS behaviour.
Signer routes collide with S3's path-style ones, so a request signed for the
signer scope is rewritten onto an internal prefix before matching. That rewrite
used to happen before IAM resolved the action from the path, which left every
Signer call unchecked; IamActionRegistry now strips the internal prefix the
signing service owns, and SignerIamEnforcementIntegrationTest proves a key with
no policy is refused while one with signer:* is allowed.
Co-authored-by: David Guardiola <davidguardiola@gmail.com>
An update that drops DeploymentConfiguration from an AWS::ECS::Service now clears it. A dropped CapacityProviderStrategy or ServiceRegistries keeps the stored value, and a declared empty list clears either. A failed stabilisation puts the prior values back, and a deployment configuration the service did not have is put back as none.
Signed-off-by: Oleksandr Nikolaichuk <sekator778@gmail.com>
A private hosted zone's CNAME, or alias A record, whose target is one of
Floci's own names (localhost.floci.io, localhost.localstack.cloud, the
configured hostname, the extra DNS suffixes) resolved to
InetAddress.getLocalHost(). That lookup takes the first of the
container's networks by name, so after Floci restarts still on a network
it made, an EMR cluster's or an EC2 VPC's, it could answer with Floci's
address there, one the container asking is not on, as #7636 found for
the embedded DNS server's own address.
The record source now answers with the address the embedded DNS server
answers those names with itself, which #7636 has it take from
CurrentContainerNetworkResolver, so a record pointing at one of Floci's
names resolves as the name does. getLocalHost answers only where that
server has no address.
Both list operations now page through the shared Pagination helper, return NextToken only while items remain, and answer an out-of-range MaxResults or a foreign or malformed NextToken with ValidationException. NamePrefix, State and ScheduleGroup filtering apply before paging.
Fixes#6720
Let the namespaced Pagination overload take the reject-empty-token flag that
paginateUnencoded already uses, and drop SchedulerService.requireNonEmptyToken.
Explain why the compatibility test's best-effort cleanup ignores failures.
A systemd guest shares the Docker host's kernel but ships none of its
modules, so `modprobe br_netfilter` (Kubernetes node setup, e.g. Kubernetes
The Hard Way lab 9) fails with "Module not found in directory
/lib/modules/<kver>" even when the module is built in. kind binds the
host's tree the same way. Docker creates a missing bind source as an empty
directory, so hosts without /lib/modules still launch.
Privileged systemd guests can now load any module in that tree into the
shared host (or Docker Desktop / OrbStack VM) kernel, so docs/services/ec2.md
carries a warning saying so.
test(ec2): prove a systemd guest gets /lib/modules read-only on a real daemon
Ec2SystemdGuestDockerIntegrationTest launches through the real
Ec2ContainerManager container spec against Docker, with an Alpine image
standing in for a systemd cloud image (its busybox /sbin/init stays up as
PID 1), and checks the mount both from the daemon's inspect and from the
guest's /proc/mounts. It is skipped when Docker is unavailable.
docs/services/ec2.md now says that on Docker Desktop or OrbStack the tree
is the VM's and may not match its running kernel, and states exactly when
an instance runs privileged: only with security-group enforcement off. With
enforcement on, the guest joins the protected namespace unprivileged, and a
namespace that cannot be created fails the launch.
docs(ec2): say the read-only modules mount does not bind a privileged guest; keep test cleanup from masking failures
The read-only bind keeps an unprivileged guest from changing the tree, but a
privileged guest can remount it read-write, so the first paragraph no longer
claims the guest cannot load a module the host kernel lacks.
The systemd guest test now logs a failed container removal instead of
throwing it over the assertion error it is reporting.
fix(ec2): bind only the running kernel's /lib/modules dir into systemd guests; tear down the integration test via terminate()
test(ec2): pin that the guest's /lib/modules outside the bound kernel dir stays writable; document missing-dir and linux-modules caveats
* feat(rds): CreateDBSnapshot and RestoreDBInstanceFromDBSnapshot for MySQL and MariaDB
A snapshot of a MySQL or MariaDB instance is a mysqldump (mariadb-dump) of
every user schema, with routines, triggers and events, taken as the master
user, followed by every non-system account recreated from SHOW CREATE USER
and SHOW GRANTS. Restoring replays it into the new instance once its server
accepts the master user over TCP, so the copy is never loaded into the
image's initializing server. SQL Server is still refused.
* fix(rds): copy roles and names with spaces in MySQL and MariaDB snapshots
Roles are now part of a MySQL or MariaDB snapshot: MariaDB roles are
recreated with CREATE ROLE, and MySQL accounts used as roles are created
first, since SHOW CREATE USER names an account's default roles. Every role
and account exists before any grant is replayed, so a user granted a role
restores. Schema and account names are read one per line, so names with
spaces stay one argument. The integration test retries through one
Awaitility helper and covers a role and a schema name with a space.
* fix(rds): wait for the server before a MySQL dump, and share the snapshot script runner
CreateDBSnapshot straight after CreateDBInstance failed: Floci reports the
instance available while the image still initializes it on a server that
does not listen on TCP. The dump script now exits 2 until the master user
can log in over TCP and is run again, as the restore is; past that probe
any failure, mysqldump's own exit 2 included, exits 1 so it is not retried.
The PostgreSQL restore, the MySQL dump and the MySQL restore now share one
runner for the upload, the exit-2 retry and the error handling.
Label runtime and code-copy containers with protected deployment and run identities. Reconcile previous runs at Docker startup and retry incomplete cleanup on cold starts, preserving current environments and named volumes.
Honor the Lambda reconciliation switch at startup and before cold starts. Share the owned-container sweep with ECS, retaining each service run policy and reporting persistent failures once until recovery.
* feat(redshift): support CopyClusterSnapshot API action (#7748)
* fix(redshift): address review findings and sync docs for CopyClusterSnapshot (#7748)
* refactor(redshift): simplify CopyClusterSnapshot using existing helpers (#7748)
Drop Tags, KmsKeyId and the ARN branch, which CopyClusterSnapshotMessage does not carry.
Reuse validateManualRetention (InvalidRetentionPeriodFault), takenFrom and SnapshotDumpCopier.copy,
and share the automated-snapshot setup across the new tests.
An AWS::EC2::Instance that names a launch template took the template's
image, type, key and metadata options but never its IamInstanceProfile,
so describe-instances showed no profile. When the instance declares no
profile of its own, it now launches with the template's, resolved the
same way RunInstances resolves it. The instance's own profile still wins.
A stack update that moves the instance to a template version naming
another profile, or none, changes or removes the profile in place, and a
dropped LaunchTemplate removes the profile it supplied. A rollback of an
update that changed the profile, whether the instance or its template
declared it, now puts the previous profile back instead of ending
UPDATE_ROLLBACK_FAILED.
Part of #7603
* fix(ecr): pull rewritten ECR images from an address Docker Desktop reaches
Docker Desktop's daemon runs in a VM and dials localhost there, where a host
port Docker chose for Floci is not bound, so pulls of rewritten ECR images timed
out. On Docker Desktop, rewrite to <account>.dkr.ecr.<region>.localhost:<port>,
which Desktop sends through its host proxy and pulls over plain HTTP.
* fix(ecr): warn when the Docker daemon's operating system cannot be read
The rewrite then falls back to localhost, which Docker Desktop cannot reach, so the later pull timeout needs this cause next to it.
* feat(bedrock): list and get foundation models and system-defined inference profiles
fix(bedrock): resolve only ARNs that name the catalog resource in the calling Region, and report on-demand inference only where a model is served in-Region
fix(bedrock): accept SPEECH and VIDEO output modalities and refuse an unserved model with ValidationException
fix(bedrock): report enum violations and read the model catalog through the shared helpers
An invalid ListFoundationModels or ListInferenceProfiles enum value now
answers with the "1 validation error detected:" prefix AWS sends and
lists the allowed values in the model's order.
* fix(bedrock): answer an unresolvable model or profile identifier with the error AWS returns
GetFoundationModel answers an unknown model id or an ARN that names no
foundation model in the calling Region with ValidationException.
GetInferenceProfile answers an ARN of another service or without an
account with ValidationException, and one of another account with
AccessDeniedException; one of another Region stays ResourceNotFoundException.
Adds CreateDBClusterSnapshot, DeleteDBClusterSnapshot, RestoreDBClusterFromSnapshot and RestoreDBClusterToPointInTime, and makes DescribeDBClusterSnapshots list stored snapshots. A snapshot is a mongodump archive of the cluster's MongoDB container; rds-signed requests naming a DocumentDB cluster or snapshot are routed to DocumentDB.
fix(docdb): round out cluster snapshots and restores after review
List DocumentDB snapshots in the RDS-family list form on either endpoint, accept snapshot ARNs, keep the source's encryption and key on restore, check restore and snapshot identifiers against RDS too, read a point-in-time restore's data as a snapshot does, refuse RestoreToTime, apply every describe filter, and remove a cluster whose restore failed even under deletion protection. Drop the unrelated endpoint host, container-name host and audit log group changes. Cover the archive reaching the restored cluster outside mock mode.
Read a snapshot's record and archive together under the snapshot lock delete takes, and refuse a restore whose archive is missing or empty before any cluster exists; a snapshot taken in mock mode is marked metadata-only and restores only in mock mode. A KmsKeyId on RestoreDBClusterFromSnapshot now encrypts the restored cluster under that key even when the snapshot is unencrypted, as the restore guide allows; the point-in-time restore still refuses one for an unencrypted source. Share the docdb-scoped request in the integration test.
Under IAM enforcement, these tasks are now authorized as the execution role, or as the Credentials role a state names. DynamoDB is checked as a direct request is: batches on each table, transactions by each item's own action, ListTables on its regional collection and statements by what they do. S3 putObject is checked on the object in the bucket's own partition, and a bucket policy can grant or deny. RDS Data needs the action on the cluster and GetSecretValue on the secret. Redshift Data needs what an EventBridge target needs, and its statement operations are checked on any resource.
A request naming nothing it can reach is left to its service. With enforcement off nothing changes.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
A docker cluster ran Hive steps, made its steps' image with Hive and ran
Hive's metastore service on its primary node only when its Applications
named Hive. EMR installs Hive's client and its HCatalog server with
HCatalog too, and the Release Guide's HCatalog page says "HCatalog is a
tool that allows you to access Hive metastore tables within Pig, Spark
SQL, and/or custom MapReduce applications".
- EMR's hive-script, in the emr-scripts package every node has, checks
only "which hive" ("Hive isn't installed." otherwise), and the hive
it finds is hive-client's, which HCatalog installs, so a Hive step
runs on a cluster with HCatalog alone.
- Its HCatalog server, hcatalog-server, is the metastore service:
Hive's hcat_server.sh runs "hive --service metastore".
So a cluster whose Applications name HCatalog installs Hive as one
naming Hive does: its Hive steps run, in the release's image with Hive,
on the metastore service its primary node runs, which its Spark steps'
Hive client uses too.
An emr-spark-* release, the AWS runtime for Apache Spark, includes
neither ("This release includes the following applications:
AmazonCloudWatchAgent, Delta, Hudi, Iceberg, JupyterEnterpriseGateway,
Livy, and Spark."), and has no Hive image to make its steps' image with
Hive from, so a cluster of one installs neither, whatever its
Applications name; one naming Hive asked for that image since #7459.
emr.md now backs a cluster's Spark steps using its metastore with the
Release Guide's EMR pages, in place of the Glue page #7636 quoted:
Spark's default catalog "always connects to a Hive metastore", and
Using HCatalog has Spark SQL read a table the HCat CLI made.
A cluster's Hive steps kept their metastore in an embedded Derby
database in the cluster's /mnt, so only one Hive step at a time could
use it ("Another instance of Derby may have already booted the
database"), and Spark steps, with a catalog of their own, saw a Hive
step's tables only through the Glue Data Catalog. "By default, Hive
records metastore information in a MySQL database on the primary node's
file system", and the Glue Data Catalog is the one to pick "when you
require a persistent Hive metastore or a Hive metastore shared by
different clusters".
- On a cluster whose Applications name Hive, the primary node's
container runs Hive's metastore service on port 9083, once its HDFS
is up: with the image's Hadoop configuration, as Hive steps run, the
cluster's HDFS, its Derby database in the node's own volume, which
only the service opens, and its warehouse in the HDFS. The node is
ready once it listens, and ends if it exits, as for the HDFS daemons.
- It is on the cluster's own Docker network with the HDFS, so only the
cluster's steps reach it. It reaches tables' S3 locations through S3A
on Floci's S3, with a session for the cluster's EC2 instance
profile's role, which goes with the container: at the host's address
when Floci runs on the host, and as floci when Floci runs in a
container, which joins the cluster's network for it, as it joins EC2
VPC networks, and leaves it when the HDFS container goes. A start
that fails, or a container an earlier Floci left, does not keep
Floci there, and one Docker keeps Floci on stays known for the next
teardown.
- It gets the cluster's core-site and hive-site after its own
settings, as EMR's primary node does, so a hive-site warehouse folder
holds for it as for the steps. One an earlier Floci left running
starts again, as its session went with that Floci, and so does one
given Floci's address before Floci could join its network.
- A Floci that crashed is still on that network when it starts again,
and Docker lists it first, so what Floci launched then joined it and
reached the cluster's HDFS and metastore. Floci's own network is no
longer one it made, an EMR cluster's or a VPC's, its earlier owner
label included, or one Docker cannot inspect, unless it is on no
other, and its DNS server takes its address from that network.
- In a namespace the steps share, host or container:<id>, it does not
run: Hive 3.1 has no setting for the address it listens on, so it
would serve every interface of the namespace. Hive steps keep the
embedded Derby database there, as they do with no network.
- Hive steps get its URI in place of the embedded Derby settings, and
Spark steps' Hive client gets it too, so a Spark step reads a Hive
step's tables and makes tables a Hive step reads; a hive-site or
spark-hive-site naming the Glue Data Catalog's client factory still
uses Floci's Glue.
- Two Hive sessions starting at once both upload Hive's exec jar to
the same HDFS folder when it is not there, and one could launch Tez
tasks with a jar that changed under it, so the primary node puts it
there first, under the name Hive gives it.
EmrHiveStepsDockerIntegrationTest runs two Hive steps at once on a
cluster's metastore, and a Spark step that reads a Hive step's table
and makes one the next Hive step reads.
`CreateServiceLinkedRole`'s AWSServiceName was left with one question open.
The capture on #6042 quotes [\w+=.@-]* for it, without the comma the
vendored shape admits, and nothing recorded said whether AWS takes a comma
or refuses one, so the shape kept the model's pattern and the message the
captured text.
AWS's own API Reference entry for the operation answers the part that
matters. It gives the member a minimum length of 1 and the pattern
[\w+=,.@-]+, the comma included, which is what botocore declares for the
shape it aliases the member to as well. The comma is therefore what AWS
documents for this member rather than something that aliasing brought
along, the captured message is the only source that drops it, and a message
answers for the text a violation carries rather than for what a value is
held to. So what a principal is held to stays the published pattern and
nothing moves about what this service admits. The minimum is published
there too, which is why an empty principal stays refused for a reason of
AWS's own rather than the model's alone.
What is left is a reading worth pinning rather than inferred again: a
principal carrying a comma clears the shape and reaches the lookup, where a
service no recording covers has its role name derived from the principal's
labels, the answer any unrecorded principal gets. That reasoning lives in the
docs page alone, with the generator's comment and the test's javadoc pointing
at it, and a capture of AWS refusing a comma as a pattern violation moves the
quoted-pattern entry, the shapes file a regeneration writes from it, and that
test.