* feat(firehose): deliver Redshift COPY loads to a Serverless workgroup
A ClusterJDBCURL with a redshift-serverless host now resolves the workgroup in
the stream's account and region and loads through its runtime, with its
database and admin user. A URL naming another database fails the delivery
through the existing retry path. Provisioned delivery is unchanged.
* fix(firehose): route Redshift Serverless delivery through the workgroup proxy
Connect Firehose Serverless delivery to the workgroup's proxy endpoint (127.0.0.1:<proxyPort>)
instead of the internal PostgreSQL container, matching provisioned cluster delivery and
enabling S3CopySimulator to intercept COPY FROM 's3://...'.
* fix(firehose): drop managed admin secret override on proxy delivery
In the docker runner mode a step's HadoopJarStep.Properties, "A list of
Java properties that are set when the step runs. You can use these
properties to pass key-value pairs to your main function", were kept
but never applied, and of a cluster's classifications only
spark-defaults, spark-hive-site and spark-env reached its steps.
Now:
- A custom JAR step's Properties are system properties of the JVM its
main class runs in, through SPARK_SUBMIT_OPTS, each -Dkey=value in
single quotes as spark-submit's launcher reads them, after any Java
options a spark-env export puts there, so a step's own win. A
command-runner.jar or script-runner.jar step's would be its runner's
own JVM's, which Floci has none of, and a JVM's system properties do
not pass to a process it starts, so they go nowhere. The API sentence
is the only source; emr.md calls this Floci's reading.
- core-site, which will "Change values in Hadoop's core-site.xml file",
reaches Spark as spark.hadoop. settings ahead of spark-hive-site's,
as core-site.xml comes ahead of hive-site.xml, with spark-defaults
winning over both; a command's hadoop command gets it too, after the
cluster's HDFS settings in its core-site.xml copy, escaped for XML.
- spark-log4j2, which will "Change values in Spark's log4j2.properties
file", follows the log4j2.properties of the Spark configuration a
spark-env export of SPARK_CONF_DIR names, else the image's, in a copy
of the step's own, a later key winning: a Spark step with some runs
spark-submit after a wrapper that makes the copy, and a command's
wrapper does the same before its own changes, now from that exported
folder too, links followed. What is added starts on a line of its
own, as the image's log4j2.properties has no line break at its end,
and a value's leading spaces are escaped, as Properties.load would
skip them.
SparkJobRunner.Job gets coreSite and sparkLog4j2 components, which an
EMR Serverless run leaves empty.
npm's native registry route can now retain a missing package from a repository's own
public:npmjs external connection and serve it, instead of always 404ing, mirroring the
AWS-documented external-connection behavior already shipped for Maven (#6889) and NuGet (#7104).
Unlike Maven's GAV layout and NuGet's {id}/{version}/{filename} content route, npm's own real
wire protocol has no request shape that names one version: npm install <pkg>@<version> always
fetches the bare package's full packument first (confirmed against pacote's own source,
RegistryFetcher#packumentUrl, always the bare package path) and only picks the version out of
its own versions map afterward. So this does two things together, not just one:
- A bare packument read (the one every real npm install actually sends) merges the real
registry's own versions and dist-tags into whatever Verdaccio already knows locally, computed
fresh per request and never written to Verdaccio itself (its own publish protocol has no way
to record a version's metadata without that version's real tarball bytes in the very same
call, confirmed against a live container). Every newly-merged version's dist.tarball is
rewritten to this repository's own proxy URL under a deterministic <bareName>-<version>.tgz
shape; dist.shasum/dist.integrity are kept exactly as the real registry declared them, since
there is no real content yet to hash locally.
- A tarball download for a version not yet genuinely retained triggers the real fetch, the
same claim/fence/origin-tracking machinery Maven and NuGet already use (closing the same race
against a concurrent DeletePackageVersions/direct push), reusing CodeArtifactService's
already-generalized claimRetainedVersionOrigin/retainAssetUnderVersionFence methods directly.
New: NpmExternalConnectionClient (the outbound client for public:npmjs) and
CodeArtifactNpmExternalConnectionImporter (the merge and retention logic), wired into
CodeArtifactNpmDataPlane's existing raw proxy.
Deliberately scoped the same way Maven/NuGet's own base PRs were: no caching/TTL on the merge
fetch (a live check against the real registry on every packument read for a connected
repository, matching the same no-caching fidelity level Maven's own maven-metadata.xml merge
already ships with), and the documented but rarely-used single-version registry endpoint
(GET /<pkg>/<version>) is not specially handled, since real npm install never sends it either.
Update: fixed three issues Greptile's review caught, all specific to npm's own two-step
retention (a plain cache-miss asset fetch, as NuGet/Maven's retention already was, is not
enough here):
- retainAssetUnderVersionFence's own write was always the fixed RepositorySidecarManager#
storePackageVersionAsset call, which builds a minimal version document with no dependencies/
engines/scripts. Generalized it to take the actual write as a plain Runnable instead, so npm's
own call can reuse the real registry's full-form version document verbatim (the same
reuse-the-source-document treatment VerdaccioSidecarClient#copyPackageVersionAsset already
gives a version copied from another repository), fetched once, only when a version is
actually retained, via a new NpmExternalConnectionClient#fetchFullPackument. NuGet's own call
site wraps the exact same plain storePackageVersionAsset call it always made.
- Verdaccio always points a fresh package's dist-tags.latest at whichever version was retained
most recently (confirmed live, nothing a retention write sends can suppress it), so a plain
retention could silently move what an unpinned npm install or ListPackageVersions'
defaultDisplayVersion resolves to. Fixed on both sides of that same bug: the merge now only
lets an external dist-tag replace a local one that itself points at an externally-retained
version, and CodeArtifactService#listPackageVersions ignores preferredDisplayVersion the same
way when it names one.
- A retained version's readme was never captured, so GetPackageVersionReadme 404ed on it even
though the tarball existed; the full packument fetch above also captures the package's own
readme (confirmed live: it only ever lives at the top of the full packument, never per
version) the same way a native publish's own readme capture already works.
Verified two ways beyond the automated suite:
- A Docker-gated integration test retains a real package (is-even 1.0.0) from the real, live
npmjs.com, through a real Verdaccio sidecar: a bare packument read merges the real version in
without yet counting any bytes, a subsequent tarball fetch retains it and counts its bytes,
a refetch does not double-count, mixed-case-irrelevant upstream-block enforcement blocks both
the merge and the retention, a genuinely-missing package stays 404, the retained version's
EXTERNAL origin reporting is confirmed against the real sidecar, and its real dependencies/
engines and readme are confirmed readable back from the real sidecar afterward.
- Direct curl checks against the real registry.npmjs.org confirmed the exact packument/tarball
URL shapes this client builds, including the %2F-escaped scope separator the packument
endpoint specifically needs (unlike the tarball path, which uses a literal slash), and that
the abbreviated packument form carries dependencies/engines but not scripts or any readme.
Update: fixed a fourth issue from the same re-review, found once the three fixes above landed:
mergedPackument always fetched the real registry's abbreviated form, even when the real npm
client's own Accept header asked for the full one (the shape npm view <pkg> readme-style
commands use), so a package the merge had not yet retained anything for showed no readme at
all. The merge now honors that header, fetching the real full packument only when the request
actually asked for it, and copies its package-level descriptive fields (readme among them) in
the same never-override-local way everything else here already merges, with no change to the
hot npm install path's own abbreviated fetch.
Update 3: fixed a fifth issue from the same re-review: mergedPackument's own real registry
fetch is a genuine network round trip, and nothing held any lock across it, so a
DeleteRepository finishing its own cleanup while that fetch was still in flight let the later
ensureReady call start a fresh container under an id the delete had already released, one
nothing would ever release again. Added a re-check that the repository still exists right
after that fetch, before this method ever touches the sidecar. This narrows the window back
down to an ordinary check-then-act gap rather than one stretched out by a real network round
trip, not a full fix: VerdaccioSidecarManager's own beginUse/endUse are no-ops today (unlike
PypiserverSidecarManager's), so nothing here can fully close this yet. Filed #7204 to track
giving it real in-flight-use tracking as its own, cross-cutting fix.
Update 4: fixed a sixth issue from the same re-review: DisposePackageVersions deletes a
version's real Verdaccio content outright, so versions.has(version) alone could not tell a
disposed version apart from one never retained at all, and the merge could add a disposed
version straight back in from the real registry's own still-unaware listing, even pointing
dist-tags.latest at it. An unpinned npm install could then select it, only to have the
download correctly, but confusingly, fail. The merge now excludes any externally-named version
this repository has marked Archived or Disposed, reusing the same
requireContainerBackedVersionDownloadable check the native download route itself already
enforces.
In the docker runner mode an s3-dist-cp step, the Release Guide's way of
moving data "from Amazon S3 into HDFS where it can be processed by
subsequent steps", between buckets or back to S3, was FAILED without
running, and on the default TERMINATE_CLUSTER it ended its cluster with
errors. The EMR Serverless image steps run in has neither s3-dist-cp nor
the MapReduce it runs on.
Now a command-runner.jar step whose first argument is s3-dist-cp runs
Floci's own S3DistCp: a Python program, emr/s3-dist-cp.py, which the step's
command writes into the container and runs through spark-submit, copying
through Hadoop's file systems in Spark's JVM. The command wrapper gives it
what a Spark step gets: S3 paths in Floci's S3 and hdfs:// paths, and
those without a scheme, in the cluster's HDFS. It takes the options of
the Release Guide's table, --name=value or --name value, and -D
property=value:
- --src and --dest, a source folder's files keeping their folders;
- --srcPattern and --groupBy matched against the whole path; --groupBy
concatenates the files whose groups give the same name into one file
named by them, and refuses an expression with no group, as the guide
says S3DistCp does; --targetSize breaks a larger group into parts
numbered before the extension ("myfile0.gz, myfile1.gz"); without
--outputCodec a group keeps the compression its files share, named
with that codec's extension, or has none when they differ, each file
decompressed so the group is one stream;
- --outputCodec (gzip, gz, lzo, lzop, snappy, none) through Hadoop's
codecs, each source decompressed by its own extension;
- --deleteOnSuccess, deleting the files but not their folders, as AWS's
"Seven tips for using S3DistCp" says;
- --outputManifest, --previousManifest, --requirePreviousManifest and
--copyFromManifest, the manifest gzipped JSON lines of path, baseName,
srcDir and size, as that post shows them;
- --s3ServerSideEncryption, --storageClass, --disableMultipartUpload and
--multipartUploadChunkSize as S3A's settings; --numberFiles,
--startingIndex, --srcPrefixesFile and --appendToLastFile, the last
through a copy renamed over the file, as neither S3 nor the cluster's
HDFS appends in place. The copy has a name of its own and goes if the
writing fails, and the file steps aside, under a name of its own too,
until the copy has taken its place, coming back if it cannot, so a
failed append leaves it as it was. --s3Endpoint is ignored, S3 being
Floci's.
--requirePreviousManifest takes true or false, after = or as the next
argument, and alone is true, its default. A --srcPrefixesFile line ending
in / names that folder alone, its slash kept though Hadoop's Path drops
it; any other is a prefix as S3 lists one, logs/day taking in
logs/day-old/.
A bucket name with an underscore fails the step, as S3DistCp "does not
support" one, and so does a copy Hadoop fails, leaving what was copied.
A copy that would write two files to the same path, the manifest
included (a.log and a.log.gz with --outputCodec=gzip), a file over one
of its own sources, as with the same --src and --dest, or a file outside
--dest, through a .. in a manifest's baseName or in --outputManifest
(Hadoop's paths resolve it), or a file with no name, from a --groupBy
whose groups matched nothing say, fails before it writes anything. emr.md
says what is Floci's own reading: the grouped file's folder,
--numberFiles' naming, a group's compression without --outputCodec and
that refusal.
Under IAM enforcement, Application Auto Scaling requests were checked on
`*`, so a grant scoped to a scalable target was refused and a deny
scoped to one never applied.
A scalable target's ARN ends in a unique id the service assigns,
`scalable-target/<id>` ("The unique ID ... is a value assigned by
Application Auto Scaling to the scalable target"), which the Service
Reference names ${ResourceId}, while requests name the target by
ServiceNamespace, ResourceId and ScalableDimension. Read as the table
reads other services, ResourceId (`service/<cluster>/<service>`) would
have filled that id, so the namespace was left out until the table could
look the ARN up.
The generator's new FOUND_BY gives a type whose ARN is all an id its
service mints, with the members a request names it by. An operation
whose request has them all names the type by them (`find`), generated
rather than corrected, and the reader asks the service for the ARN they
find through StoredResourceArns, the lookup EventBridge's connections
already use, or else checks the ARN with its id open, as for a create.
StoredResourceArns.find now takes the values a request names the
resource by, in the table's order: one name for EventBridge, the three
members for Application Auto Scaling, whose service now implements it
from the store its handlers read. A member left out or given a JSON
null names none, as the handler reads it.
Application Auto Scaling joins the table (14 operations, 1036 over 25
namespaces): RegisterScalableTarget, DeregisterScalableTarget,
PutScalingPolicy, DeleteScalingPolicy, PutScheduledAction and
DeleteScheduledAction are checked on the target's stored ARN, and a
RegisterScalableTarget registering a new one, its tags included, on
`scalable-target/*`; TagResource, UntagResource and
ListTagsForResource on the ARN their ResourceARN gives; the Describe
operations and GetPredictiveScalingForecast on `*`, as AWS checks them.
`arnType`'s pattern ends in a five-digit escape, the U+10000 to U+10FFFF
range, where Java reads a backslash-u escape as exactly four digits and takes
the rest as literals. Compiled as the model writes it, that range became the
character U+1000, a literal zero, a hyphen, U+10FF and two literal Fs, so the
character class gained a range from `0` to U+10FF: it refused every
supplementary character the model admits and admitted the C1 controls it
excludes, U+0081 among them. Every member the shape resolves to was answered
the wrong way round: `RoleArn` on the three assume-role operations,
`PrincipalArn` on the SAML one, each entry of `PolicyArns` on those three and
on `GetFederationToken`, `TaskPolicyArn` on `AssumeRoot` and the
provided-context ARN on `AssumeRole`.
Each wide escape is read as the code point it spells now, which is what the
model means by it, written in Java's own form by one object that both
constraint checks compile their patterns through. `arnType` is the only shape
in any of the 28 vendored files carrying such an escape, so nothing else
moves, and a run of five or six digits naming no code point is left as the
model wrote it.
`MinimumSessionTokenSize` is published on six operations and was materialized
on one. `AssumeRoot` minted a token of the size asked for while the other five
minted 200 characters whatever the request sent, so the member was validated
and then ignored. All six mint their token through one writer now, which keeps
the floor at the 200 this emulator mints when a request asks for less, since
that is what a minimum asks for. `GetDelegatedAccessToken` models no such
member and keeps the 200 on its own.
`violation(String)` goes with them: wave 4 took out the three hand-written
checks that called it, and nothing has called it since.
`docs/services/sts.md` carries both readings.
* docs(lambda-web): list the 409 pages and the CannotAssumeRole page in the platform page table
* docs(lambda-web): list AWS_DEFAULT_REGION among the environment variables of the app
* docs(lambda-web): say a CloudFront origin may name the endpoint with or without its port
* docs(lambda-web): drop repeated words and move the weight split to the scaling paragraph
* fix(elbv2): relay TCP listeners without HTTP parsing
Forward raw TCP traffic and TLS passthrough to registered targets while preserving per-connection routing. Cover the data plane through AWS SDK integration tests and document dedicated-port limitations.
Refs #5870
* test(elbv2): make TCP data plane test cleanup resilient to partial failures
* refactor(elbv2): share target selection helpers between TCP and HTTP paths
Extract targetCandidates and pickRoundRobin to remove the duplicated
healthy-or-registered fallback and round-robin pick from the TCP relay
and HTTP forwarding paths, unifying both on the floorMod counter that
cannot go negative.
* fix(elbv2): honor listener tcp idle timeout and park colliding listeners
Use tcp.idle_timeout.seconds attribute dynamically in the TCP relay tunnel, and register colliding listeners on in-use ports as parked with a warning, promoting them once the active listener is removed.
* fix(elbv2): validate tcp idle timeout range and reuse timeout parser
* fix(elbv2): unify parse failure and range check in listener attribute validation
* fix(lambda-web): write the day with two digits in the date header of the platform pages
The platform pages and the 414 write the day of their date header with
two digits on AWS, as in Sun, 01 Nov 2026. RFC_1123_DATE_TIME writes 1.
* refactor(lambda-web): write the Date header of the metadata server with platformDate
* fix(autoscaling): use the modeled XML namespace
Promote the complete retained fork #269 namespace correction and exact Query success/error/catalog assertions. Original feature by Jackson Price <jxnprice@amazon.com>, authored 2026-10-28; original source commit d094b6168031df46c708d4dce056580d7e631853 retained unchanged.
Co-authored-by: Jackson Price <jxnprice@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test(autoscaling): share modeled namespace assertions
Share the package namespace assertion across the Query handler and integration tests. Preserve root and all-descendant checks, the returned Element, and all existing populated, empty and error response assertions.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(cloudfront): tunnel WebSocket upgrades to custom origins as AWS does
CloudFront forwards WebSocket handshakes to the origin on every distribution, but
Floci's serving path is a JAX-RS resource that strips Upgrade and Connection and
fetches the origin with a blocking client, so a socket.io client behind a
distribution never left long-polling.
A Vert.x route ahead of JAX-RS now catches an HTTP/1.1 WebSocket handshake to a
distribution host, resolves the behavior and custom origin as the GET path does
(allowed methods, signed requests, origin request policy, origin custom headers,
private-address guard), sends the handshake with its upgrade fields and splices
the two connections once the origin answers 101. Any other answer is relayed as
an ordinary response, and handshakes the distribution would not tunnel fall
through to the existing GET handling. Handshake detection and the byte relay are
shared with the ALB data plane.
* fix(cloudfront): honor disabled service and origin timeouts on WebSocket refusals
The WebSocket route runs ahead of ServiceEnabledFilter, so it now checks that
CloudFront is enabled before taking a handshake and otherwise falls through to
the disabled-service answer.
An origin answer that refuses the upgrade is no longer piped without limits: its
body is streamed within the origin's response timeout between packets and its
response completion timeout in all, counting only the origin's time, and an
origin that stalls past them ends the viewer connection.
* test: share the ALB fixture between the WebSocket integration tests
CloudFrontWebSocketIntegrationTest repeated ElbV2WebSocketIntegrationTest's load
balancer, target group, listener and WebSocket exchange helpers. Both now use
AlbFixtures.
* refactor(cloudfront): have the WebSocket origin clock spend a shared CompletionBudget
BuildKit compresses zstd at about level 11 at most, so the release and
nightly images now go through a composite action: the image is built
into an OCI layout, every layer is recompressed with the zstd CLI at
level 19, and a second build that only names the layout pushes it.
BuildKit keeps the recompressed layers and still attaches provenance
and the SBOM to the pushed digests.
On 2.4.0 this takes the native image from 94.6 to 70.1 MB on amd64 and
from 92.6 to 67.1 MB on arm64, and compat amd64 from 223.2 to 167.7 MB.
Pulling zstd layers needs Docker Engine 23.0 or later, so the
installation requirements move up from 20.10.
A new workflow tests the action on the pull requests that change it:
recompress.py against fixture layouts, then the whole action pushing a
two-platform image to a registry on the runner.
In the docker runner mode each step of a cluster ran in a container of its
own, so nothing a step left in /home/hadoop, or in HDFS, was there for the
next, and the image has no HDFS at all: an hdfs:// path failed, and a path
without a scheme, which EMR reads as HDFS, went to the container's own
disk. The Management Guide calls HDFS "best used for caching the results produced by
intermediate job-flow steps", the prefix "hdfs:// (or no prefix)", and
"ephemeral storage that is reclaimed when you terminate a cluster"; the
Release Guide's S3DistCp page copies data "into HDFS where it can be
processed by subsequent steps".
Now a cluster's storage outlives its steps:
- each step's container mounts the cluster's two Docker volumes, one at
/home/hadoop and one at /mnt, both of which the image gives its hadoop
user, so Docker gives an empty volume that owner, and what the cluster's
bootstrap left there in the image its steps run in;
- HDFS is /mnt/hdfs: Spark gets fs.defaultFS hdfs:/// and the hdfs scheme
through Hadoop's ViewFileSystemOverloadScheme with a fallback link to
that folder, so hdfs:// paths and those without a scheme lead there, a
relative one under /user/hadoop, and a streaming query keeps its
checkpoints through Spark's file system checkpoint manager, as
FileContext refuses an hdfs:// path without a host. The cluster's
spark-defaults can set any of these otherwise;
- a command step's hadoop fs gets the same, through a copy of the image's
Hadoop configuration, or of the folder a spark-env export of
HADOOP_CONF_DIR names, links followed, whose core-site.xml takes in
the original's through Hadoop's XInclude and then those properties,
with its HDFS, MapReduce and YARN homes set; hdfs dfs runs as hadoop
fs, the image's hdfs command being unable to run;
- the volumes go once the cluster has ended and its last step is done,
tried again while Docker refuses, as the bootstrap's image is; on a
reset, a step's thread it overtook removing them again once its
container is gone; and, for clusters that are gone or have ended, when
the service starts, unless reconcile-containers-on-startup is off.
SparkJobRunner.Job carries the storage, which an EMR Serverless run leaves
null. ClusterStorage names, makes and removes the volumes;
EmrClusterStorage is its Docker side. A path without a scheme that a step
meant for its container's own disk now leads to HDFS, as on EMR. emr.md
says what HDFS lacks: no NameNode, no hdfs:// path with a host, no
hadoop fs -ls / and no S3 through hadoop fs.
* fix(s3): refuse a malformed or empty versionId with 400 InvalidArgument
S3 refuses a version id it did not mint with 400 InvalidArgument,
also on a missing key, and an empty versionId with its own message.
Floci mints every version id as a UUID, so it refuses any other value
on the object operations that take a version id.
* docs(s3): say an unknown UUID version id is handled as a missing version
* feat(stepfunctions): dispatch ECS Lambda mapping and secret SDK tasks
* fix(stepfunctions): render ECS task-set StabilityStatusAt as ISO-8601
* refactor(stepfunctions): share recase and timestamp helpers with SDK management invoker
Reuse AslExecutor.recaseKeys (with a verbatim-key set), capitalizeFirst and a
single renderSdkTimestamps walker instead of copies in SdkManagementTaskInvoker,
and inject the invoker through the AslExecutor constructor.
* fix(s3): answer a GET or HEAD that reaches a delete marker as S3 does
A read of a key whose current version is a delete marker sends the
marker's headers with the 404, and a versionId that names a delete
marker is 405 MethodNotAllowed, as on S3.
* fix(s3): name the key in NoSuchKey errors
Every NoSuchKey error names the key in a Key element, and
GetObjectTagging names it with its bucket, as on S3.
* fix(ec2): include r5.large in the instance type catalog
Promote the complete retained fork #234 catalog entry and SDK regression on current main. Keep catalog metadata and offerings consistent.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test(ec2): use JUnit and Hamcrest for R5 catalog assertions
Preserve all 18 metadata and offering assertions while following the src/test assertion conventions requested in review.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
A write in a versioning-suspended bucket makes the version or delete
marker it replaces noncurrent, and deleting versionId=null makes the
newest of them current again, as on S3.
* feat(cloudformation): provision AWS::EC2::KeyPair with its private key in Parameter Store
AWS::EC2::KeyPair had no provisioner, so a stack stubbed it: the stack
reached CREATE_COMPLETE without creating a key, Ref returned a made-up
id and Fn::GetAtt returned the literal "Key.KeyPairId". A template that
creates a key pair for an instance, as the AWS::EC2::KeyPair reference
shows, got nothing to log in with.
The new provisioner does what that reference describes:
- Without PublicKeyMaterial it calls CreateKeyPair with the template's
KeyType and KeyFormat, so rsa and ed25519 keys and pem and ppk files
all work, and stores the private key in the SecureString parameter
/ec2/keypair/<KeyPairId>. With PublicKeyMaterial it imports the key,
takes the key's type from the material (KeyType is ignored, as
documented) and writes no parameter.
- Ref is the key name; Fn::GetAtt KeyPairId and KeyFingerprint are the
key's own.
- Tags are applied once the key exists and the parameter is written
last, so a step that fails leaves only the key to undo. Deleting a
created key deletes its parameter first, on stack delete, rollback
and replacement cleanup alike; a key or parameter already gone counts
as deleted. A key is deleted by its name, as Cloud Control's
DeleteResource names it; a key deleted outside the stack still has
its parameter deleted with the stack.
- Only AWS::NoValue leaves a property out; an empty string a parameter
supplies is a value, as the same string written literally is. An
empty PublicKeyMaterial fails with the MissingParameter error
ImportKeyPair gives for it.
- Every property is create-only (the registry schema has no update
handler) and KeyName is required. An update that changes another
property under the same name is refused with CloudFormation's
custom-named replacement error. A rename creates the new key, then
deletes the old one with its parameter once the update commits, or
deletes the new one if the update rolls back.
The create-only list is added to create-only-properties.json, so a
change set reports a changed name or type as a replacement, and the
generated resource-type table lists KeyPair.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): delete orphaned key pair parameters on cleanup
Replacement cleanup and rollback delete a displaced or rolled-back
AWS::EC2::KeyPair by name only. When that key had already been deleted
outside the stack, its /ec2/keypair/<KeyPairId> SecureString parameter
was left behind.
Record the id of each created key the resource still owes a delete,
keyed by name, so the cleanup, the rollback and a rollback retry also
delete that key's parameter. Imported keys have no parameter and are
not recorded.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): end a key pair's rollback retry when an update starts
A rollback that could not delete a renamed key pair's replacement leaves
it owed for ContinueUpdateRollback. Once that skipped the resource, a
later update that failed before creating anything rolled back by
retrying that old delete instead of undoing itself, and could end in
UPDATE_ROLLBACK_FAILED.
Call ReplacementCleanup.endRollbackRetry as an update starts, as the
other replacing provisioners do. The replacement stays listed, so the
next committed update or the stack delete still removes it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(cloudformation): say the rollback retry test pins a helper contract
The test added with the endRollbackRetry call rolls back the same
resource whose update failed. The engine does not do that for a key
pair today: it restores the previous resource and skips its rollback,
so the earlier commit's UPDATE_ROLLBACK_FAILED scenario is not
reachable yet. Say that the test pins the ReplacementCleanup contract
instead.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): clean up partial KeyPair parameter writes
* refactor(cloudformation): share KeyPair create-only tracking
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(lambda-web): answer a delete marker as the code object as AWS does
A delete marker as the latest version is refused with AWS's own
message, and a versionId that names a delete marker is an internal
error, as on AWS.
* test(lambda-web): cover the null delete marker of a suspended bucket
In the docker runner mode the user guide's way of giving an EMR
Serverless job run its Python libraries did nothing. "Building a Python
virtual environment" packs a virtualenv into an archive in S3 and
submits the job with:
--conf spark.archives=s3://.../pyspark_venv.tar.gz#environment
--conf spark.emr-serverless.driverEnv.PYSPARK_DRIVER_PYTHON=./environment/bin/python
--conf spark.emr-serverless.driverEnv.PYSPARK_PYTHON=./environment/bin/python
--conf spark.executorEnv.PYSPARK_PYTHON=./environment/bin/python
Floci set no driverEnv variable on the driver's container, and Spark in
local mode unpacks spark.archives into a temporary files folder of its
own once the driver's Python has started, not into the working
directory. With the variables set, the driver could not start: "Cannot
run program "./environment/bin/python"".
Now:
- a spark.emr-serverless.driverEnv.<KEY> property ("Option that adds
environment variables to the Spark driver"), from the run's
spark-defaults or a --conf in its sparkSubmitParameters, which wins,
is an environment variable of the driver's container, replacing one
of Floci's own of that name;
- each archive of spark.archives (which spark-submit's own --archives
sets, winning over a --conf, as in Spark) in Floci's S3 is read as the
run's account, streamed into the created container and unpacked into
its working directory before spark-submit starts, under the name after
its # or else its file's name, as Spark's Utils.unpack does it (.jar
and .zip unzipped, .tar.gz, .tgz and .tar untarred, anything else
copied). The guide's venv-pack example puts the environment in
/home/hadoop/environment, and /home/hadoop is the image's working
directory. An archive that cannot be read fails the run before its
driver starts, naming it; a cancel, a reset or a shutdown while they
are put in ends the copy and puts in no other.
SparkJobRunner.Job carries the archives, which classic EMR's steps
leave empty. Spark still unpacks each archive into its own files folder
too, where SparkFiles.get finds it, and gives spark.executorEnv
variables to the Python workers it starts, so those need nothing more.
* fix(sts): cap account-root token durations at one hour
Cap GetSessionToken and GetFederationToken credentials issued to the account-root identity at one hour, preserving IAM user durations and validation ordering.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test(sts): bound root token expiry by request time
Check the one-hour default using timestamps captured before the request and after the response, allowing millisecond wire precision. Preserve the root duration cap.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(cloudwatch): decompress gzip JSON PutMetricData bodies
The AWS CLI and the SDKs that speak JSON 1.0 to CloudWatch gzip a
PutMetricData body of 10 KiB or more and send Content-Encoding: gzip.
AwsJsonController binds the body as a String, so Floci read the
compressed bytes as text and every such request failed with HTTP 400
SerializationException. The metrics were never stored.
Add a reader interceptor that decompresses that one operation's body
when the controller reads it. It runs after every request filter, so
the signature is still verified over the compressed bytes the client
signed, and IAM still decides the request from X-Amz-Target first,
which is sound because nothing in that decision comes from the body.
The decompressed body is bounded by the decoder the CBOR protocol
already uses: past 10 MiB it returns HTTP 413 PayloadTooLargeException,
and a body that cannot be decompressed returns HTTP 400
InvalidRequestException, both in the controller's JSON error format.
A name binding keeps the interceptor on AwsJsonController alone, so
every other resource reads its body as before. In the native image a
global reader interceptor breaks the tag endpoints that resources
inherit from AbstractTagsController, because Quarkus REST then looks
their methods up reflectively.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(cloudwatch): publish a compressed metric batch through boto3
botocore gzips a PutMetricData body of 10 KiB or more, and with the
pinned boto3 it calls CloudWatch over JSON 1.0. The Python
compatibility suite only ever sent a handful of datums, so it never
sent a compressed request.
Send a 100-datum batch, check that botocore sent it as JSON 1.0 with
Content-Encoding: gzip, and check that all 100 metrics are listed
afterwards. Checking the content type keeps the test from passing
through the CBOR path, which already decompressed gzip, should a later
botocore prefer CBOR.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* chore(cloudwatch): reuse signed IAM test users
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
A property the previous template declared and the new one drops is now
cleared on update for the EC2 network types: Tags on Subnet,
InternetGateway, RouteTable, NatGateway, EIP and PrefixList, and
MapPublicIpOnLaunch on Subnet, which goes back to false. A property the
stack never declared keeps what was set outside it. A failed update puts
the cleared tags and the flag back from the existing in-place snapshot.
Refs #6606
* fix(ec2): tag an AMI with the tags RegisterImage is given
RegisterImage never read TagSpecification, so an AMI registered with
image tags came back from DescribeImages untagged: its tag filters
matched nothing and DescribeTags listed nothing for it. A tag
specification for another resource type was accepted as well, although
AWS fails that request.
RegisterImage now reads its image tag specifications and refuses any
other resource type with InvalidParameterValue. It checks the tags as
CreateTags does (no aws: prefix, the key and value lengths, at most 50
tags) before registering anything, so a refused request leaves no AMI
behind. The tags are stored before the AMI is, so DescribeImages never
lists it without them, and a key given twice keeps its last value, as
Floci's CreateTags keeps it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(ec2): copy an AMI's tags when CopyImage sets CopyImageTags
CopyImage never read CopyImageTags, so a copy asked to carry its
source's tags came out untagged, and DescribeImages could not find it
by them.
With CopyImageTags=true the copy now gets the caller's tags on the
source, read in the source region, less the aws: system tags, which
AWS does not copy either. Without it, or with false, no tags are
copied, which is AWS's default. The source keeps its tags, and the
copy's are stored in the destination region only. The tags are read
under the source AMI's own id, so a catalog AMI's tags on that id are
copied too, while tags put on one of its aliases are not. Floci keeps
each account's tags apart, so another account's tags never reach the
copy.
CopyImage still neither checks nor applies TagSpecification, and the
docs now say so.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(ec2): stub the CopyImage overload the handler calls
Upstream's handler test for CopyImage tag specifications stubbed the
five-argument copyImage. On this branch the handler passes
CopyImageTags as well, so the stub never matched, the mock returned
null and the test failed with a NullPointerException. It now stubs the
six-argument call with CopyImageTags false, which is what a request
without it sends.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(ec2): leave RegisterImage tag specifications to upstream's handling
Upstream now reads RegisterImage's TagSpecification in the Query
handler, refuses other resource types and checks the tags before the
AMI is registered, so this branch's own path for the same thing is a
duplicate. The seven-argument registerImage overload and the tag code
in registerImageLocked are removed, and RegisterImage goes back to
upstream's code. CopyImage stores the tags it copies straight after it
registers the copy instead.
The branch's RegisterImage tests go too: upstream's
Ec2CreateTagSpecificationIntegrationTest and Ec2QueryHandlerTest cover
the same behaviour. What the branch adds is CopyImageTags alone.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(ec2): pin a TagSpecification tag over a copied tag of the same key
With CopyImageTags=true and an image TagSpecification on the same
request, the copy carries both sets. When both name the same key, the
TagSpecification value is the one the copy keeps, since the handler
applies the specification after the service copies the source's tags.
The docs row says so; this test holds it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(ec2): refuse a CopyImage over the tag limit before creating the copy
With CopyImageTags=true and an image TagSpecification, the copied and
the specified tags were each checked against the 50-tag limit on their
own. The service then created the AMI and its snapshots and stored the
copied tags, and only the handler's CreateTags of the specification saw
the combined set: past 50 it answered TagLimitExceeded while the copy
it had just made stayed behind, so a retry under the same Name failed
with InvalidAMIName.Duplicate.
The handler now passes the requested image tags to the service, which
checks the union of copied and requested keys before it registers
anything. The upstream handler test stubs the new signature.
The docs and the test of a key given both ways now say that the
TagSpecification value winning is Floci's behaviour: the public
CopyImage reference does not say how AWS settles that.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(ec2): keep one CopyImage service signature
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(autoscaling): launch with the launch configuration's block devices
Auto Scaling groups launching from a launch configuration passed none
of its block device mappings to the launch, so their instances got the
AMI's devices alone. They now pass them, with the configuration's
Boolean NoDevice converted to EC2's marker, and instance refresh
replacements get them too. A mapping the launch refuses, such as an
invalid device name, now fails the launch as a failed scaling activity.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(ec2): count volume store scans for a DescribeInstances response
The test for one volume read per DescribeInstances response counted
calls to instanceVolumeAttachments, so a scan moved inside that
helper's instance loop still passed it. It now counts scans of the
volume store for a three-instance response, which fail with three
scans both before the fix and with that loop.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(autoscaling): default launch configuration volumes to delete on termination
* test: share signed Query requests for launch block devices
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* feat(elasticache): apply a changed access string to open sessions
ModifyUser with AccessString or AppendAccessString was installed on the backend only at the user's next authentication, so a connection that was already open kept its old permissions. The service now asks the proxy of every replication group that holds the user to install the new rules on the backend user the open sessions run as, through a short administrator connection. Nothing is sent before the backend is set up or for a user nobody has authenticated as, and an access string with a selector is refused as it is at login.
* fix(elasticache): propagate live ACL updates to serverless and evaluate rules under lock
* fix(cloudformation): transform SAM layer versions
Map packaged layer content to Lambda layers, retain version-specific resource identities, and preserve references and retention behavior. Cover publication, replacement and deletion through CloudFormation.
* fix(cloudformation): preserve typed and inherited SAM layer references
Rewrite captured Globals references, retain typed list references for provisioning, and restrict dependency rewriting to resource attributes. Cover each case in unit regressions and stack creation/update.
* fix(cloudformation): keep Fn::Sub overlay variables out of parameter substitution
A variable map localizes names for the template engine, so resolving a
same-named stack parameter first consumed the placeholder and left the map
dead: Key: !Sub ['${Key}', {Key: 'layer.zip'}] published the parameter's
value instead of the layer package the author named.
* refactor(cloudformation): fold SAM logical-id hashing into one helper
The layer-version and function-version generated ids serialized their hash
input the same way - properties sorted, non-ASCII escaped, DEL escaped, then
the first ten hex digits of the SHA-1 - but as two copies. Extract samHashSuffix
so a generated id is its subject plus one shared suffix. Ids are unchanged.
* fix(cloudformation): deploy SAM layers from original content expressions
The transform resolved ContentUri parameters before copying them onto the
generated AWS::Lambda::LayerVersion, so a parameter value that itself held
a ${...} was published inside a Fn::Sub and CloudFormation substituted it a
second time at deploy. Deploy the bucket and key expressions as written and
let the template engine resolve them once; keep the resolved copy only as
the hash input, so a versioned package still yields a distinct logical id.
* fix(cloudformation): keep Fn::Sub local variables out of layer rewrites
The recursive layer-reference walk re-entered an Fn::Sub node through the
blanket children loop, so it treated a variable map as another expression.
With a local variable literally named Ref whose value was a layer's logical
id, the walk rewrote that literal into the generated id and changed what the
stack deployed. Rewrite only the map's values as intrinsic contexts and skip
the already-handled Fn::Sub node in the walk.
* fix(lambda): read a layer's pinned S3 object version
A SAM layer with a packaged ContentUri.Version, or an
AWS::Lambda::LayerVersion whose Content sets S3ObjectVersion, publishes that
pinned package, but the provisioner fetched the object with a null version
and so read the latest one. If the key changed after publishing, the layer
ended up with different code than the template requested. Pass
S3ObjectVersion through to the S3 read so a pinned package stays pinned.
* fix(cloudformation): resolve a whole ContentUri reference before splitting it
Keeping the original ContentUri expressions on the generated layer means a
ContentUri that is itself a parameter reference arrives as a Ref object with
no Bucket or Key, and the transform rejected the stack. Resolve such a
reference to the location it names and split that, while the object form
keeps its expressions for the template engine to resolve at deploy.
* fix(cloudformation): honor retained resources on stack deletion
* test(cloudformation): assert the unretained sibling bucket is removed
* fix(cloudformation): skip every retained resource, whatever its status
A DELETE_FAILED stack can hold a CREATE_FAILED resource that the delete
never touches, because floci only deletes a failed resource it owns for
rollback. Naming it in RetainResources was accepted but left it
CREATE_FAILED with no DELETE_SKIPPED event. AWS reports every retained
resource DELETE_SKIPPED, so the retain check now runs before the
deletability guard.
* test(cloudformation): build the retain integration test on the shared CFN helpers
Use CfnStackWaits.awaitStatus, which also fails at once on another
terminal status, instead of a private poll, and CfnRequests.cfn for the
Query requests.
* fix(cloudformation): keep SMS_MFA on a user pool update until MFA is turned off
The AWS::Cognito::UserPool reference says that once SMS_MFA is enabled, only
MfaConfiguration OFF turns it off. An update that stopped listing SMS_MFA in
EnabledMfas cleared it. replaceUserPoolMfaConfig now keeps the pool's SMS
setting when none is given and the mode is not OFF.
Closes#7086
* fix(cognito): keep SMS MFA with the pool's current SMS settings
Keeping SMS MFA replayed the settings it was enabled with, so an update that
dropped SMS_MFA and changed SmsAuthenticationMessage or SmsConfiguration put
the old values back over the ones updateUserPool had just applied. The kept
SMS MFA now takes the pool's current message and SMS configuration.
* feat(redshift): copy cluster snapshots into the configured destination region
EnableSnapshotCopy used to only record the destination on the cluster. A background sweep now copies each available snapshot taken after copy was enabled into a per-Region copy store, with its own dump file, retention and KMS key from the copy grant. Describe, delete, restore and tagging use the copy when the request's Region has one.
* fix(redshift): harden snapshot copy expiry, rollback and same-region enable
Expiry re-reads the copy under the lock so a replaced copy is not deleted. A failed flush undoes the copy record and the source mark before the dump is removed. A sweep re-checks that copy is still enabled to the destination. EnableSnapshotCopy refuses the cluster's own Region, and CreateClusterSnapshot refuses an identifier a copy already holds in that Region.
* fix(redshift): harden snapshot copy and share the sweep scheduler base and dump copier
Snapshot copy: keep a retained copy when a source snapshot is recreated under the same name, flush the copy before marking the source, only apply the cluster's copy retention to copies of the same cluster generation, recheck the copy settings under the snapshot lock before each copy, and leave shadowed sources out of DescribeTags.
Refactor: the five SweepWorker scheduler wrappers now extend SweepScheduler, and both services copy dumps through SnapshotDumpCopier.
* docs(redshift): note the hybrid storage limit of snapshot copy
Hybrid storage does not report a failed flush, so a crash can leave a source snapshot marked as copied without its copy. Persistent and WAL storage report the failure before the source is marked.