CreateEnvironment stored and GetEnvironment echoed back
AirflowConfigurationOptions, but nothing translated it into the
container's actual configuration, so a DAG reading a custom
conf.get("section", "key") value at import time or task-run time got
nothing back, even though GetEnvironment reported the option as
configured.
Added MwaaEnvironmentManager.airflowConfigurationOptionsEnv, which
converts each AWS "section.key" entry into the AIRFLOW__SECTION__KEY
environment variable real Amazon MWAA sets for the same option, and
wired it into startAirflowContainer's env list. A malformed key (no
"section.key" dot on both sides) or one that would collide with a
variable Floci itself manages (PROTECTED_ENV_VARS: the executor,
database connection, security keys) is skipped and logged rather than
silently breaking the environment's required wiring.
Since this map now genuinely does something instead of being inert,
also added the validation CreateEnvironment's botocore model declares
for it (a 1-64 character key matching [a-z]+([a-z0-9._]*[a-z0-9_]+)?,
a 1-65536 character printable-ASCII value) as a server-side
ValidationException: the AWS SDKs enforce this client-side, but Floci
is also reachable via raw HTTP/CLI --cli-input-json, which bypasses
that, and an oversized or malformed entry should be rejected before
Docker container creation rather than passed through.
Fixes#3436
hasAirflowContainerExited only inspected the Airflow container. If the
sibling Postgres container dies instead (out of memory, its volume
filling up), Airflow keeps running but never reports metadatabase
healthy, so the environment sat at CREATING exactly as before this
existed, the same failure mode #3446 fixed for the Airflow container
alone.
Generalized into hasAnyContainerExited, backed by a shared per-container
helper, checking both Environment.getDbContainerId() and
getAirflowContainerId(). checkReadiness and its log messages updated to
match; behavior for a lone Airflow-container failure is unchanged.
Follow-up from hectorvent's review on #3446.
* docs: standardize Java code style rules
AGENTS.md becomes the canonical Code Style source, regrouped into General,
Types and names, Imports, conventions the codebase already follows, and Tests.
Two new rules: write explicit types rather than var, and import classes rather
than writing fully-qualified names inline. Both are stated with the reason they
matter here, that the concrete type at a call site is usually what a wire
contract reviewer needs to see, and with the one exception each: record
deconstruction patterns for var, and genuine same-file name collisions for
qualified names.
The rest is existing practice written down so it stays true. Each claim was
measured against src/main and src/test: no printStackTrace, no logger field
named anything but LOG, no Calendar and no SimpleDateFormat. The System.out
rule exempts CLI entry points under tools/, which is its one real use. The
empty-catch rule now blesses naming the variable ignored or expected, the
convention the code already uses.
Two conventions are stated with the exceptions the tree actually contains
rather than as absolutes. java.util.Date survives where a third-party
signature forces it, in the BouncyCastle certificate builder and the JAX-RS
HttpHeaders.getDate() override, so the rule is java.time on Floci's side and
conversion at that boundary. Tab indentation is banned as such, since a JSON
text block may legitimately contain a tab as string content.
CONTRIBUTING.md and docs/contributing.md had no code style section at all, and
copilot-instructions.md had no code style content, so PR review could not flag
either new rule. The Copilot entry also lists the collisions it must not flag.
Existing code does not satisfy these everywhere. The rules are documentation
only: nothing in CI enforces them, and no Java file changes here.
* docs: correct the measured claims in the code style section
Review on #3451 caught that System.out is not confined to the tools CLI: four
test files print too. Checking the rest of the section the same way found five
more claims that do not survive a measurement, so this corrects all six rather
than only the reported one. The section's whole value is that a reader can trust
it without re-measuring.
System.out and System.err are now scoped to src/main, the way the wildcard
import rule already splits src/main from tests. The exception is named by its
real coordinates: AmiImageTool sits in the Java package
io.github.hectorvent.floci.tools.ami, not in the top-level tools/ directory,
which holds only tools/docs. printStackTrace stays absolute, since that one
holds: zero in src/main and src/test.
The Date rule listed two forced boundaries and there are three. BouncyCastle's
certificate builder and the JAX-RS HttpHeaders.getDate() override are joined by
JDBC's java.sql.Date, which extends java.util.Date and which the old wording
read as prohibiting, in RdsDataFieldMapper and RdsDataSqlParameters.
Optional is split, because half the claim was true. Never a field is exact,
there are none. Never a parameter was wrong: Quarkus threads
@ConfigProperty Optional<T> values through parameters in ResolvedServiceCatalog,
ContainerBuilder, DockerClientProducer and LaunchedContainerAwsEnv.
The three Tests rules each asserted something false. testX is not absent, it
names 291 methods across 52 files, so it is described as the older pattern not
to copy rather than as something that never happens. AssertJ is not absent
either, it is a declared test dependency used by the six Lambda launcher tests.
@DisplayName is genuinely rare in src/test, 13 files of 1455, but it is the norm
in compatibility-tests at 183 of 208, as is AssertJ at 197 of 208. That module
has the opposite idiom, so the Tests rules now say they describe src/test and
point a contributor at the module they are in.
Documentation only. No Java file changes here.
docker start only launches the entrypoint and returns immediately, so a
startup script or `airflow db migrate` failing partway through never
surfaced anywhere: the readiness poller only checked isReady() and had no
path back to a failure status, so the environment reported CREATING
forever instead of CREATE_FAILED.
MwaaEnvironmentManager.hasAirflowContainerExited inspects the container's
running state (docker-removed counts as exited too), and the readiness
poller (extracted into checkReadiness for direct testability) now marks
CREATE_FAILED when isReady() is false and the container has exited.
Two things this needed to stay safe under concurrency and partial
failure, both of which isReady() already handles and this had to match:
- isReady()/hasAirflowContainerExited() are blocking Docker/HTTP calls,
wide enough for a concurrent DeleteEnvironment (which sets DELETING on
the same Environment instance before tearing down its containers) to
have moved the environment past CREATING in the meantime. checkReadiness
re-checks the status immediately before writing, in both branches, so it
can't resurrect a just-deleted environment into storage with a status
decided from stale, pre-delete information.
- hasAirflowContainerExited only treats NotFoundException (the container
is actually gone) as exited; any other Docker error is inconclusive and
must not propagate, since the readiness poller shares one loop across
every CREATING environment and an uncaught exception from one
environment's check would otherwise skip every other environment for
that poll tick, the same failure mode isReady()'s own catch-all already
avoids.
Fixes#3437
* feat(datasync): add the DataSync management plane
Emulates the AWS DataSync management API over JSON (X-Amz-Target
FmrsService.<Action>, signing name datasync): agents, the eleven
CreateLocation/DescribeLocation/UpdateLocation trios plus the shared
ListLocations and DeleteLocation, tasks, and resource tagging.
Each DescribeLocation* projects the create request that produced the
location, so the configuration that went in is the configuration that comes
back, and LocationUri is derived from that request per the scheme AWS
documents for the type. DescribeAgent reports ONLINE and DescribeTask reports
AVAILABLE from the first read, which is what the Terraform provider's
aws_datasync_task waits on. Credential members (Password, SecretKey,
SasConfiguration, the Kerberos files and the nested Protocol.SMB.Password)
are dropped before the configuration is stored, as AWS never reads them back
either. Errors use InvalidRequestException, the only client error the
DataSync model declares.
The task-execution data plane (StartTaskExecution, DescribeTaskExecution,
ListTaskExecutions, CancelTaskExecution, UpdateTaskExecution) transfers real
bytes between real storage systems and keeps raising UnknownOperationException
rather than a stub success.
* fix(datasync): default VerifyMode from the task mode
The DataSync model documents two VerifyMode defaults, not one:
POINT_IN_TIME_CONSISTENT for a BASIC task and ONLY_FILES_TRANSFERRED for an
ENHANCED one, which also cannot use POINT_IN_TIME_CONSISTENT at all. CreateTask
applied the BASIC default to every task, so an ENHANCED task created without an
explicit VerifyMode read back wrong.
The default now follows TaskMode, and a VerifyMode the mode does not support is
rejected with InvalidRequestException, the only client error this API declares.
UpdateTaskRequest carries no TaskMode, so a task keeps the mode it was created
with and UpdateTask applies the same rule against the stored mode. An
unrecognized TaskMode is rejected rather than silently treated as BASIC.
* test(datasync): add the SDK compatibility test
Drives an agent, an S3 and an NFS location, both task modes and the tag round
trip through the AWS SDK v2 DataSync client, which is the one piece of real-SDK
verification the RestAssured tests do not cover. It asserts the VerifyMode
default for a BASIC and an ENHANCED task, and that an ENHANCED task rejects
POINT_IN_TIME_CONSISTENT on create and on update.
---------
Co-authored-by: lex00 <artigues.dev@gmail.com>
Real Amazon MWAA runs every Airflow version through 2.10.x on Python 3.11,
and only 2.11.0 onward (and every 3.x release) on Python 3.12. Floci
hardcoded apache/airflow:<version>-python3.12 for every supported version,
so a requirements.txt built the way AWS documents (a --constraint file
matching the real Airflow/Python pairing, e.g. constraints-3.11.txt for
2.9.x) resolves dependencies for the wrong Python minor version.
Fixes#3438
* feat(bedrock): add guardrail lifecycle and versions
Amazon Bedrock control plane over REST JSON: CreateGuardrail through
DeleteGuardrail, CreateGuardrailVersion, ListGuardrails with pagination, and
resource tagging on /tagResource, /untagResource and /listTagsForResource.
Guardrails report READY on the first read, so the Terraform provider's status
poll for aws_bedrock_guardrail completes without a transition.
The control plane and bedrock-runtime both sign as "bedrock". The runtime
descriptor keeps that credential scope, and the new descriptor routes through
its resource class, which ServiceEnabledFilter checks first.
Policy blocks are stored under the read-shape member names, so a *Config
submitted on create or update reads back unsuffixed. ListGuardrails honours
maxResults and nextToken, and DeleteGuardrail rejects a guardrailVersion that
is not a GuardrailNumericalVersion.
* fix(bedrock): enforce guardrail length caps and resolve kmsKeyId to a key ARN
The AWS model caps description at 200 characters and both blockedInputMessaging
and blockedOutputsMessaging at 500, each with a minimum of 1. None of those were
checked, so an over-long value was stored and read back. name was already bounded
by its [0-9a-zA-Z-_]{1,50} pattern.
kmsKeyId on CreateGuardrail and UpdateGuardrail is a KmsKeyId: a key id, a key
ARN, an alias name or an alias ARN. kmsKeyArn on the read shapes is a KmsKeyArn,
which is only ever the full key ARN. The request value was echoed back verbatim,
so a bare key id or an alias produced a response that does not match the shape
GetGuardrail declares. It now resolves through KmsService.describeKey, the same
way RDS, DocDB and ElastiCache already resolve their KmsKeyId, and a key that is
missing, disabled or pending deletion is rejected with ValidationException.
* test(bedrock): drive the guardrail lifecycle from the AWS SDK v2 client
Adds the bedrock SDK module to the compatibility project, a BedrockClient
factory on TestFixtures, and a BedrockGuardrailTest covering create, read,
update, versioning, listing, tagging and delete. The test also submits kmsKeyId
as a bare key id and as an alias and asserts both read back as the same full KMS
key ARN.
* fix(bedrock): enforce the guardrail tag caps from the AWS model
The AWS model gives TagList a max of 200 items, and that shape backs the tags
member of both CreateGuardrail and TagResource. TooManyTagsException, declared
on both operations, documents a separate limit of 50 tags per resource counted
over the tags already on the resource together with the ones in the request.
parseTagList now rejects an array over 200 items with ValidationException, and
it moved to BedrockService so both entry points share it. CreateGuardrail and
TagResource raise TooManyTagsException once the total the guardrail would be
left holding passes 50, carrying resourceName as the model declares.
* feat(appintegrations): add data and event integrations
Amazon AppIntegrations over REST JSON, registered under the app-integrations
signing name: event integrations on /eventIntegrations, data integrations on
/dataIntegrations, and resource tagging through the shared /tags/{resourceArn}
dispatcher. Terraform's aws_appintegrations_event_integration and
aws_appintegrations_data_integration now round-trip against Floci instead of
failing on an unimplemented signing scope.
Event integrations are keyed by name, data integrations by generated id, and
both accept their own ARN wherever the API takes an identifier. The two PATCH
operations apply only the members present in the request body, matching how AWS
treats an optional member the caller did not send. Both tag writes answer 200,
which is what the 2020-07-29 model gives them.
* test(appintegrations): add an SDK compatibility test
Adds the appintegrations AWS SDK v2 module, a TestFixtures client factory,
and an AppIntegrationsTest that drives both integration types and the tag
round trip through the real SDK client.
* feat(globalaccelerator): add the Global Accelerator management plane
Emulates the AWS Global Accelerator management plane over JSON 1.1 under the
GlobalAccelerator_V20180706 target prefix, signing name globalaccelerator:
accelerators, listeners, endpoint groups, accelerator attributes and resource
tags, 22 actions in all.
Global Accelerator is a global service, so ARNs carry an empty region segment
and listener and endpoint group ARNs extend the accelerator ARN. Nothing is
keyed by the signing region, so a caller that signs outside us-west-2 sees the
same accelerators. Accelerators report DEPLOYED and endpoints HEALTHY from the
first read, so SDK and Terraform waiters complete on their first poll.
Enum and range members are validated against the API model, and
UpdateAcceleratorAttributes rejects an update that would leave FlowLogsEnabled
true with no destination bucket.
* fix(globalaccelerator): enforce the list caps and HealthCheckPath format from the API model
The scalar ranges were already checked against globalaccelerator/2018-08-08, but the
array-count caps were not. PortRanges, EndpointConfigurations and PortOverrides each
declare max 10, and IpAddresses declares max 2 for the BYOIP case. All four were
unbounded. HealthCheckPath declares max 255 and the pattern
^/[-a-zA-Z0-9@:%_\+.~#?&/=]*$, which was not checked at all.
The new failures reuse InvalidArgumentException and the message shape the existing
scalar validations already use, so they are indistinguishable in kind from those.
* test(globalaccelerator): add the SDK compatibility test
Adds the globalaccelerator SDK module, a TestFixtures client factory and a
GlobalAcceleratorTest that drives accelerator, listener and endpoint group
lifecycles through the AWS SDK v2 client, including the new PortRanges cap.
---------
Co-authored-by: lex00 <artigues.dev@gmail.com>
Adds uniform-scaling reshard support via existing splitShard/mergeShards
machinery, with the documented double/half, 10000-shard, and 10-scales-per-24h
limits enforced as LimitExceededException/InvalidArgumentException/ValidationException.
The half-shard-count minimum rounds up for an odd current count, which is
Floci's own call since AWS documents only "below half" with no stated
rounding direction; the separate 10 TPS call-rate limit AWS documents on this
action is not simulated, matching Floci's lack of real-time request
throttling elsewhere. Both are now called out explicitly in the docs and code.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* Fix#3064
Add the remaining SES v2 dedicated-IP operations on top of pool management:
GetDedicatedIps, GetDedicatedIp, PutDedicatedIpInPool,
PutDedicatedIpWarmupAttributes, PutDedicatedIpPoolScalingAttributes, and
PutAccountDedicatedIpWarmupAttributes.
SES has no API to create a dedicated IP (they are leased out-of-band or
auto-provisioned), so Floci models an account with no dedicated IPs:
GetDedicatedIps is empty and any IP-targeted operation returns NotFoundException
'Could not find dedicated IP <ip> under this account.', matching real AWS for an
account with no leased IPs (verified 2026-06-21). PutDedicatedIpPoolScalingAttributes
updates the pool's scaling mode, and PutAccountDedicatedIpWarmupAttributes stores
the account-level flag now reflected by GetAccount.
Add integration and AWS SDK v2 compatibility tests.
* feat(firehose): apply the Lambda transform to buffered records
A flushed buffer now goes to the Lambda processor's function as a single
invocation, and what the function returns is what reaches the destination.
Ok delivers the returned data, Dropped leaves no trace, and every other
outcome routes that record to the error output while the rest of the batch
still delivers: ProcessingFailed, a record the function did not return, a
record id returned twice, and an Ok carrying no data.
A function-level error is retried NumberOfRetries more times and then fails
the whole batch as Lambda.FunctionError; a response the function returned
successfully is final however malformed it is, matching what AWS reports for
a response naming no records at all.
The transformation runs ahead of data format conversion, so a stream
configured for both converts what the function returned, and the
"not applied yet" warning the configuration used to log is gone.
* fix(firehose): clamp a NumberOfRetries wider than a long, and heal a stored Enabled
Long.parseLong threw for a NumberOfRetries too wide for a long, which the
catch treated as "not a number" and answered with the default 3. A larger
retry count than one that clamps therefore got fewer attempts: 2147483648
delivered 101 attempts where 999999999999999999999 delivered 4. Reading it
as a BigInteger keeps the clamp meaningful at any magnitude.
A ProcessingConfiguration persisted before Enabled was defaulted never
passes canonicalizeProcessors again, so the describe path now fills it, the
way that path already self-heals partial BufferingHints. Only Enabled: the
parameters AWS defaults include RoleArn, which a read must not inject from
whatever role is current by then.
* feat(s3): add object annotations support
PutObjectAnnotation, GetObjectAnnotation, ListObjectAnnotations, DeleteObjectAnnotation
via the ?annotation subresource, with per-version storage, x-amz-annotation-directive
on CopyObject, s3:ObjectAnnotation:* notifications, and x-amz-object-if-match.
* fix(s3): serialize annotation restore with copy publication and sweep payloads on reset
* fix(s3): lock cross-account copy buckets via resolveBucket and log compat test cleanup
* feat(redshift): add RedshiftCredentialBroker for short-lived Db credentials
* refactor(rds-proxy): widen PasswordValidator to a three-value AuthResult
The wire-level password check the PostgreSQL/MySQL proxy handlers take now
returns REJECT / PASSTHROUGH / MASTER_EQUIVALENT instead of a boolean, so a
caller can tell the proxy to open the backend leg as the cluster master for a
client it has vouched for. RdsAuthProxy keeps its own boolean master-password
callback, renamed MasterPasswordCheck to free the PasswordValidator name, and
adapts it at the handler boundary (non-master stays PASSTHROUGH).
* feat(redshift): auth proxy accepts live GetClusterCredentials credentials
passwordValidatorFor now returns AuthResult and consults RedshiftCredentialBroker:
the master pair and any live minted credential resolve to MASTER_EQUIVALENT, a
known broker user with a stale password is REJECTed, everyone else PASSTHROUGH.
* feat(redshift): add default-credential-duration-seconds config
* feat(redshift): implement GetClusterCredentials action
Mints a short-lived DbUser/DbPassword pair via RedshiftCredentialBroker and
returns it as Query-protocol XML. AutoCreate prefixes IAM: on the DbUser,
DbGroups are echoed, DurationSeconds is validated to 900-3600 (default from
the new config key), and an unknown ClusterIdentifier propagates ClusterNotFound.
The two credential actions are registered in AwsQueryController.REDSHIFT_ACTIONS
and the Query dispatch now forwards the Authorization header to the handler.
* feat(redshift): implement GetClusterCredentialsWithIAM action
Derives the DbUser from the caller's IAM identity resolved via the Authorization
header: an IAM user maps to IAM:<name>, an assumed role to IAMR:<role>, and an
unresolvable caller to the IAMR:floci fallback with a WARN so local and CI flows
are not blocked. Any DbUser request parameter is ignored.
* feat(redshift-data): resolve non-master DbUser via GetClusterCredentials
resolveViaDbUser now accepts a DbUser that has a live credential in
RedshiftCredentialBroker, connecting to the container as the cluster master
(the minted DbUser is nominal). An unknown non-master DbUser still fails with
ValidationException.
* test(redshift): end-to-end GetClusterCredentials + Data API non-master DbUser
Docker-gated: mints a credential for a non-master DbUser via GetClusterCredentials
then runs SELECT 1 through the Data API as that DbUser, asserting the result.
* test(compat): SDK coverage for Redshift GetClusterCredentials
Adds getClusterCredentials and getClusterCredentialsWithIAM assertions to the
AWS SDK Redshift compatibility test.
* docs(redshift): document GetClusterCredentials and GetClusterCredentialsWithIAM
Regenerates the redshift.md action table (excluding the DbGroups member-name
switch label), fills the two new descriptions, updates the wire-auth and
redshift-data.md DbUser notes, and bumps the Service Matrix count to 23.
* fix(redshift): reject a wrong master password instead of passing it through
passwordValidatorFor only treated the master pair as MASTER_EQUIVALENT and let
everything else fall to the broker. A request with the master username but a
wrong password is unknown to the broker, so it classified as PASSTHROUGH; the
wire proxy then opened the backend leg as master (isMaster is username-only) and
the client authenticated with the wrong password. Now the master username is
decided on its own password: match to MASTER_EQUIVALENT, mismatch to REJECT.
* fix(redshift): reject proxy logins when the cluster row is gone; strip IAM user path
passwordValidatorFor fell through to the broker when the cluster was absent from
the account partition, classifying an unknown user as PASSTHROUGH; the wire proxy
reads isMaster from its own start-time config, so that still opened the backend
as master for the master username with any password. Return REJECT when there is
no cluster row to validate against.
RedshiftIamDbUserResolver now strips an IAM path prefix from a user ARN
(user/team/alice -> alice), matching how AWS names the DbUser.
* fix(redshift): keep concurrent credentials, revoke on delete, bound the config default
Addresses PR review (greptile):
- RedshiftCredentialBroker now holds every unexpired credential per DbUser instead
of one slot, so a reissue no longer invalidates a still-live password (matches
AWS, which keeps each issued credential valid to its own expiry).
- Add revokeCluster(); RedshiftService calls it on deleteCluster and at the start
of createCluster, so a cluster recreated with the same identifier does not
inherit master-equivalent access from a stale credential.
- resolveDurationSeconds now holds the YAML default to the same 900-3600 bounds as
a request value, falling back to 900 with a WARN instead of minting a credential
that is already expired or over-range.
* fix(redshift): revoke temp credentials on createCluster rollback too
The greptile review asked for revocation on 'relevant rollback paths'. Both
createCluster failure branches that delete the cluster row now also call
credentialBroker.revokeCluster, so a credential issued by a concurrent
GetClusterCredentials while the row briefly existed cannot outlive it.
* fix(redshift): correct GetClusterCredentials AutoCreate prefix
AWS prefixes the returned DbUser with IAM: when AutoCreate is false and
IAMA: when it is true. The handler returned IAM: when true and no prefix
when false, so a client using the returned name could not authenticate
and the value diverged from GetClusterCredentialsWithIAM, which already
issues prefixed identities.
The broker keys on the returned name, so the proxy and Data API now
expect the prefixed DbUser. Tests and the redshift docs are updated to
match.
* test(redshift): give compat GetClusterCredentials tests distinct @Order
Three methods shared @Order(2), leaving their relative order undefined.
Number the two credential tests 3 and 4 and move testDeleteCluster to 5.
CreateDBCluster with Engine aurora-mysql and an Aurora version such as
8.0.mysql_aurora.3.08.0 used the version literally as the container
image tag. Docker has no such tag, leading the pull to 404.
Take the MySQL version in front of the Aurora suffix, so that example
runs mysql:8.0. Plain mysql versions still map to their own tag.
The Go compatibility tests for the RDS Data API on aurora-mysql skip
when the cluster cannot be created, so this failure never showed in
CI. They now run with the mapping fixed.
* feat(firehose): validate and persist ProcessingConfiguration
A stream configured with a record transformation was accepted with a 200,
the member dropped by ignoreUnknown, and nothing echoed back. It is now
modelled, validated and stored, so a caller sees what it configured. The
transformation itself is not applied yet: records are still delivered
untransformed, and create and update say so in a warning.
The behavior follows what real AWS does, probed in us-west-2:
- A Lambda processor requires a LambdaArn, which must be a well-formed
function ARN, and BufferSizeInMBs and BufferIntervalInSeconds are
all-or-nothing.
- Processor types and parameter names are checked against AWS's enums,
reproducing the order those sets are printed in and the 1-based member
paths of the constraint messages.
- UpdateDestination replaces the whole block rather than merging it
member-wise, the opposite of DataFormatConversionConfiguration: an update
carrying only {"Enabled": false} leaves no processors behind, and an
update is validated against its own content.
- A stored Lambda processor gains NumberOfRetries 3 and the stream's
RoleArn, echoed in AWS's own parameter order.
Two checks AWS does not make are deliberately absent: NumberOfRetries is
not range-checked, accepted as 0 or 9 despite the documented 1 to 8, and the
function a LambdaArn names is not required to exist, unlike the Glue table a
conversion schema names.
* docs(firehose): record what AWS does with a null processor list member
Probed: real AWS answers InternalFailure for "Processors": [null] and for
"Parameters": [null], a fault of its own rather than a validation error.
Reproducing that helps nobody, so the entry stays ignored, which leaves the
configuration a caller would have had by omitting it, and the deviation is
written down instead. A test pins the choice so it reads as a decision.
The review also asked for a maximum of 3 on the processor list. Probing found
no such bound: three, four and five processors all pass validation and reach
the role check, so nothing is enforced here.
Adds CreateDataCatalog, UpdateDataCatalog and DeleteDataCatalog to the Athena
JSON 1.1 handler, backed by a data-catalogs.json store obtained through
StorageFactory. Catalogs accept the four modelled types (LAMBDA, GLUE, HIVE,
FEDERATED) and a FEDERATED catalog reports the ConnectionType carried in its
connection-type parameter.
TagResource and UntagResource are new, and ListTagsForResource now also serves a
datacatalog ARN. Tags live on the record they belong to, so a workgroup keeps
storing its own tags exactly as before.
The built-in AwsDataCatalog keeps the shape it had: it is still listed first and
still resolves as a GLUE catalog, and it is reserved against create, update,
delete and tagging the way the primary workgroup already is.
* feat(verifiedpermissions): add full service emulation
* fix(verifiedpermissions): harden OIDC and schema validation
* test(verifiedpermissions): add service layer coverage
* fix(verifiedpermissions): support native Cedar runtime
* fix(verifiedpermissions): package Cedar native FFI
* fix(verifiedpermissions): register Cedar deserializers for native
* fix(verifiedpermissions): bound JWKS refreshes
* fix(verifiedpermissions): avoid Cedar entity reflection
* fix(verifiedpermissions): register Cedar native reflection
* fix(verifiedpermissions): refresh rotated OIDC keys safely
* fix(verifiedpermissions): retry failed JWKS refreshes
* refactor(verifiedpermissions): isolate Cedar in sidecar
* fix(verifiedpermissions): harden Cedar sidecar runtime
* fix(verifiedpermissions): build cedar sidecar in compatibility CI
* fix(verifiedpermissions): remove stale cedar jni config
* fix(verifiedpermissions): recover cedar sidecar
* fix(verifiedpermissions): bound OIDC document responses
* fix(verifiedpermissions): start cedar sidecar in native sdk CI
* feat(firehose): convert JSON records to Parquet via the floci-duck sidecar
Deliver data-format-converting streams for real: each flushed record is
parsed and type-checked in Java against the stream's Glue table schema
(per-record ParseError/MalformedData routing with AWS's probed message
shapes), valid rows are staged as normalized NDJSON and written to the
destination as Parquet by DuckDB's COPY, and failed records go to the
evaluated ErrorOutputPrefix as AWS-shaped NDJSON error lines. Batch-level
failures (missing Glue table, unsupported schema, sidecar errors) route
every record to the error output instead of dropping them. Adds the
floci.services.firehose.staging-bucket setting and replaces the
PR-1-era unconverted-delivery warning.
* fix(firehose): deliver a scheduled flush as the stream's own account
A scheduled flush runs on the flusher thread, where no request context is
active, so the Glue lookup, the staging writes, the destination writes and
the sidecar all resolved the default account instead of the stream's owner.
A stream owned by another account had its Glue table missed and its objects
written to the wrong partition. The delivery now runs under RequestScopes,
which the CUR scheduler already uses for the same reason, so every store the
delivery touches agrees on the owner. The unconverted path gets this too.
Cleanup failures in the compatibility test are logged rather than swallowed,
per the repository rule on tolerated exceptions.
* fix(firehose): cap the staging buffer size hints
rows.size() * 128 overflows an int at about 16.7 million records, so a batch
of many small records failed before writing any of them, and short of that it
asked for a multi-gigabyte array. Both hints are computed as a long and capped
at 8 MiB; the streams grow as needed, so this only affects the first
allocation.
* docs(firehose): state what a failed error-output write actually guarantees
The comment claimed a failure of the error-output write leaves the converted
rows in the staging bucket, but the enclosing finally removes the staged object
however the method exits, and the Parquet bytes are read into memory before
either destination write, so nothing is retained to recover from. What holds is
that nothing is delivered and the flush fails as a whole, which is what it says
now, along with where recovery does live: the source, which a Kinesis-backed
stream has and a DirectPut buffer does not.
The reverse ordering is documented rather than claimed away: the two
destination writes are not atomic, so an error object can land and the Parquet
write then fail, reporting the failed records while the converted ones are
gone.
* feat(cloudwatch): provision AWS::CloudWatch::Dashboard
The dashboard name is the physical id, generated when the template gives none
and kept across updates. An update with the same name puts the body again and
drives the tags to the template's set, since PutDashboard leaves an existing
dashboard's tags alone. A changed name creates the new dashboard and leaves
the displaced one to the ReplacementCleanup record, which deletes it once the
update commits or restores it on rollback. The body may be written as a JSON
object in the template and is stored as the string the API takes.
The CloudWatch docs now list the dashboard and tag actions the handlers
already serve.
* fix(cloudwatch): roll back in-place dashboard updates and replace a dashboard whose explicit name is dropped
An in-place update keeps the body and tags it replaces on the resource, or
the fact that the dashboard did not exist, and a failed stack update puts
them back in full. The name mode is recorded as the Logs provisioner does, so
a template that drops an explicit DashboardName gets a generated name and a
replacement, as on AWS, while an unnamed dashboard keeps its generated name.
The Tags list is checked against the schema's cap of 50 on every provision,
since the tag operations an update reconciles through do not enforce it. The
integration test reads stack events with XmlParser.
* fix(cloudwatch): keep the dashboard rollback snapshot until the restore succeeds
A restore that throws left no snapshot behind, so the next rollback attempt
reported success without restoring anything. The snapshot is now spent only
after the body and tags are back.
* fix(cloudwatch): unwind a dashboard update that failed after it changed the body
An in-place update puts the body and then reconciles the tags. When the tag
calls failed, the exception left the dashboard carrying the new body while
CloudFormationService put the resource the stack held before the attempt back
in its place. That object never carried the snapshot taken by the attempt, so
the walker marked it restored and skipped rollbackUpdate: the stack reported a
completed rollback over a dashboard that still had the update's body, or a half
reconciled set of tags.
The mutating calls now unwind themselves through rollbackUpdate, the way
IotDomainConfigurationCfnProvisioner unwinds a replacement, and report the
resource restored. An unwind that cannot put the body back keeps the snapshot
and records the failure on the resource, so the stack ends in
UPDATE_ROLLBACK_FAILED rather than claiming the prior dashboard is intact, and
the original failure is still what the stack reports.
Tests: anInPlaceUpdateThatFailedOnItsTagsPutsTheBodyBack,
anUnwoundInPlaceUpdateIsMarkedRestored,
anUnwindThatCannotRestoreIsReportedAsARollbackFailure.
* fix(cloudwatch): record a dashboard unwind failure before joining it to the update failure
The unwind repeats the tag call the update just made, so a service that
keeps failing hands the unwind the very exception that interrupted the
update. Throwable.addSuppressed rejects a throwable suppressed under
itself, and that IllegalArgumentException escaped the unwind before the
rollback failure was recorded: the dispatcher reported "Self-suppression
not permitted" as the resource failure, no failure attribute reached the
stored resource, and the stack ended UPDATE_ROLLBACK_COMPLETE over a
dashboard whose tags were never put back.
The failure attribute is now written first and the two exceptions are
joined only when they differ, as PipesCfnProvisioner does. Two stack-level
tests drive the whole path through CloudFormationService with a spied
CloudWatchDashboardsService, the way CloudFormationPipesCleanupIntegrationTest
does: a one-off tag failure ends in UPDATE_ROLLBACK_COMPLETE with the prior
body and tags live, a persistent one in UPDATE_ROLLBACK_FAILED naming the
dashboard and carrying the unwind's reason.
Tests: anUnwindThatFailsWithTheUpdatesOwnExceptionIsStillRecorded,
anUpdateThatFailedOnItsTagsPutsTheDashboardBackAndTheStackRollsBackCleanly,
aFailedRestoreLeavesTheStackInUpdateRollbackFailedNamingTheDashboard.
* feat(ec2): back each VPC with a real Docker network in RFC 1918 space
An instance's private IP was a plausible-looking number nothing could
connect to. Every VPC now gets its own Docker network, created lazily on
the first launch into it, with the VPC CIDR as the network's IPAM pool
and each subnet allocating static addresses from its own slice. The
address Floci reports is one the container actually holds, and instances
in different VPCs sit on different bridges.
One network per VPC, not per subnet: subnets inside a VPC route to each
other in AWS, so a network per subnet would manufacture a partition AWS
does not have and break the two-tier app/database topologies this corpus
is full of.
The declared CIDR is used verbatim wherever it can be. It cannot be when
it is absent, malformed, outside RFC 1918, or already claimed on the
Docker daemon, which includes another Floci VPC: two VPCs may legally
declare the same CIDR in AWS but one daemon cannot route two identical
ranges. Only then is an equivalent block drawn from the configured
fallback pool, and the substitution is logged at WARN. A reported private
IP that does not mean what the caller declared is either true or it is in
the log.
Leases are given back on every exit: a launch that never attaches, a
launch that fails, and terminate. Detach precedes release, because Docker
holds the address while the endpoint stands and would refuse the next
launch handed the same one. Startup reconciles this emulator's own
orphaned networks first (scoped by API port, so instances sharing a
daemon never touch each other's), then re-declares the plan from
persisted VPCs and subnets and re-reserves the addresses restored
instances still hold.
Between-VPC isolation is the Docker daemon's, not Floci's, and OrbStack
does not enforce it. On such a host the VPC boundary is an addressing
boundary only. docs/services/ec2.md says so.
Off with FLOCI_SERVICES_EC2_VPC_NETWORKS_ENABLED=false, and off whenever
ec2 mock is on.
* fix(ec2): do not adopt a leftover VPC network that routes another range
materialise() treated any network under the VPC's own name as its own: a
successful inspect set created=true and returned. A network left by a
previous run that declared a different CIDR was therefore adopted, after
which addresses were handed out of vpc.effective while the bridge routed
something else entirely.
Compare the leftover's IPAM subnet to vpc.effective. A match is adopted as
before. A mismatch is removed and recreated on the planned range rather
than re-planned onto the leftover's subnet: by the time materialise runs,
addresses have already been allocated from vpc.effective, and after a
restart some are leases held by live containers, so the plan cannot move
under them. The network name carries this emulator's own port and region,
so recreating it cannot destroy a user's network. If the removal fails the
instance stays on the shared bridge, which is a documented degradation,
instead of holding an address nothing routes.
Also make small blocks work or refuse out loud. FIRST_HOST_OFFSET was a
flat 10, so a /29 (eight addresses) and a /30 (four) allocated nothing at
all and said nothing about it, and fallback-prefix-length had no upper
bound to stop a /30 being configured. The offset now scales down to 2 for
blocks that cannot spare ten addresses, a block with no room for a host is
refused at plan time with a WARN, and the fallback prefix is clamped into
the range that can serve hosts.
* fix(ec2): keep the IMDS source address current across start and restore
Ec2MetadataServer resolves an instance from the source address of the
request, and a container's default route is the bridge, so a VPC-attached
instance's metadata requests arrive from its bridge address rather than
from the VPC address Floci reports. launch() registered both. start() and
restoreMetadataRegistration() registered only the address
getContainerBridgeIp returns, which for a VPC-attached container is the
VPC address: neither refreshed imdsSourceIp nor registered the bridge.
Docker hands out a fresh bridge address when a stopped container starts
again, and an emulator restart rebuilds the registration map empty, so
after either the instance's IMDS requests arrived from an address nothing
knew about, while the address from the previous run stayed registered.
Both paths now unregister the stale source address and register the
current one. A bridge-only instance is unaffected: its reported address
and its bridge address are the same, so there is no second registration.
* fix(ec2): keep the IMDS source registration when inspect fails
bridgeNetworkIp swallowed every inspect failure and returned null, the same
answer it gives for a container that genuinely has no bridge address.
refreshImdsSourceRegistration acts on that null by unregistering the instance's
recorded IMDS source address, so one transient Docker hiccup permanently dropped
a healthy instance's registration and put nothing in its place: its metadata
requests stopped resolving until some later start or restore happened to
succeed.
Split the two answers apart. bridgeNetworkIp now lets the exception propagate,
so null means only "no bridge address"; refreshImdsSourceRegistration catches it
and returns early, leaving the existing registration exactly as it was.
* docs(ec2): drop the em dashes this branch added
AGENTS.md forbids em dashes in all content. The enforcing check runs with
--diff-filter=A, so it only scans files a PR adds and stayed green on these, but a
check that cannot see a violation is not a licence for it. Six of them are in lines
this branch adds: four in docs/services/ec2.md, one in an Ec2ContainerManager javadoc,
one in an Instance javadoc.
Replaced with colons and commas. Wording is otherwise unchanged, and the em dashes
already present in these files are left alone: they predate this branch, and
rewriting them here would bury the actual change in unrelated churn.
* feat(athena): support ListTagsForResource for workgroups
Fixes#2791. terraform-provider-aws's read/refresh for aws_athena_workgroup
calls ListTagsForResource unconditionally, even when no tags are set,
and floci's Athena handler had no support for the action:
Error: listing tags for Athena WorkGroup ...: InvalidAction: Action
ListTagsForResource is not supported
Parses the workgroup name out of the ResourceARN (using the existing
AwsArnUtils helper) and returns the tags already captured on
CreateWorkGroup. The primary workgroup always answers with an empty
list, matching a live account, since CreateWorkGroup already rejects
"primary" and it can never carry real tags. An ARN for an unsupported
resource type, or naming a workgroup that doesn't exist, faults with
InvalidRequestException like the rest of this handler's not-found cases.
* docs(athena): sync the supported-actions table for ListTagsForResource
* fix(athena): reject ListTagsForResource ARNs naming a different service
pgermosen (review): listTagsForResource only checked that the ARN's
resource path started with workgroup/, never the service, so an ARN
naming a completely different service with a coincidentally matching
region and workgroup name resolved instead of being rejected the way
real AWS rejects a ResourceARN naming the wrong service.
Adds the explicit arn.service() == "athena" check, plus a RestAssured
test proving a workgroup-shaped ARN under a different service is
rejected even when a same-named workgroup genuinely exists. Verified by
disabling the check and confirming the new test fails with the exact
expected 400-vs-200 mismatch before restoring it.
Also adds an SDK-client test (AthenaTest, compat suite) round-tripping
ListTagsForResource through the real AthenaClient, per review request to
validate request/response shapes the way other management API PRs do.
* fix(s3): preserve SSE-KMS key ID metadata
* fix(s3): validate and copy SSE-KMS key metadata
* fix(s3): return SSE headers on CopyObject and UploadPartCopy responses
Both handleCopyObject and handleUploadPartCopy stored the destination's
server-side-encryption settings correctly but never echoed
x-amz-server-side-encryption / x-amz-server-side-encryption-aws-kms-key-id
on their own response — only a follow-up GET/HEAD on the copy revealed it,
which is why the existing SSE tests (checking only via HEAD) never caught
this. Real S3 returns both headers on CopyObjectResult and CopyPartResult.
UploadPartCopy required threading the KMS key id through
CreateMultipartUpload too: MultipartUpload had no field for it, so a part's
destination upload had nowhere to read it back from.
* fix(s3): drop em dashes from merged UploadPartCopy comments
AGENTS.md rules out em dashes anywhere in content. The two comments moved
during the origin/main downmerge (handleUploadPartCopy's SSE-settings note
and the relocated uploadPartCopyPreservesDestinationServerSideEncryption
test) carried one each. Reworded to a period and a comma respectively.
---------
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
* docs(lambda,s3): mark two leniencies as Floci's call, not observed AWS
Both lines read as parity claims for behaviour nobody probed against
AWS, which is the failure mode of keeping measured and inferred apart:
a later reader can cite either one as a probed result.
lambda.md: accepting ApplicationLogLevel and SystemLogLevel alongside
LogFormat=Text is justified in the text by Floci's own response shape,
which never surfaces those levels for Text. Request behaviour and
response behaviour are both our choice, so say so.
s3.md: log-delivery-write really does match AWS on PutBucketAcl, but
AWS documents that canned ACL as bucket-only and the SDK's
ObjectCannedACL enum omits it, so accepting it on PutObjectAcl is a
Floci leniency rather than parity. Both paths share one canned-ACL
helper, which is also why aws-exec-read, an object-only canned ACL in
the SDK model, is accepted on buckets. Name that mirror-image case so
the next reader sees the pattern instead of filing it again.
No behaviour change: both entries describe code that stays as it is.
* docs(s3): attribute the aws-exec-read narrowing to the SDK model, not to AWS
The sentence said aws-exec-read is one "which AWS lists only for objects". That is
the same mistake this PR exists to correct, made inside the correction: AWS's canned
ACL reference lists it under "Bucket and object". What is narrower is botocore's
BucketCannedACL enum, which omits it while ObjectCannedACL includes it, so the
client-side validation on PutBucketAcl is an SDK artefact rather than documented AWS
behaviour.
Verified against the shipped model: BucketCannedACL is private, public-read,
public-read-write, authenticated-read; ObjectCannedACL adds aws-exec-read,
bucket-owner-read and bucket-owner-full-control.
The log-delivery-write half of the sentence was accurate and is unchanged.
* fix(stepfunctions): persist execution history across restarts
* fix(stepfunctions): preserve persisted execution history
* fix(stepfunctions): preserve running execution snapshot during restart test
Keep the in-flight worker alive until the persisted snapshot is reloaded, then
wait for cleanup so the test cannot rewrite or retain its temporary state.
* fix(stepfunctions): checkpoint persisted execution history
* fix(cloudformation): provision CloudFront policies and origin access controls
AWS::CloudFront::ResponseHeadersPolicy, CachePolicy, OriginRequestPolicy
and OriginAccessControl had no provisioner, so the dispatcher's stub arm
reported CREATE_COMPLETE with a synthetic id and a distribution that
referenced it failed with "The specified response headers policy does not
exist."
A new CloudFrontCfnProvisioner creates each type through CloudFrontService:
the physical id is the service id, Fn::GetAtt exposes Id and LastModifiedTime
(Id only for the origin access control, per the registry schemas), updates go
through the service's etag-guarded update, and deletes tolerate only the
type's own not-found code so an in-use policy fails the stack delete as on
AWS. The response headers configuration is reshaped into the flattened form
the service's codec stores through the new
ResponseHeadersPolicyConfigCodec.fromItemsTree.
Closes#2441
* fix(cloudfront): reject deleting a cache or origin request policy in use
DeleteCachePolicy declares CachePolicyInUse and DeleteOriginRequestPolicy
declares OriginRequestPolicyInUse, both 409 sender faults, and both are
documented as refusing the delete while the policy is attached to a cache
behavior. Floci checked only two of the four policy-shaped types:
deleteResponseHeadersPolicy and deleteOriginAccessControl raised their in-use
errors, while these two deleted unconditionally once the etag matched. A policy
still referenced by a distribution could be removed, leaving that distribution
pointing at something that no longer existed.
Both now raise the modeled error after the etag check, matching the ordering the
other two deletes already use. Cache, origin request and response headers
policies all hang off the same two places, a distribution's default cache
behavior and its ordered ones, so the three near-identical scans collapse into
one helper that differs only in which id it reads. The per-distribution
association count keeps its own entry point, since it asks about one config at a
time and can be handed a distribution with none.
Found while reviewing the CloudFormation provisioner in this PR, which was
already written for this: its delete tolerates only NoSuch<Type>, so it fails
the stack correctly now that the service raises the in-use error. The
CloudFormation integration test covers that end to end: it attaches both
policies to a distribution and still deletes the stack cleanly, because
CloudFormation removes the distribution before the policies it references.
Four tests: a cache policy attached to a default behavior and to an ordered one,
an origin request policy in use, and an unattached policy still deleting.
* test(cloudformation): parse stack outputs with XmlParser
The CloudFront policies integration test pulled Outputs out of the DescribeStacks
response with two regular expressions over <member> and <OutputValue> blocks.
XmlParser.extractPairs already does exactly this, and seventeen sibling
CloudFormation integration tests define the same one-line helper over it, so the
twelve-line version was reinventing a shared utility. It also matches the repo's
rule against parsing XML with regex.
Behaviour is unchanged, including the failure message that names the missing key.
* fix(cloudformation): roll back a recreated CloudFront policy on a failed update
When an update finds the prior policy or origin access control already deleted
out of band, the provisioner recreates it under a new physical id. If a later
resource then failed the stack update, the rollback left that new object behind:
the engine only deletes resources the update ADDED, inside the previous == null
branch of rollbackUpdatedResources, so an existing resource that merely acquired
a new physical id fell through to the "Rollback is not implemented" arm, which
deletes nothing.
ReplacementCleanup already models exactly this, and CognitoCfnProvisioner wires
it for the same situation, so the provisioner records the displaced entity after
each provision and delegates the cleanup hooks and rollbackUpdate to it. A
rollback now names the prior id again with the attributes it carried and deletes
the object the failed update created.
The physical id changes here only when the prior object was already gone, since
prior() returns the entity whenever the service still knows it, so the recorded
displaced entity is always one that no longer exists and its cleanup delete is a
no-op tolerated by the type's not-found code. The hooks are still needed, or a
recorded entity would stay owed a delete forever.
An in-place update keeps its physical id, so nothing is recorded and
rollbackUpdate answers false: putting a committed in-place change back needs a
configuration snapshot this provisioner does not keep, the same limitation
AWS::Cognito::UserPool has. A test pins that so it stays a decision.
Raised by the review on this PR. My first reply argued the finding did not hold,
generalising from the create path; that was wrong for this one, and the
correction is on the thread.
* test(iot): MQTT over WebSocket at /mqtt, failing
* feat(http): echo MQTT WebSocket subprotocols
* feat(iot): MQTT over WebSocket at /mqtt
Bridges a WebSocket upgrade on /mqtt (HTTP and HTTPS) onto the broker's
plaintext listener, so wss://host:443/mqtt works on the 443:4566 mapping
with the same certificate as HTTPS and no extra listener or config.
* docs(iot): MQTT over WebSocket at /mqtt
* feat(iot): do not queue the /mqtt handshake behind ordered blocking tasks
* fix(iot): forward only binary WebSocket frames to the broker
One frame handler decides per frame: text closes with 1003, binary and
continuation frames are written to the broker socket, control frames are
left to Vert.x. Nothing else reads the frames, so a text payload can never
reach the MQTT stream.
* test(iot): AWS contract and framing tests for MQTT over WebSocket
Handshake: only GET upgrades (405), unsupported version is 426, each MQTT
subprotocol name is echoed and the first supported offer wins, ping gets
pong, non-upgrade requests fall through. Framing (MQTT 3.1.1 section 6):
a CONNECT split across two frames, two packets in one frame, garbage
bytes and a frame over the transport limit. Session semantics as on AWS:
MQTT 5 over wss, client id takeover across transports, retained messages,
QoS 2 disconnects, shadow topics, topic rules, keep-alive pings and the
IoT Data connection APIs on a WebSocket session.
* test(iot): log the tolerated exceptions in the WebSocket contract tests
* test(iot): pin the MQTT TLS port and the unrelated-subprotocol handshake
The profile pins floci.services.iot.mqtt.tls-port now that #3142 opens 8883
whenever TLS is on. A client offering only graphql-ws on an API Gateway
WebSocket path still connects, with no subprotocol echoed: the server-wide
MQTT list does not affect other WebSocket routes.
* test(iot): pin the deployment claims of MQTT over WebSocket
Every claim the docs and comments make now has a test that fails without
the behaviour: ws and wss share one port through TlsProxyServer (the
443:4566 path), a hostname learned by ensureHost serves /mqtt to a client
verifying that name, the first upgrade starts a lazy broker (also eight at
once, and again after a stop), a text frame or an abrupt TCP drop after a
live CONNECT frees the broker session, 30 connect and disconnect cycles
leave nothing behind, and the burst is 1000 messages.
* test(iot): force-close the Paho client the broker stop left behind
* test(iot): wait for the dropped session before closing the Paho client
* feat(iam): resolve resource and request tag condition keys for EC2 and S3 bucket actions
A policy scoped through aws:ResourceTag or aws:RequestTag never matched
because neither key was placed in the request context. The resolver now
reads aws:RequestTag from the tags named in RunInstances, CreateTags and
PutBucketTagging, and aws:ResourceTag from the target's current tags for
the EC2 tag and instance actions and the S3 bucket tagging and delete
actions. EC2 and S3 are reached through Instance, as DynamoDB already is.
Ported from lex00/floci#135.
* fix(iam): authorize every target of a multi-resource EC2 request
The resource tag context came from the first ResourceId or InstanceId
only, so a caller could name a permitted resource first and act on
later ones the policy did not allow. The resolver now yields one
context per further target and the filter evaluates each of them,
denying the request when any target fails. An untagged target gets an
empty context so a tag condition fails on it.
* fix(iam): read a repeated numbered parameter the way the EC2 handler does
A Query request can repeat ResourceId.1 or InstanceId.1. The resolver
kept the last value while the handler acts on the first, so the
authorized resource and the acted-on resource could differ. The form
parameters now keep the first value, and the remaining-targets pass
starts only when member 1 is present, so both readers stop at the same
numbering gap.
* feat(cloudwatch): store and serve metric stream definitions
PutMetricStream, GetMetricStream, ListMetricStreams, DeleteMetricStream,
StartMetricStreams and StopMetricStreams work over Query and JSON. A
stream is a definition with a running or stopped state, and nothing is
delivered to the Firehose delivery stream it names. The service lives in
its own metricstreams package next to dashboards and is injected into
both handlers, and the tag operations route a metric-stream ARN to it.
Ported from lex00/floci#42.
* fix(cloudwatch): validate nested metric stream members, page ListMetricStreams, keep batches atomic
StartMetricStreams and StopMetricStreams resolve every requested name
before changing any, so a batch naming a missing stream fails as a
whole. PutMetricStream now checks the nested members: a filter needs a
Namespace, an IncludeMetrics entry needs a Namespace and a MetricName,
and a statistics configuration needs non-empty IncludeMetrics and
AdditionalStatistics. ListMetricStreams pages through the shared
Pagination helper with MaxResults and NextToken over both protocols.
* fix(cloudwatch): answer an unknown name on StartMetricStreams and StopMetricStreams with InvalidParameterValue
The model declares ResourceNotFoundException on GetMetricStream alone.
Start and Stop declare InvalidParameterValue, so an unknown name in the
batch answers that, still after resolving every name before any change.