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.
CreateCluster that omit EncryptionInfo or clientBroker described
TLS_PLAINTEXT, but the MSK API and CloudFormation schema both name the
default as TLS. An explicitly supplied value still echoes as shipped.
Closes#6968
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
In the docker runner mode a step's spark-submit got the spark-defaults
of the cluster's Configurations, and nothing else from them. The
Release Guide's other two Spark classifications that change what a job
does were ignored:
- spark-env "Sets values in the spark-env.sh file", through its nested
export classification ("If any classification ends in env, use the
export sub-classification"). It is how a cluster picks the Python
PySpark runs (PYSPARK_PYTHON) or the JVM (JAVA_HOME). Its exports are
now the step container's environment variables, replacing any of
Floci's own with the same name. The image's spark-env.sh only
defaults PYSPARK_PYTHON, PYSPARK_DRIVER_PYTHON, SPARK_HOME and
HADOOP_CONF_DIR, so the exports win there.
- spark-hive-site "Sets values in the hive-site.xml for Spark", as the
Management Guide uses it to put Spark's tables in the Glue Data
Catalog (hive.metastore.client.factory.class). Its properties now
reach spark-submit as spark.hadoop. settings, which Spark's Hive
client reads as it would hive-site.xml; a spark.hadoop. setting in
spark-defaults wins over them, as it would over hive-site.xml.
SparkJobRunner.Job carries the environment, which an EMR Serverless run
leaves empty. The exports are set as given, with no shell expansion,
and a command or script step sees them too; emr.md says so.
Separately, the pattern EcrRegistryManager reads an ECR image's Region
with, which EMR Serverless checks an application's custom image
against, now names the hosts it takes: AwsPartitions.dnsSuffixRegex()
for AWS's, as AWS_ECR_URI does, and localhost or localhost.floci.io
with a port for the repositoryUri Floci's ECR hands out. It took any
host after the Region before, so an image on a registry that only
looks like ECR's (<account>.dkr.ecr.<region>.registry.internal/...)
was refused for being in another Region.
Athena's GetDataCatalog, ListDatabases, ListTableMetadata and
GetTableMetadata handlers read the catalog name with has() and
asText(), so a JSON null became a catalog named `null`: GetDataCatalog
then answered InvalidRequestException rather than the AwsDataCatalog
it answers for a request naming none. They now read it through the
handler's text(), as GetWorkGroup and StartQueryExecution read
WorkGroup, so a JSON null names no catalog.
Under IAM enforcement, a GetDataCatalog naming no catalog was checked
on `*` though Floci answers AwsDataCatalog, so a grant on that catalog
was refused and a deny on it did not apply, and the three catalog
reads given a JSON null CatalogName were checked on `datacatalog/null`
as well as on AwsDataCatalog. The request-resources table now reads a
request naming none, or a JSON null, as naming AwsDataCatalog for all
four, as it reads Athena's primary workgroup.
The table's regeneration also takes up drift in AWS's Service
Reference since the last sync, which the online check of both IAM
tables fails on: AWS now lists cognito-idp:DescribeTermsByClient among
the actions it authorizes DescribeTermsByClient as, so the
authorized-actions map no longer maps it to DescribeTerms and the
request-resources table checks it as its own action, and the map
gains MediaConnect's new BatchGetDestinationEndpoint and
BatchGetSourceEndpoint. Floci serves none of these operations.
A SigningAttributes member that is not a JSON object answered a
Floci-only BadRequestException. The operation now runs the shared
SES v2 shape check first, so a member of the wrong JSON type is a
SerializationException with AWS's deserializer message, ahead of the
origin check and the identity lookup, as AWS answers it. A missing
identity now answers AWS's "The specified email identity, <id>, does
not exist."
* fix(cloudformation): clear an AppSync property the new template drops on update
An update whose template drops a property the previous template declared now clears it on the five AppSync types, and one the stack never declared keeps the value set outside it. ProvisionContext.droppedProperties names the dropped properties.
* test(cloudformation): move the AppSync removal case into AppSyncCfnIntegrationTest
The case reuses the class's helpers, now built on CfnRequests.cfn, instead of a second copy. Documents the AppSync update rule next to the AWS::NoValue section.
* fix(ec2): propagate transit gateway attachments to the default propagation route table
* refactor(ec2): build transit gateway route table propagations in one helper
The default-propagation path in storeNewAttachment and
enableTransitGatewayRouteTablePropagation built the same propagation
record field for field. Both now call storePropagation.
* test(ec2): assert the resource id of a default-created propagation
The create-site VPC id argument to the propagation helper was not checked
by any test; only the resource type was.
* feat(route53): add reusable delegation set APIs
* feat(route53): associate reusable delegation sets with hosted zones
* fix(route53): preserve delegation ownership and assignments
* fix(route53): authorize delegation set operations by matched route
* fix(route53): filter hosted zones by reusable delegation set
* fix(iam): select REST XML denials from the service catalog
* perf(test): reuse Route53 IAM enforcement fixtures
* fix(ec2): report NAT gateways as zonal and honor PrivateIpAddress
The Terraform AWS provider reads network_interface_id, private_ip and
public_ip from a NAT gateway only when it is reported with
availabilityMode zonal. Floci never sent availabilityMode, so all three
stayed null. Every gateway Floci creates sits in one subnet, so the
responses now say zonal.
Floci has no regional NAT gateways. A regional request that named only
its VPC failed on the missing subnet, and one that also named a subnet
got a zonal gateway, through both CreateNatGateway and
AWS::EC2::NatGateway. Both now refuse AvailabilityMode regional with
UnsupportedOperation. Any other value except zonal, such as Regional,
fails with InvalidParameterValue instead of creating a zonal gateway.
Once Terraform reads private_ip back, the gateway has to hold the
address it was asked for. private_ip forces a new gateway, and
CreateNatGateway ignored PrivateIpAddress, so a config that set it
would plan a replacement on every run. CreateNatGateway and
AWS::EC2::NatGateway now give the gateway's interface the requested
address, checked by the same rules as RunInstances: inside the subnet,
not reserved and not in use. A changed PrivateIpAddress replaces the
CloudFormation resource, as it is createOnly. A gateway has its primary
address only, so SecondaryAllocationIds, SecondaryPrivateIpAddresses
and SecondaryPrivateIpAddressCount are refused with
UnsupportedOperation instead of being dropped.
AWS::EC2::NatGateway also sets EniId, the gateway's primary interface,
which Fn::GetAtt resolved to the literal "Nat.EniId" although the
gateway has had a real interface since #5622.
Closes#6767
* fix(ec2): take no VPC network lease for a NAT gateway's requested address
DeleteNatGateway never returns a lease, so the one CreateNatGateway took
for its PrivateIpAddress kept the address from automatic allocation
after the gateway was gone. Check that the address is free the way
CreateNetworkInterface does, without the lease; automatic allocation
already steps around addresses a stored NAT gateway holds.
Ec2NatGatewayAddressIntegrationTest now sends its requests through the
shared Ec2Requests.ec2 instead of its own copy.
* fix(applicationautoscaling): target-tracking alarms watch the real metric, not the policy type name
CustomizedMetricSpecification passes Namespace, MetricName, Dimensions,
Statistic and Unit onto the AlarmHigh and AlarmLow alarms as given, and
the ECSServiceAverageCPUUtilization, ECSServiceAverageMemoryUtilization
and ALBRequestCountPerTarget predefined types map onto the documented
AWS/ECS and AWS/ApplicationELB metric identities, so the alarms see data
published the way AWS (or the caller) publishes it.
Closes#6853
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(applicationautoscaling): read ALB target-tracking alarms through Sum
RequestCountPerTarget data points already carry the per-minute average
across the target group, and CloudWatch names Sum as the only valid
statistic for the metric, so an Average alarm compares the target
against a second average and misses scale-outs (two samples of 600
read 600 instead of 1200 against a target of 1000). The statistic now
travels with each predefined metric mapping, keeping Average for the
ECS utilisation gauges.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
---------
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
* fix(cloudformation): apply EnabledMfas on AWS::Cognito::UserPool
* docs(cloudformation): move the EnabledMfas note to the resource-type table source
* fix(cloudformation): drop the MFA factors EnabledMfas no longer lists on update
* fix(cognito): apply EnabledMfas mode and factors in one write
* fix(cloudformation): roll back EnabledMfas with the rest of the user pool
* fix(cognito): serialize whole-pool writes behind a per-pool lock
replaceUserPoolMfaConfig stores a copy of the pool, so a TagResource that
landed between the copy and the write was lost. Tag and untag locked the
pool instance, which the copy replaces, so they did not exclude it.
Every write that reads a pool and stores it back whole now holds a lock
keyed by the pool id and reads the pool inside it.
* fix(cloudmap): create the Route 53 hosted zone behind a DNS namespace
Private and public DNS namespaces reported a random HostedZoneId that no
Route 53 zone backed. They now create a real zone (private with the
namespace VPC and region, or public) via Route53Service, and DeleteNamespace
deletes it; a zone holding user records refuses with HostedZoneNotEmpty and
the namespace is kept.
A private zone now covers the namespace's names, and the Route 53 DNS source
answers NXDOMAIN for names it has no record for. EmbeddedDnsServer took the
first present answer across sources, so bean order could hide Cloud Map
instances. An NXDOMAIN from one source no longer wins over another source's
real answer.
Reset: zones and namespaces live in separate stores; Route53Service.clear()
only drops in-memory counters, so no Cloud Map reset hook was added.
* test(cloudmap): select the user's zone now that namespaces own a real one
A private DNS namespace now creates a real Route 53 hosted zone, as AWS
does, so the compat projects hold two zones named floci-compat.internal:
the namespace's private zone and the public aws_route53_zone. The bats
lookups took the first zone by name, which picked the namespace zone
whenever its id sorted first, so the record and tag assertions read the
wrong zone. They now select the public zone.
The CloudFormation test pinned the namespace HostedZoneId to 14
characters, the length of Cloud Map's old placeholder. The id now comes
from Route 53, which, like AWS, does not use a fixed length; the test
checks for a bare Z-prefixed id instead.
* fix(dns): let a record source with records win over another's NODATA
Two sources can own one zone (a Cloud Map namespace and its Route 53
zone). An empty NOERROR from the first consulted source was returned
before the other was asked, so a TXT record in the zone hid Cloud Map's
A record at the same name. Empty answers are now fallbacks, an existing
name preferred over NXDOMAIN.
* fix(cloudmap): log a namespace zone that was already deleted
* docs(cloudmap): describe the real hosted zone in the operations table
* test(dns): pin how record sources combine REFUSED and negative answers
Another source's records now beat a REFUSED, and REFUSED beats NXDOMAIN
in either source order; nothing pinned either, so returning REFUSED
immediately went unnoticed. Also pin, as current behaviour, that a plain
NODATA beats an NXDOMAIN carrying an SOA authority.
The packet test now deletes the TXT records it adds to the namespace's
hosted zone, so the zone is left deletable.
---------
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
* feat(ecs): stop service tasks off the reconciler thread so slow graceful stops don't serialize unrelated services (#6619)
The service scheduler ran each task's Docker stop on the single
reconciler thread, holding the reconciliation pass lock and the task's
monitor. A stop waits out every container's stopTimeout, up to two
minutes a container, so one slow task held up every other task and
service, and several stopped one after another.
The reconciler still marks the task STOPPING and deregisters it at once,
then hands the Docker stop to a bounded task stopper: eight daemon
threads named ecs-task-stopper-N, created only while there is something
to stop. When Docker is done the stop lands the task STOPPED under its
monitor, with the same exit codes, finish times, network release,
cluster count and event ladder as before, and in the task's own account;
a failed stop leaves it STOPPING for a later tick to retry, as it always
has. A per-task registry keeps the ticks in between from submitting the
same stop again. Grace periods are unchanged. Rollouts count only
RUNNING tasks, so a task that stays STOPPING longer starts no extra
replacement, and a DAEMON replacement still waits for STOPPED.
StopTask keeps its synchronous contract. On a task the scheduler is
already stopping it waits, outside the task's monitor, for that stop to
land instead of stopping the same containers a second time. A container
teardown lets the stopper drain before it claims the remaining handles,
and afterReset() replaces the stopper along with the reconciler.
Stopper threads now change a cluster's running task count while the
reconciler launches tasks, so the count is read and written under the
cluster's monitor.
With real Docker and three services whose containers ignore SIGTERM
(stopTimeout 10 seconds), stopping the three old tasks took one 31 second
tick, one task after another, before this change, and 13 seconds with
all three stopping side by side after it.
* fix(ecs): make StopTask wait for a tick's retry of a background stop that failed
A background stop that failed can be retried by a reconcile tick before the
waiting StopTask takes the task monitor back. StopTask now rechecks for a
running stop in a loop, waiting outside the monitor each time, so it never
returns STOPPING while Docker is still stopping the task.
The background-stop integration test now reads STOPPED under the task
monitor, so it also sees the exit codes and cluster count the stop lands.
* test(ecs): use the shared InMemoryStorageFactory in the graceful-stop concurrency test
---------
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
* feat(glue): data quality rulesets
CreateDataQualityRuleset, GetDataQualityRuleset, UpdateDataQualityRuleset
and DeleteDataQualityRuleset answered InvalidAction, and
ListDataQualityRulesets always returned an empty list, so Terraform's
aws_glue_data_quality_ruleset failed at its first apply.
Rulesets are now stored per account and Region by name, with their
description, DQDL text, target table, security configuration and created
and last modified times, and tagged through the shared tag store by their
dataQualityRuleset ARN. Update replaces only the members the request sets.
List returns them in name order with RuleCount, filtered by name,
description, target table, created and last modified times and tags, and
paged by MaxResults and NextToken. Errors follow the model:
AlreadyExistsException for a duplicate, EntityNotFoundException for an
unknown name, InvalidInputException for a missing or oversized member.
Rulesets are stored, not evaluated.
Closes#6830
* fix(glue): match a ruleset's catalog and take its store from the caller
The ListDataQualityRulesets target table filter compared only TableName and
DatabaseName, so filtering for one catalog also returned a ruleset on the
same table in another. A CatalogId in the filter now has to match too, with
a target table that names no catalog in the account's own.
The package-private GlueService constructor built the ruleset store itself;
it now takes it as an argument, as it does every other store.
* fix(glue): reuse hasTags and AwsJsonTimestamp for ruleset listing
The ruleset tag filter now goes through hasTags, as jobs, crawlers and
triggers do, and the list filter's timestamps through
AwsJsonTimestamp.epochSeconds, so a timestamp sent as a string is refused
with InvalidInputException as the SDKs never send one.
---------
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>