Bootstrap actions "run on cluster after Amazon EMR launches the
instance", on every node, and "If you add nodes to a running cluster,
bootstrap actions also run on those nodes in the same way". Floci ran
them once, as on the primary node, and every node ran from the image they
left, so an action's branch for the core or task nodes never ran.
Where a cluster's core and task nodes run in containers of their own,
each now runs the actions too, in a bootstrap container of its own beside
the primary node's, as that node: its node files say CORE or TASK, the
cluster's relay answers its instance metadata as that node, its output
goes under its own instance id, and the container is kept as the image
the node runs from, so it holds what its own actions installed. A node a
resize adds runs them before it starts, and one that leaves takes its
image with it, so one added again runs them again.
AWS terminates a node whose action fails and says only that "If too many
instances fail their bootstrap actions, then Amazon EMR terminates the
cluster. If just a few instances fail, Amazon EMR attempts to reallocate
the failed instances and continue". Floci runs a node's actions again
once, in a fresh container, and a second failure ends the cluster with
BOOTSTRAP_FAILURE and a message of Floci's after the primary node's, as
no source gives AWS's words or an error code for a core or task node.
CloudWatch's console target (CloudWatchVersion20130116.) now serves
PutMetricData, which it used to answer with UnsupportedOperation. It
accepts a nonempty MetricData array whose datums carry a finite numeric
Value or a complete StatisticValues set with a positive SampleCount,
string dimensions and a valid timestamp, and checks the whole batch
before storing anything: a malformed or conflicting datum, or a member
the handler does not parse such as Values, Counts or StorageResolution,
refuses the request without a partial write. Signature validation and
IAM checks are the same as on the SDK prefix.
Under IAM enforcement, a Distributed Map's S3 calls are now authorized as its execution role, which has to exist and to trust Step Functions. An ItemReader needs s3:GetObject on the object it reads or s3:ListBucket on the bucket it lists, offering s3:prefix when the request has one, as a direct listing does. A ResultWriter needs s3:PutObject on each object it writes: SUCCEEDED_0.json, manifest.json, and FAILED_0.json when a child failed. Every key is evaluated before the first write, so a refusal leaves no partial export. Each is evaluated in the bucket's own partition, and the bucket's policy can grant or deny it.
A refusal fails with States.ItemReaderFailed or States.ResultWriterFailed, and an execution role refused outright with States.Permissions, so Retry and Catch on the Map apply. A refused reader runs no child; a refused writer fails the Map run after its children, as any writer failure does. The multipart actions and s3:GetObject the CDK grants a ResultWriter are not needed, since Floci writes each file in one PutObject. PARQUET and MANIFEST make no S3 call and keep their answer. Credentials on a Map or inside its reader or writer are not read. A mocked execution is evaluated on these calls too, since a test case cannot mock a Map and its S3 calls stay real, and with enforcement off nothing changes.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
TaskPermissions decided a Step Functions aws-sdk:cloudformation task by six
hand-written operation sets and looked stacks up through four handler methods
of its own. With CloudFormation now read from iam-request-resources.json, a
task goes through the generic requestPermissions, as the same request made
directly is checked: CloudFormationStoredResourceArns, from the handler's
storedResourceArns(), finds the stack or the stack set a name names, and a
request naming none, whatever the task's input is, is checked on *, as the
direct request is. The operations checked are the ones the table reads; one
the handler does not serve is then its own UnknownAction.
So a change set named by its ARN alone, a describeStackResources by
PhysicalResourceId alone and a request with no StackName are checked on *,
a stack or stack set CloudFormation does not hold with its id open, and a
stack id it does not hold as given. The six sets, the arm's own lookups and
the handler and service methods only they used are gone.
* feat(elasticache): IncreaseReplicaCount, DecreaseReplicaCount and TestFailover
* fix(elasticache): refuse a replica count change or failover without a ReplicationGroupId
* fix(elasticache): number a group's members so a decrease keeps the primary
EC2 now serves CreateSnapshot, DeleteSnapshot and CopySnapshot for EBS
volumes. CreateSnapshot takes the volume's size and encryption, is owned
by the caller and accepts snapshot tags from TagSpecification.
DeleteSnapshot removes the snapshot and its tags, and refuses with
InvalidSnapshot.InUse while a registered AMI uses it. CopySnapshot copies
from SourceRegion into the request's Region as a new snapshot, encrypted
when the source is, when Encrypted=true or when the destination's
encryption by default says so, without the source's tags. All three
honor DryRun, keeping the error the real call would give.
An unsigned, unversioned CopySnapshot now routes to EC2, since Floci's
ElastiCache does not serve it. RegisterImage builds its snapshot records
through the same helper.
Closes#7943
Adds ListPackageVersionDependencies, extracted from each format's own metadata
file: the POM for Maven, package.json for npm, the wheel/sdist metadata for
pypi, and the .nuspec for NuGet. Scoped to exactly npm/pypi/maven/nuget,
matching AWS's own documented Valid Values for this action's format
parameter; generic, cargo, ruby, and swift are rejected with a
ValidationException even though cargo's own sparse index already carries the
data, since AWS does not document cargo as a valid format for this specific
action.
A new RepositorySidecarManager#listPackageVersionDependencies default method
(throwing UnsupportedOperationException, the same convention
listPackageVersionAssetNames already uses) is overridden by all four valid
formats' sidecar clients:
- ReposiliteSidecarClient tries the version's standard release POM name
first, falling back to the real directory listing for a -SNAPSHOT
version's own timestamped filename (and surfacing a genuine fetch error
through that same fallback, rather than reporting it as an empty
dependency list), and parses it with a new PomDependencies helper. That
helper only ever walks direct children of a known element rather than
Document#getElementsByTagName, specifically so a managed version pin under
dependencyManagement or a conditionally-activated dependency under profiles
is never mistaken for a real, always-active dependency. One synthetic
"parent"-typed entry is emitted when <parent> is present. No ${property}
placeholder resolution on a dependency's raw version text, a documented
limitation.
- VerdaccioSidecarClient reads dependencies/devDependencies/
peerDependencies/optionalDependencies straight off the already-fetched
packument's version document, splitting a scoped dependency name the same
way CodeArtifactNpmDataPlane already does for the package's own name.
- BagetterSidecarClient reuses the same already-proven .nuspec fetch
fetchPackageVersionReadme falls back to, with NuspecXml extended with a new
dependencies() method that flattens every <group targetFramework> block
(and the older schema's bare <dependency> with no group wrapper) into one
list.
- PypiserverSidecarClient is new ground: a new PypiVersionMetadata helper
opens a real wheel via plain ZipInputStream, or an sdist via GZIPInputStream
plus a new minimal hand-rolled TAR reader (classic 512-byte headers only,
no long-name or PAX support) for .tar.gz/.tgz, or via ZipInputStream for a
.zip sdist, bounding the total bytes it will ever decompress while
scanning one archive so a small, highly compressible entry ahead of the
real metadata entry cannot force unbounded decompression. Only the exact
top-level dist-info/METADATA or PKG-INFO entry is matched, never a nested
one, so a wheel or sdist that vendors another package's own dist-info
alongside its own cannot have that vendored entry mistaken for the real
one. Requires-Dist headers are parsed with RFC822 continuation-line
folding, stopping at the blank line that ends the real header block so a
Requires-Dist-looking line inside the package's own long description is
never read as a real dependency. Any "; extra == ..." environment marker
is kept verbatim in versionRequirement rather than stripped, since
PackageDependency has no marker field. A release available only as a real
.tar.bz2/.tar.xz sdist is reported as having no dependencies rather than
attempted, since bzip2/xz decompression would need a new runtime
dependency this codebase deliberately avoids.
XmlParser gained a new parseDocument(byte[]) overload so a POM or .nuspec's
own raw bytes reach the parser directly: the existing String-based overload
pre-decodes as UTF-8 before the parser ever sees the original bytes, which
would silently corrupt or fail to parse a document that declares a different
encoding. PomDependencies and NuspecXml both now go through the byte-based
overload.
CodeArtifactService#listPackageVersionDependencies validates the format
against this narrower set before the shared validatePackageCoordinates call,
which already enforces the maven-namespace-required and
pypi/nuget-namespace-forbidden rules AWS documents for this action.
Pagination's cursor now folds in each entry's own original-list index as a
final tiebreaker, so two byte-for-byte identical dependencies (e.g. the same
NuGet package id declared under two different target-framework groups with
the same version requirement) never share a cursor and silently drop across
a page boundary.
Verified with standalone parser unit tests, per-client wire-contract tests
against a JDK HttpServer fake, CodeArtifactServiceTest dispatch and
validation cases, and a live Docker-gated round trip added to all four
existing format Docker integration tests, each publishing a real artifact
with real dependency metadata through the real sidecar container.
AWS Glue serves the Apache Iceberg REST catalog at
glue.<region>.amazonaws.com/iceberg, the catalog Spark, PyIceberg,
Trino and DuckDB attach to read and write Glue's Iceberg tables. Floci
had no such endpoint, so none of them could write an Iceberg table
through it, and DuckDB, which writes Iceberg only through an attached
catalog, could not write one at all.
Floci now serves it at /iceberg, routed by the request's signing
service as other contested REST paths are, with the twelve operations
AWS lists for it. A namespace is a Glue database and a table a Glue
table with table_type ICEBERG. The writer writes data files and
manifests; a commit checks the request's requirements, applies its
updates to the table's metadata JSON, writes the next metadata file
next to the last one and moves the Glue table's metadata_location to
it, refused with CommitFailedException when the Glue table changed
since. A staged create is committed with assert-create, as DuckDB and
Spark create tables. No Iceberg library is involved.
An environment's NetworkConfiguration names the subnets Amazon MWAA
runs its workers in, but the Airflow container stayed on Floci's own
network, so a DAG could not reach an EC2 instance, or anything else in
the VPC, at the private address EC2 reports.
Before the container starts, it now joins its VPC's Docker network at
an address leased from the first subnet, as EC2 instances and
VPC-configured Lambda functions do, and keeps the network it was
created on, where its metadata database is. The address goes back once
the container is removed, on delete or after a failed start. A subnet
EC2 does not know, or VPC networks switched off, leaves it as before.
An EMR node keeps files about itself that bootstrap actions read to tell
which node they run on. AWS documents two fields of them: the EMR
Management Guide's bootstrap action reads isMaster from
/mnt/var/lib/info/instance.json, and AWS's Knowledge Center reads
instanceRole from /mnt/var/lib/instance-controller/extraInstanceData.json
with jq, comparing it, lowercased, with master, core and task.
Floci now writes those two fields, and nothing else: isMaster true and
instanceRole MASTER in the bootstrap actions' container and each step's,
which run as on the primary node, and in the primary node's own, and
false with CORE or TASK in each core or task node's, the roles as the
API's InstanceRoleType names them. They are written as the image's
hadoop user, whose /mnt is, so Hive's metastore can still write under
/mnt/var/lib, and moved into place whole, as steps share /mnt. The
bootstrap container's copies go before it is kept as the cluster's image.
Files that cannot be written fail the bootstrap, the step or the node.
CloudFormation now provisions AWS::ElastiCache::ReplicationGroup instead
of completing the stack with no cache behind it. The group is created
through the ElastiCache service, Ref returns its id, and Fn::GetAtt
exposes the configuration endpoint for a cluster-mode group or the
primary, reader and per-node read endpoints otherwise. A create-only
change replaces the group, an explicit ReplicationGroupId that stays the
same is refused, and an update that reuses the group warns only about the
properties it ignores.
Optional booleans in the ElastiCache, IoT authorizer, API Gateway API key
and StackSet provisioners are read through
ProvisionContext.resolveOptionalBoolean, which refuses a value that is
neither true nor false instead of reading it as false.
Closes#8447
An ALB routed to targets still in the initial state beside healthy ones,
so a newly registered target that was not ready took requests before its
first health check passed. While a target group has a healthy target,
the proxy now routes only to its healthy targets; when none is healthy it
still fails open to every registered target, matching the ALB guide's
"Before a target can receive requests from the load balancer, it must
pass the initial health checks". The integration tests share their
target group and health state helpers.
Closes#8451
Under IAM enforcement no S3 Tables request was checked: its model was
not among the vendored REST routes and its namespace's request
resources were not read, so no request mapped to an action and every
call went through, DeleteTableBucket and the policy calls included.
s3tables is now vendored by regen_rest_routes.py and read by the
request-resources, tag-on-create and passed-role generators. A table
bucket call is checked on the bucket its path names. A table's ARN ends
in an id the service mints, which no request carries: a request names
the table by its table bucket's ARN, its namespace and its name. A new
generic rule in the request-resources generator reads such a type,
found by its service by those path labels (or GetTable's query string
members, when tableArn is absent), instead of filling the bucket's name
from the table's name or reading the bucket's ARN as the table's.
S3TablesStoredResourceArns answers it from the stored table, read only.
Creating an ECS service with the CODE_DEPLOY deployment controller now
creates its initial PRIMARY task set at 100 percent scale, as the ECS
guide describes. The set reuses the service scheduler's deployment ID, so
its running and pending counts follow the tasks the scheduler already
launches, and it reaches STEADY_STATE once they converge. CreateService,
DescribeServices and DescribeTaskSets return it, CODE_DEPLOY services
report an empty deployments list, and the set is removed with the
service. Task sets added through CreateTaskSet keep their simulated
counts.
Closes#8235
Every node of an EMR cluster is an EC2 instance, so any process on it,
a bootstrap action, a step or a Spark executor, reads its instance
metadata at 169.254.169.254. In the docker runner mode nothing answered
there: a bootstrap script reading its availability zone got nothing.
A relay container on the cluster's own Docker network now holds that
address as a link-local one, as ECS's credentials endpoint is held, and
each of the cluster's containers gets a link-local address of its own
there, so none needs privileges. The relay forwards to Floci's EC2
metadata server, naming its caller in X-Forwarded-For, which the server
reads only from the relays it trusts; the server answers each container
as the instance it is: the bootstrap actions and each step as the
primary node, each core or task node's container as that node, with the
instance id, type, private address and name ListInstances gives, the
cluster's availability zone and its JobFlowRole instance profile. The
metadata server now starts for the docker runner mode too.
DescribeCluster's Ec2InstanceAttributes now gives Ec2AvailabilityZone,
the one RunJobFlow's Instances.Placement names, else the Region's first,
so the metadata and the cluster agree.
CloudFormation was not read by the request-resources generator, so under IAM
enforcement every CloudFormation request was checked on *: a grant scoped to a
stack or a stack set was refused, and a deny scoped to one never applied.
cloudformation now moves into NAMESPACES (100 operations). One rule is fixed:
an account member named after another record's shape names that record's
account, not the type's (StackInstanceAccount is a StackInstance's), so a
stack instance call is checked on its stack set in the caller's account.
A stack or a stack set named by its name is checked on the ARN CloudFormation
minted for it, which CloudFormationStoredResourceArns finds, reading only, or
with its id open when it does not exist yet. A request naming its stack by
no StackName (a change set by its ARN alone, DescribeStackResources by
PhysicalResourceId alone) stays on *, as the generated data gives it.
DescribeStackSet now returns StackSetARN, which botocore gives and Floci
left out, in the Region of the request naming it.
* refactor(autoscaling): register target group members next to their deregistration
* feat(autoscaling): keep the groups EKS manages for its node groups
* feat(eks): give each managed node group the Auto Scaling group it reports
* refactor(autoscaling): build groups and read a Region's groups through shared helpers
* fix(autoscaling): change an EKS group's node and target groups under the Region's lock
* fix(autoscaling): refuse moving or replacing an EKS group's node
* fix(eks): create a node group's Auto Scaling group once, and delete the others past a failure
* docs(eks): what an EKS node group's Auto Scaling group allows, and what ordinary groups register
* fix(autoscaling): keep an EKS group's target group attached when ELBv2 refuses to deregister its node
* test(eks): build the node group Auto Scaling tests' EKS requests with one EksRequests helper
* test(eks): build the access entry, add-on, Pod Identity and Region scoping tests' EKS requests with EksRequests
* test: read a target group's registered targets with one AlbFixtures.targetIds
* test(autoscaling): match a single deregistered or registered target with one onlyTarget matcher
* test(autoscaling): delete a group sharing the node through EKS and through Auto Scaling in one test
* perf(eks): read only the registering node's cluster when adding it to its node groups' Auto Scaling groups
* docs(autoscaling): say an EKS group's node is registered with an elbv2 traffic source
ExportKey and ImportKey take an As2805KeyCryptogram: a TDES key leaves and
comes back under a TR31_K0 TDES key encryption key, bound to one of the
four AS2805 variants. The cryptogram carries a tag over the whole of it,
made under a key derived from the wrapping key and checked before anything
is decrypted, and the key's ANSI X9.24 check value, which the import
compares. A wrapping key that is not K0, not TDES or weaker than the key is
refused, as is a variant that does not match the key's purpose.
Bytes holds the concat, PKCS#7 padding and isHex the payment cryptography
classes kept copies of, and the SDK and CLI compatibility tests cover the
round trip and its refusals.
* fix(mq): scope brokers by account and Region
* fix(mq): write a ready broker back under the account and key it is stored under
* test(mq): check broker Regions over HTTP in an account of its own
* fix(mq): check a broker's name and store the broker under one lock
* fix(mq): keep a broker name unique across the account's Regions
* refactor(mq): derive a broker's Region in one place
* test(mq): race two broker creates on the shared parked-store helper
* refactor(mq): run the readiness poller's pass from a method tests can call
* test(mq): check the error type of each refusal from another Region
* test(mq): run the other Region's refusals through one loop
* refactor(storage): name the all-accounts migration like its neighbours
* docs(mq): say that brokers are Regional and names unique in the account
Health at /_floci/health, /_localstack/health and /health gains status UP
and cloud aws from one shared body. GET /_floci/tls-cert serves the same
PEM as ca.pem, as application/x-pem-file, and answers the shared 404
{tlsEnabled, error, message} when TLS is off.
A path under /_floci or /_localstack that no route serves answers a JSON
404 from ControlPlaneNotFoundFilter instead of falling through to S3, and
S3VirtualHostFilter leaves those paths alone, so a virtual-hosted request
can no longer address a key under _floci/ or _localstack/. The endpoints
are documented on one page.
A cluster's primary, core and task nodes ran on the cluster's own
Docker network alone, so a cluster-mode Spark driver or an executor on
them could not reach an MSK cluster's brokers, an RDS instance or any
other container Floci starts: reading a topic timed out waiting for a
node assignment. The nodes did not use Floci's DNS either, so Iceberg's
S3FileIO, which addresses buckets as virtual hosts, failed on
UnknownHostException for <bucket>.<host>.
Each node now joins the network its cluster's steps run on, the one
those containers are on, before it starts, with Floci's DNS, as a
cluster's nodes reach what is in their VPC; executors reach Floci's S3
as the steps do. A node an earlier Floci left on the cluster's network
alone starts again on its data. Where the steps share a namespace or
have no network of Floci's, nothing changes. A node's HDFS and YARN
listen on its address on the cluster's own network alone, found in that
network's subnet as the node starts, so another cluster's step on the
shared network reaches neither, nor submits work to the nodes. Hive 3's
metastore has no setting for the address it listens on, so the primary
node of a cluster with Hive or HCatalog, which runs it, stays on the
cluster's network alone, and so does every node where Docker does not
say that network's subnet.
ContainerBuilder.withJoinedNetwork names a further network a container
joins between its creation and its start, and ContainerLifecycleManager
connects it there, removing the container when it cannot.
No write read the values a statement's action elements name, so a document
naming a bare verb was stored and only told apart later, by whatever tried to
decide with it. AWS refuses that document before it stores anything, with
MalformedPolicyDocument at 400 and the clause's own sentence,
"Actions/Conditions must be prefaced by a vendor, e.g., iam, sdb, ec2, etc.",
fixed text with no request value in it. The resource elements beside them have
been read value by value for a while, so this is the action half of the same
clause check.
The policy grammar writes an action as a service namespace, a colon and the
name of an action, and an action element may name the bare wildcard instead,
which stands for every action there is. So a value passes when it is "*" or
carries a namespace before a colon, whatever the name after it spells: "s3:*"
and "iam:*AccessKey*" are the reference's own examples of a wildcard inside the
name. A value that is no string is held to the text it spells, as the Version,
the Effect and the resource values already are, so "Action": 123 is refused
where "Action": "123" was; an element carrying null still names nothing, which
is the element's own sentence rather than a value to read.
The namespace is asked for rather than looked up. No sentence anywhere says AWS
refuses an action whose vendor it does not publish, so reading these values
against a catalog of services would refuse documents AWS stores and would make
an action of a service this emulator has yet to model impossible to write. What
is read is the shape the grammar gives, nothing more.
Both identity validators word this clause alike, the effect being the one clause
of an identity document whose sentence follows the validator that read it. The
actions are read before the resources, which is the order the elements a
statement must carry are already read in, so a document missing both answers the
action sentence first. No code and no status moves: the refusal is
MalformedPolicyDocument at 400, as every other sentence of this reader is. AWS
words the clause for actions and condition keys together and only the actions
are read here, a condition key being a value neither validator reads yet.
A LazySimpleSerDe table over headerless TSV came back as column00,
column01 and the view's projection failed to bind: Athena's views were
built with readExpression, which ignored the table's CSV options
(field.delim, skip.header.line.count) that only Redshift Spectrum's
read plan applied. Views now read such a table with read_csv and those
options, naming the file columns after the declared data columns, and
give each data column its declared type with TRY_CAST, NULL for a value
the type cannot hold, as LazySimpleSerDe does.
Every query also built a view for every Glue table, and DuckDB binds
each view before running the query, so one table whose view could not
be built failed all queries. Views are now built only for the tables
the query names, or for every table when it reads information_schema or
is a SHOW statement.
* fix(lambda): accept layer ARNs when deleting versions
* test(lambda): share layer publication cleanup
* test(iam): include layer deletion in the resource inventory
* fix(lambda): read Lambda's IAM resources whole from the generated table
With Floci in a container and the MWAA proxy range published on that
container (`8760-8769` in compose), every CreateEnvironment ended
CREATE_FAILED with "No free port available in range". The allocator
counts every host port any container publishes as taken, Floci's own
included, but the proxy listens inside Floci's container, so a port
Floci's container publishes is its way in, not a conflict.
PortAllocator gains allocateForInProcessListener: inside a container it
decides on the bind probe in Floci's own namespace alone, and outside
one it is allocate. The MWAA proxy allocates its port with it.
16f-UPSTREAM-REPO (#8261) gave every container-backed format its own
repository-to-repository upstream importer except cargo, since cargo didn't
exist yet when that PR merged. Adds cargo's own share of it.
CodeArtifactCargoUpstreamRepositoryImporter mirrors
CodeArtifactNuGetUpstreamRepositoryImporter's own claim/fence/walk shell
(transitive search via resolveUpstreamSearchOrder, Archived/Disposed
propagation, falling through to UpstreamExternalConnectionFetch for the last
leg through a candidate's own external connection), reusing
CodeArtifactCargoExternalConnectionImporter's own index-line/wire-body helpers
directly rather than duplicating the index-shape to publish-shape mapping a
second time.
The one new piece: mergeUpstreamRepositoryVersions, a real multi-version
sparse-index merge across the whole upstream chain, the same reason
mergeExternalVersions exists for the external-connection side. Unlike pypi's
own single-target additionalInternalFilenames, this walks every reachable
upstream candidate in search order rather than stopping at the first one with
anything to offer, since it is merging real version lines across however many
hops the chain has; each candidate's own external connection, if it has one,
is layered in too via a direct mergeExternalVersions call with that candidate
as the repository argument.
Wired into CodeArtifactCargoController's existing two call sites, matching
every sibling controller's own "external connection or upstreams, never both"
shape. A live Docker integration test proves the real synthesized wire body
this importer builds from one Kellnr container's own sparse-index line is
accepted by a second, genuinely different Kellnr container, not just
internally consistent against mocks.
RunJobFlow kept the SecurityConfiguration it was given, but
DescribeCluster never wrote it out, so the cluster came back with
none, although the model's Cluster has the member. It is given back
now.
RunJobFlow also took a security configuration that was never created.
A cluster names one CreateSecurityConfiguration made, so one that does
not exist is now refused with ValidationException "Security
configuration does not exist: <name>". No source gives AWS's answer,
so the code is the one RunJobFlow refuses its other input with in
Floci, and the wording that of DescribeSecurityConfiguration and
DeleteSecurityConfiguration; emr.md says so.
ListFunctionUrlConfigs answers GET /2021-10-31/functions/{FunctionName}/urls,
which returned 404 before. It returns the stored URL configurations of the
unpublished function and its aliases, with signed markers scoped to the
function, account and Region, and refuses GovCloud and China like the other
URL operations. MaxItems and the marker go through LambdaPagination, and a
missing or foreign function answers Function not found.
The URL, S3 code and permission tests share one Node.js ZIP builder,
LambdaCodeFixtures.nodeJsZip.
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
CreateWebLoginToken returned a token nothing accepted: the proxy had no
/aws_mwaa/login, so a client following Amazon MWAA's REST API guide got
a 404, and with Airflow's session-only API auth every /api/v1 call then
answered 403.
Web login tokens are now kept per environment for the 60 seconds AWS
documents. The proxy intercepts POST /aws_mwaa/login: a valid token in
the `token` form field signs in through Airflow's own login form (CSRF
token and anonymous session from GET /login/, then the admin
credentials Floci generated) and answers 302 to /home with Airflow's
session cookie, which the UI and /api/v1 accept. An unknown or expired
token gets 401.
With floci.tls.enabled, WebserverUrl already named an https endpoint
while the proxy only spoke HTTP; the proxies now serve TLS with Floci's
server certificate and follow its reissues, so a client that builds
https://{WebServerHostname} reaches them.
Athena queries go straight to DuckDB, which has no json_extract_scalar,
json_parse or json_format and cannot parse Trino's ARRAY<T> type
syntax, so `json_extract_scalar(col, '$.a')` and
`CAST(json_parse(col) AS ARRAY<JSON>)` both failed.
Every query now gets DuckDB macros for json_extract_scalar (a scalar as
text, NULL for an object, array, JSON null or missing path, as Trino),
json_parse, json_format, json_size and is_json_scalar, with Trino's
bracketed path members accepted. CAST and TRY_CAST target types are
rewritten to DuckDB's syntax: ARRAY<T> and ARRAY(T) to T[], MAP<K, V> to
MAP(K, V), ROW(...) to STRUCT(...). JSON result columns are reported as
json and unsigned counts as bigint, as Athena types them.
A statement's Effect was compared without regard to case, so "Effect":"allow"
granted and "Effect":"deny" overrode an allow, on a document no write of this
package would have stored: the write validator holds that element to the two
words the language defines, compared literally. The guide is explicit about the
element, "The Effect value is case sensitive", so the two words are the words
themselves here too, and a statement that spells one of them another way states
nothing, which is how an absent effect and one that is no string are already
read. The two service-reachability readers ask the statement for its effect
rather than spelling the word a third time, and denyStatementsOf, the one other
reader of the element in this package, collects a Deny written as Deny.
The principal half is an element that names nobody. A Principal or NotPrincipal
written as a string or a list came to a map carrying whatever the list named, an
empty one included, where the typed spelling already dropped a type whose
entries named nobody. It tells on NotPrincipal, the element whose statement
covers every caller it does not name: "NotPrincipal": [], or a list whose only
entry is no string, spared nobody and so covered everyone the statement
otherwise covered, an Allow written that way granting to any caller there is.
Each entry is written as a <principal_id_string>, so an element whose entries
are no strings names nobody, and a statement whose principal element names
nobody matches no caller now, which is how a NotAction or NotResource naming
nothing already leaves a statement matching neither. An element that is written
and names nobody is still the element the statement carries, so a statement
carrying both of them is decided by its Principal either way, that being the one
the grammar gives precedence, rather than by the NotPrincipal beside it.
S3 reads the same two elements in a pass of its own, the one that decides an
unsigned request, and it read both the old way: an effect without regard to
case, and any NotPrincipal that was there at all as an exclusion. Its readers
take the effect through one place that compares the words as written now, and a
NotPrincipal has to name somebody before it carves anybody out, so one bucket
policy answers a signed request and an anonymous one alike.
The Block Public Access status keeps the old question, and on purpose. It asks
what a policy could grant rather than whom a statement covers: S3 "begins by
assuming that the policy is public" and calls it non-public only when it grants
"only to fixed values" of a principal or of one of the recognised condition
keys. A NotPrincipal pins no principal to a fixed value whether it names
anybody or not, so a statement written that way leaves the policy public there
while granting nobody anything in the readers that decide a request. The effect
is the one element that reads alike everywhere, the guide's case rule being
about the element itself.
Every half reads a document already stored or supplied rather than checking one
being written: no code and no status moves, and nothing is refused that was not
refused before. A Deny whose NotPrincipal names nobody denies nobody for the
same reason an Allow written that way grants nobody, which is this emulator's
own reading of an element AWS leaves undefined.
EventBridge Scheduler was built by hand in ResourceArnBuilder. It now moves
out of HAND_BUILT into NAMESPACES, so every operation's resources come from
iam-request-resources.json, and the hand builder and the enforcement filter's
routing to it are gone.
A schedule a request names with no group is in the default group, as
botocore documents GroupName: "If you omit this, the default schedule group
is used" (CreateSchedule, DeleteSchedule), and "EventBridge Scheduler
assumes that the schedule is associated with the default group"
(GetSchedule, UpdateSchedule). The rule that reads ECS's "If you do not
specify a cluster, the default cluster is assumed" now reads this phrasing
too, and SchedulerService answers the default group's ARN, reading only. A
resource already chosen by whether its member names the default (an
EventBridge rule on the default bus or on another) takes no default of its
own, so EventBridge's entries stay as they are.
Tagging is checked on the group Scheduler's modeled /tags/{ResourceArn}
carries, the only tagging route AWS gives it. The shared tags controller
now serves a namespace the generated table reads whole only on the routes
its model gives: the bare /tags, or an ARN whose slash is not encoded, is
refused for Scheduler, EMR Serverless, GuardDuty and Security Hub with the
controller's existing "Invalid resource ARN", and tags nothing, rather than
being checked on * where a Deny on the resource would not apply.
* feat(stepfunctions): evaluate the execution role on the remaining task integrations
* fix(stepfunctions): check a Secrets Manager task from the generated request resources
A step's script that ran sudo -u hadoop spark-submit ..., as a step
does on EMR, failed with exit code 127, as the image steps run in has
no sudo. The Release Guide's "Using HBase snapshots" runs a
command-runner.jar step of sudo -u hbase, and the Management Guide's
Kerberos users page a script-runner.jar script running sudo
kadmin.local. Only bootstrap actions had Floci's sudo, which went
before the image was kept.
Each step on a cluster now finds that same sudo first on its PATH,
written next to the hdfs and hadoop-streaming stand-ins the cluster's
Hadoop setup already writes there, and a Hive step's shell commands
find it too, written while its container is still root. It drops its
options, a long one's value given apart included, and runs the command
as the step's own hadoop user, so sudo -u hadoop runs as on EMR, while
a command that needs root fails as it would for hadoop. The script
moves to EmrServerlessSparkRunner, where the setup is, and the
bootstrap actions write it from there.
IMDS answered /latest/meta-data/placement/availability-zone but not
availability-zone-id, which AWS serves and scripts read to pick
zone-specific resources. It now returns the zone's ID, the same one
DescribeSubnets and DescribeAvailabilityZones report for that zone.
GetTable and GetTableMetadataLocation never returned warehouseLocation,
which the S3 Tables model marks required, so Spark's S3TablesCatalog
had nowhere to write: CREATE TABLE failed with "Invalid S3 URI, cannot
determine scheme: null/metadata/00000-...metadata.json".
CreateTable now creates the table's warehouse, a bucket of its own named
like AWS's (<uuid>--table-s3), and both responses report it; a table
persisted before this gets one the first time it is read. An Iceberg
client writes the table's files there and commits with
UpdateTableMetadataLocation, which already existed. DeleteTable deletes
the warehouse with its contents, as deleting an S3 Tables table deletes
its data. GetTable also reports the required createdBy and modifiedBy.
Athena runs Hive DDL against the Glue Data Catalog, but Floci sent every
statement other than CREATE DATABASE to DuckDB: CREATE EXTERNAL TABLE,
ALTER TABLE ADD PARTITION, MSCK REPAIR TABLE and SHOW PARTITIONS failed
to parse, and DROP TABLE succeeded without touching Glue.
AthenaHiveDdl parses CREATE EXTERNAL TABLE (columns, PARTITIONED BY,
CLUSTERED BY, ROW FORMAT DELIMITED or SERDE, STORED AS, LOCATION,
TBLPROPERTIES, with the SerDe parameters and input/output formats Hive
stores), DROP TABLE, ALTER TABLE ADD/DROP PARTITION, MSCK REPAIR TABLE
and SHOW PARTITIONS; AthenaHiveDdlExecutor applies them to Glue as
Athena does: DROP TABLE keeps the data, MSCK only adds Hive-style
partitions, IF [NOT] EXISTS turns duplicates and misses into no-ops,
and SHOW PARTITIONS writes its rows as the query's result. A CREATE
TABLE without EXTERNAL fails unless it is Iceberg or CREATE TABLE AS,
which still go to the query engine. Mock mode keeps DDL result rows.
With Floci in a container and no bootstrap hostname configured,
GetBootstrapBrokers returned the broker container's IP, a bare address
where AWS returns broker hostnames. The broker's internal listener
already advertises <container-name>:9092, so a client that bootstrapped
from the IP was handed that name by the first Metadata response anyway.
GetBootstrapBrokers now returns <container-name>:9092.
RunInstances already refused an AMI whose architecture the instance type
cannot run, as AWS does, but said "The architecture 'x86_64' of the
specified image does not match the architecture supported by instance
type 'm6g.large'.". AWS names the instance type's architecture first:
"The architecture 'arm64' of the specified instance type does not match
the architecture 'x86_64' of the specified AMI."