mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 17:33:03 -05:00
3cb81fd4126ae173197c6bcb60dee800867b68ca
856
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3cb81fd412 |
docs(backup): record the three vault decisions that lived only in javadoc
AGENTS.md asks for intentional deviations to be documented, and three of this branch's user-visible decisions were reachable only by reading the source or the commit log. The omitted-Policy behaviour is the one a user is most likely to be surprised by, and it is written with the same hedge the javadoc carries: AWS's behaviour is undocumented and unmeasured, and clearing is the choice we took, not an observed AWS behaviour. It is not upgraded to a measured claim here. The other two are the MissingParameterValueException versus InvalidParameterValueException split on PutBackupVaultNotifications, and the per-field Vault Lock day limits, including that MinRetentionDays deliberately carries no maximum because AWS documents none. Documentation only. backup.md is hand-written, not generated, so docs-sync has nothing to say about it; docs-check passes once this is committed, because its last gate is git diff --exit-code over docs/. |
||
|
|
1a50ad3e92 |
docs(backup): stop the branch contradicting itself, and clear the order clash
Four corrections from review, all to things this branch introduced.
docs/services/backup.md:15 was changed here to "Delete an empty, unlocked
backup vault", which contradicts :132 ("A lock does not stop the vault being
deleted") and the code, where deleteBackupVault deliberately omits a lock check.
The AWS Vault Lock guide is with :132 and the code: the vault itself can be
deleted if it is empty. Line 15 was the wrong one.
BackupVaultCfnProvisioner's javadoc still said AccessPolicy, Notifications and
LockConfiguration "have no counterpart in the emulated vault". They have
counterparts now, which this branch added. The provisioner still ignores all
three, so a template declaring AccessPolicy reports CREATE_COMPLETE with nothing
attached; that is now stated as a gap in the provisioner rather than implied to
be a gap in the service. Wiring them through is separate work.
The lock log line printed "changeable for null day(s)" on a governance lock,
which is the mode where the value is absent by definition. It now names the mode.
The two tests added in the previous commit took @Order(141), which an existing
test already held -- the same clash 5e1bed0ef had to clear once. They move to the
end as 142 and 143, and the file now has no duplicate order. The pre-existing 140
declared between 136 and 137 is left alone: it executes correctly and moving a
method would be churn.
|
||
|
|
785cc6b121 |
style: use -- rather than an em dash in added prose
AGENTS.md forbids em dashes in all content and the conformance check flags them. Five in lines this branch added, across the service, the notifications model and the docs page. Upstream lines that already carry one are left alone. |
||
|
|
166d94e2d2 |
fix(backup): correct the vault lock modes, the delete rule and the event list
Three corrections from review, all of them cases where the first version of this branch was confidently wrong about AWS. 1. THE TWO LOCK MODES WERE INVERTED. ChangeableForDays PRESENT means compliance mode — a lock date that far ahead, immutable on and after it. ABSENT means governance mode — no lock date, removable at any time. The reference says so directly: "If this parameter is not specified, you can delete Vault Lock from the vault using DeleteBackupVaultLockConfiguration or change the Vault Lock configuration using PutBackupVaultLockConfiguration at any time." The previous revision had it the other way round, which turned AWS's freely removable governance lock into a permanent one and its vault into an undeletable one. 2. A LOCK NO LONGER BLOCKS DELETING THE VAULT. A lock protects the recovery points, not the vault shell: AWS deletes an empty vault even under a compliance lock, and the pre-existing non-empty check is already the case AWS refuses. The added check could therefore only ever fire where AWS succeeds — and it reached outside this service, since BackupVaultCfnProvisioner deletes vaults during stack teardown and tolerates only not-found. 3. THE EVENT LIST WAS 17 OF 30. Missing CONTINUOUS_BACKUP_INTERRUPTED, the three RECOVERY_POINT_INDEX* values, the three EKS_* values and the six ACCESS_POINT_* values. Since unknown values are rejected with 400, each missing one failed an apply that AWS accepts. Rejecting is still right; the data was stale. The tests asserted the inverted lock behaviour, so the suite could not have caught any of this. Both modes are now pinned separately and in opposite directions, and the gaps review named are covered: the cooling-off floor, the retention floors, reconfiguring a governance lock in place, deleting an empty locked vault, the object-bodied Policy branch, and the notification store being dropped with its vault. 66 Backup-related tests pass, including the CloudFormation provisioner suites. |
||
|
|
2357767b5d |
feat(backup): configure a vault — access policy, notifications and vault lock
CreateBackupVault worked, and then every write that configures the vault it
just created was unrouted. PutBackupVaultAccessPolicy, PutBackupVaultNotifications
and PutBackupVaultLockConfiguration all matched no route, so a vault could be
created but never given a policy, a lock or a notification target — which is most
of what a vault is configured for.
The two GET paths already existed as deliberate stubs that always threw
ResourceNotFoundException, on the reasoning that these are "never-configured" in
the emulator. That error contract was right and is kept for the genuinely
unconfigured case; what was missing was any way to configure one.
Adds the three PUTs, the three DELETEs, and real read paths for the two GETs:
PUT|GET|DELETE /backup-vaults/{name}/access-policy
PUT|GET|DELETE /backup-vaults/{name}/notification-configuration
PUT|DELETE /backup-vaults/{name}/vault-lock
Details worth knowing:
- Vault Lock has two modes and the difference is the point of the feature. With
ChangeableForDays the lock is governance mode: LockDate is set that far ahead
and the lock stays removable until then. Without it the lock is compliance
mode, immutable immediately. Modelling only the first would make a compliance
lock look reversible, which is exactly the property a caller sets one to get.
A locked vault also refuses DeleteBackupVault.
- The lock fields live on BackupVault because AWS returns them from
DescribeBackupVault. The access policy and notification configuration do not:
AWS exposes each only through its own Get, so they are held in their own
stores rather than as vault fields, which keeps DescribeBackupVault from
growing members real AWS does not send. Locked is a primitive so it is always
present, matching AWS and letting a client tell "not locked" from "not
modelled".
- BackupVaultEvents outside the documented set are rejected rather than stored.
An emulator that accepts a misspelt event and echoes it back lets a config
real AWS refuses pass a local test.
- Deleting an unset policy or notification configuration is a no-op, so a
Terraform destroy re-run does not fail, and both sub-resources are dropped
with their vault so a recreated vault of the same name does not inherit them.
Reported as #4103, found by running the Gruntwork Terraform corpus against
Floci: four roots in terraform-aws-data-storage fail on this and nothing else.
Tests: 16 new integration cases covering both lock modes, the round-trips, the
rejected event, the idempotent deletes and the recreate-under-the-same-name case.
61 Backup-related tests pass.
|
||
|
|
910f0922c9 |
feat(iam): add GenerateCredentialReport and GetCredentialReport (#4298)
Generates and downloads the account's credential report, the 23 columns AWS documents for it, in CSV, Base64-encoded per the wire model. The report is a single value per account, stored the same way accountAliases and passwordPolicies already are, and regenerated only once the previous one is older than 4 hours, matching AWS's documented caching window. CSV content: every IAM user gets real password_enabled, password_last_used, password_last_changed and access_key_1/2_active/last_rotated where Floci already tracks that state, plus the documented placeholder values for what it does not model (MFA devices, X.509 signing certificates, access-key last-used date/region/service, and password_last_used itself, since nothing in the codebase ever sets IamUser's passwordLastUsed field). The root account row is present, as AWS always includes it, but is placeholder throughout: Floci does not model root account credentials at all, the same reason GetAccountSummary's AccountPasswordPresent and AccountAccessKeysPresent are always zero. password_last_changed needed a new LoginProfile field: UpdateLoginProfile changes the password without touching LoginProfile's own createDate (its meaning stays 'profile created'), so reading createDate for this column would have kept reporting the original creation time after a password change. passwordLastChanged is set alongside createDate initially and updated whenever UpdateLoginProfile actually changes the password, falling back to createDate for a profile persisted before this field existed. additional_credentials_info is Floci's own wording, since AWS does not document the exact text; in practice it is unreachable, since CreateAccessKey already enforces the real 2-key-per-user quota. Generating a report is effectively instant here, so GenerateCredentialReport never actually returns INPROGRESS; a GetCredentialReport call right after it always finds the report ready. The STARTED state and its description for the no-report-exists case match AWS's own documented example response verbatim; the report-expired case's wording is Floci's own, since AWS does not document it. |
||
|
|
1952ba4052 |
feat(ecr): manage pull through cache rules (#4304)
Signed-off-by: XuJian <265865031+xujiantop-crypto@users.noreply.github.com> |
||
|
|
34be03b334 |
feat(ses): add v2 BatchGetMetricData (#4302)
Aggregates the per-recipient timelines already stored at send time, so the batch metrics and GetMessageInsights cannot disagree about what a send produced. Buckets are whole UTC days, the series is sparse rather than zero filled, the end of the range is exclusive, and counting is per recipient. SentEmail gains the configuration set the send resolved to, which the CONFIGURATION_SET dimension filters on. The VDM gate moves into a shared SesVdmGate so the two gated operations keep one copy of the probed message. Metrics that need a real mailbox to act stay empty, as does TRANSIENT_BOUNCE, since every bounce Floci derives is permanent. |
||
|
|
876ddc7422 |
feat(ec2): expose synthesized cluster node instances to the EC2 service (#4262)
* feat(ec2): expose synthesized cluster node instances to the EC2 service * fix(ec2): enforce account isolation and tag persistence for cluster node instances * fix(ec2): scope findInstanceById to caller account for external instances Scope findInstanceById to the caller account when falling back to external instances instead of matching across all accounts. Thread the account identifier into SSM direct command execution, ELBv2 target resolution, and classic ELB health checking so external cluster nodes remain strictly account-isolated across all instance lookup paths. * fix(ssm,eks): update test stubs for account-scoped direct execution and harden cluster provider |
||
|
|
bae7e0316a |
feat(s3): enforce Block Public Access on the data plane (#4253)
* feat(s3): enforce Block Public Access on the data plane The four Block Public Access flags were stored and returned but never read by any authorization path, so put-public-access-block was accepted and changed nothing: a bucket left public by a policy or an ACL stayed readable. Enforce all four, combining a bucket's configuration with its owner account's and taking the most restrictive of the two, as AWS does. BlockPublicPolicy and BlockPublicAcls reject the write that would introduce public access, which AWS applies whoever the caller is, so they do not sit behind enforce-auth. RestrictPublicBuckets and IgnorePublicAcls suppress access an existing policy or ACL grants, which only has meaning once anonymous authorization runs, so they take effect under enforce-auth. Deciding what counts as public follows the documented AWS rules: an ACL is public when it grants any permission to AllUsers or AuthenticatedUsers, and a policy is assumed public unless a wildcard-principal statement pins a recognised condition key to a fixed value. A single public statement makes the whole policy public, so RestrictPublicBuckets also withholds the cross-account delegation a separate non-public statement grants. Enabling a setting never rewrites stored state; an existing public policy or ACL is left exactly as written. * test(s3): pin the Block Public Access contract at the wire Cover the write-time flags under the default configuration and the read-time flags under enforce-auth, including the reproduction that motivated the fix: put-public-access-block followed by an anonymous GetObject on a bucket whose policy is public. Each enforcing assertion is paired with a negative control that must keep passing without the fix, so a test cannot pass vacuously: the without-BPA case still returns 200, and the owner's signed access is never affected. Reverting the S3Service change fails the 11 enforcing assertions and leaves the 10 controls green. Unit tests cover the settings record's parsing and most-restrictive merge, the ACL public-status rule, and the policy public-status rule against the examples in the AWS documentation. * test(s3): validate Block Public Access through the AWS SDK Drives BlockPublicPolicy and BlockPublicAcls with S3Client so the rejection is seen the way an SDK caller sees it: a 403 carrying the AccessDenied error code, not just a status line. Both apply without enforce-auth, which is the configuration this suite runs against. * test(s3): drop the em-dash from the Block Public Access display name * fix(s3): recognize scoped access point ARN in bucket policies * fix(s3): honor ForAnyValue in public policy checks |
||
|
|
72231c09cf |
feat(dynamodb): add the legacy global table operations (#4288)
* feat(dynamodb): add the 2017.11.29 global table operations CreateGlobalTable, DescribeGlobalTable, UpdateGlobalTable and ListGlobalTables were all UnknownOperationException, so a legacy global table could not be created at all. The 2019.11.21 path through UpdateTable ReplicaUpdates already worked, and these four now run on the same replica metadata. Constraints come from the model. CreateGlobalTable builds on a table that already exists, so an absent one is TableNotFoundException rather than the item operations' ResourceNotFoundException, and a second create is GlobalTableAlreadyExistsException. The one replica precondition a single-process emulator can test is the stream, so a table joins only with DynamoDB Streams enabled and a view type of NEW_AND_OLD_IMAGES. DynamoDbIntegrationTest used CreateGlobalTable as its example of an unsupported operation. It now uses DescribeGlobalTableSettings, which is still unimplemented. * fix(dynamodb): use the model's fault shapes on the global table surface Two gaps on the new operations. requireStreamWithBothImages raised InvalidParameterValue, which is not a DynamoDB shape at all. Every other rejection in this file raises ValidationException, seventy-six of them, so a client catching that one missed this rejection alone. The test asserted only the status, never the code, which is why nothing caught it. UpdateGlobalTable delegated straight to applyReplicaUpdates, and that helper is deliberately idempotent for UpdateTable and CloudFormation re-applies: a duplicate add is skipped and an absent removal is a no-op. The model declares ReplicaAlreadyExistsException and ReplicaNotFoundException for UpdateGlobalTable and declares neither for UpdateTable, so sharing the path dropped both. The membership check now lives in updateGlobalTable and the helper keeps its idempotence. Tests assert the codes rather than the status, cover both replica faults including a re-add of the home region, and pin that UpdateTable still accepts the same re-add. |
||
|
|
7cf8ab7d85 |
feat(ce): manage anomaly monitors and subscriptions (#4221)
* feat(ce): manage anomaly monitors and subscriptions * fix(ce): return JSON objects for empty responses |
||
|
|
196d1586da | fix(codepipeline): retry failed stages in place (#3513) | ||
|
|
836161e1ff |
feat(docker): own the floci-aws- container and volume prefix (#4273)
Every container and volume Floci creates was named floci-<service>-<id>. Every Floci emulator shared that prefix, so two of them on one Docker daemon collided on names, and docker volume prune --filter label=floci=true reached all of them at once. Each emulator now owns a prefix of its own; this one uses floci-aws-, and labels its resources floci_emulator=floci-aws. Existing data is neither moved nor lost. Resources with a record (RDS, MSK, OpenSearch, Amazon MQ, Kinesis Analytics savepoints, Timestream InfluxDB) persist the volume name they were created with; records from before the field existed are backfilled with the frozen legacy name so their data keeps resolving. Volumes with no record (the ECR registry, EFS-backed task and Lambda volumes) are found by probing the legacy name first. Containers are disposable and always take the current name; the UI console and the ECR registry, which survive shutdown and are adopted by name, are looked up under both prefixes so an upgrade does not orphan one that still holds its host port. Stale-container cleanup clears both names. Scripts that name containers (docker exec floci-rds-<id>) must be updated, and downgrading does not migrate back: a record written after the upgrade carries a floci-aws- name an older build will not look for. Documented in storage.md. |
||
|
|
bfedf6c679 |
feat(batch): tag actions and one-lock teardown, wired into the CloudFormation provisioner (#4268)
Batch gains ListTagsForResource, TagResource and UntagResource (rest-json on
/v1/tags/{arn}, served by a BatchTagHandler under the shared V1Tags controller,
200 on success as the model declares no responseCode), and the compute
environment, job queue and job definition each get a teardown that deletes
under one lock and reports false when the resource is already gone (an
INACTIVE job definition revision counts as gone).
BatchCfnProvisioner deletes through those teardowns so DeleteStack and rollback
remove the backing resources instead of only forgetting them, and a JobQueue
update reconciles its tags in place. ProvisionContext.resolveTags now reads the
object form of Tags as well as the list form: Batch templates declare tags as a
map, which was silently dropped at create time.
Refs #2861
|
||
|
|
94fc4c45bb |
feat(codeartifact): release a deleted repository's Maven storage (#4210)
DeleteRepository never cleaned up the Reposilite-side storage of a deleted repository; it was left behind, wasting space over a long-running process. Reposilite has no bulk-delete endpoint, but DELETE on a path recursively removes everything under it in one call, so this deletes each of the repository's top-level entries before removing it from the shared settings list, verified against a live instance. Order matters: the repository must stay registered while its files are deleted, since Reposilite 404s every path, including DELETE, for an id absent from its settings. Release is best-effort: the CodeArtifact-side metadata delete already committed by the time it runs, matching real CodeArtifact's own DeleteRepository (synchronous, always succeeds once the repository exists). A sidecar that is unreachable must not turn an already-successful delete into a 500, and must not leave the repository stuck, since a retry would just 404 against the already-deleted record. Introduces RepositorySidecarManager, a small interface every per-format sidecar can implement, and CodeArtifactSidecarRegistry, which discovers implementations via CDI. CodeArtifactService.deleteRepository releases storage generically over whatever formats a repository has sidecar ids for, so a future format's sidecar needs no change here. Reposilite is the first and only implementation for now; CodeArtifactRepository's mavenRepositoryId field becomes a sidecarContainerIds map for the same reason. |
||
|
|
b986b95074 | fix(s3): reject reserved storage bucket names (#4289) | ||
|
|
a450cdc9b0 |
feat(redshift): support Redshift Spectrum phase one (#4184)
* feat: add Redshift Spectrum metadata catalog * feat: parse Redshift Spectrum DDL * feat: read Redshift Spectrum CSV data from S3 * feat: classify and rewrite Redshift Spectrum queries * feat: materialize Spectrum rows into PostgreSQL * feat: intercept Redshift Spectrum queries * test: cover Redshift Spectrum wire integration * docs: document Redshift Spectrum phase one * fix: handle Spectrum extended queries * fix: preserve Spectrum query protocol state * fix: resolve Spectrum cursor paging and extended query race condition - Await prior backend queries before streaming local Spectrum Extended Query frames - Drop synthetic Spectrum Parse/Bind/Describe/Close frames from coordinator pending queue - Support server-side cursor pagination with PortalSuspended across multiple Execute cycles - Add cascade cleanup for unexhausted portal cursors when prepared statement is closed * fix(redshift): register SpectrumMaterializer for GraalVM runtime initialization * fix(redshift): forward non-Spectrum queries and register storage models for reflection * docs(redshift): clarify Spectrum temp table lifecycle across protocols * docs(redshift): note that Simple Query Spectrum creates a temp table per query --------- Signed-off-by: Vũ Thế Huy <31652864+vuthehuyht@users.noreply.github.com> |
||
|
|
766166fc35 | feat(eks): set the cluster node providerID (#4255) | ||
|
|
96264cde70 |
chore(build): make the native image build locally and give the Makefile a development workflow (#4271)
The Quarkus container build of the native binary failed on Apple Silicon with GraalVM's BranchTargetOutOfBoundsException in a generated AwsQueryController invoker (Quarkus 3.39 turns on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+), and the packaged image died at startup because the builder links zlib dynamically while ubi9-micro ships no libz.so.1. `make native` passes the same flags CI does (-Ob,-H:-AOTSingleCallsiteInline), stages native/<arch>/ like the workflow, and copies libz.so.1 from the builder image next to the binary, which Dockerfile.native-package now puts on LD_LIBRARY_PATH. The Makefile becomes the entry point for development: help (default), dev, build, test T=, native (container build), native-host (host GraalVM/Mandrel, adding the Mandrel-only flag when native-image reports Mandrel), run-native, native-install (PREFIX, default ~/.local), native-image, native-up/native-down/ native-logs against a new docker/compose.native.yml overlay that carries the five CI compat env vars, clean-sidecars, clean-volumes (a leftover ECR registry volume is re-adopted on start and breaks the CDK bootstrap), compat SUITES= and docker-tests. docker/run-docker-tests.sh gains FLOCI_START=0 and COMPAT_SUITES, validated against the suite list, and its shell test covers both. Docs: installation (native section rewritten), docker-images, CONTRIBUTING, AGENTS. |
||
|
|
1fa5534e6c |
feat(iam): add GetAccountAuthorizationDetails (#4208)
Returns every user, group and role in the account, plus every local (customer-managed) policy and every AWS-managed policy actually attached to or used as a permissions boundary by something in the account: the entity lists themselves, their inline and attached policies, group membership, instance profiles, permissions boundaries, and each managed policy's version list. AttachmentCount and PermissionsBoundaryUsageCount are computed by scanning the account's own users, groups and roles rather than read off IamPolicy.getAttachmentCount(): for an AWS-managed policy that field is a single object shared process-wide across every account (attachUserPolicy et al. mutate the same catalog entry every account resolves), so trusting it would leak one account's attachments into another's response. Filed separately as #4205, since fixing it properly means changing the attach/detach methods themselves, well beyond this action. Also fixes two related, smaller gaps found while building this: - CreateInstanceProfile silently dropped a Tags parameter at creation, unlike every other Create* action. - GetInstanceProfile, CreateInstanceProfile and ListInstanceProfilesForRole never serialized an instance profile's own tags into the response. ListInstanceProfiles keeps omitting them: its own operation documentation, like ListRoles's, says it returns a subset of attributes and does not return tags, even though the InstanceProfile shape itself carries no such exclusion note. Policy documents are returned as plain JSON, not URL-encoded as AWS documents them for this action: matches every other IAM action that returns a policy document, none of which URL-encode either. Filter, MaxItems and Marker are not honored; the response always includes everything. |
||
|
|
d30a744b66 |
fix(iam): reject an access key that exists nowhere under enforcement (#4182)
With enforcement enabled, a signed request whose access key resolved to no caller context was allowed through, so any access key id authorized any call. Reject it with InvalidAccessKeyId for S3 and UnrecognizedClientException elsewhere, matching what the S3 signature filter and the API Gateway execute path already return. resolveCallerContext returns null for a key that does not exist and for a real credential it cannot map to policies, such as a session carrying no role ARN. Only the first is unauthenticated, so isKnownAccessKey searches sessions and long-term keys across every account and only a key found nowhere is rejected. The test credential, the bare account-id root principal, unresolvable actions and unsigned requests are unchanged. |
||
|
|
2e21c013c5 |
fix(s3): keep a bucket's data inside its own account directory (#4244)
A bucket name went into the storage path unvalidated, so a bucket named .. resolved to the account storage root itself and the containment check then passed for any account's objects. Reject a name that is not a single directory at CreateBucket, and resolve every bucket path through a helper that asserts the directory sits directly under its account, which also covers a bucket persisted before the name was refused. |
||
|
|
34f4f72e82 |
fix(cloudformation): pass Lambda hot-reload code through to the Lambda service (#4093)
* fix(cloudformation): pass Lambda hot-reload code through to the Lambda service
AWS::Lambda::Function code of {S3Bucket: hot-reload, S3Key: /host/path} is
Lambda's bind-mount hot-reload convention: the bucket is a marker and the key
is a directory on the Docker host. The provisioner probed S3 for the pair
before calling CreateFunction, so no such object existed and the stack failed
with a ValidationError (or, with allow-stub-lambda-code on, quietly deployed
the stub handler).
Skip the S3 probe for the hot-reload bucket and hand the Code map to
LambdaService unchanged, which keeps enforcing hot-reload enablement, the
absolute-path rule and the allow-list, and reports its own error as the
resource status reason. Record a hot-reload code identity so a redeploy with
the same path is a no-op, and compare adopted functions by host path since a
hot-reload function carries no S3 bucket or key.
* fix(cloudformation): canonicalise the hot-reload code identity
LambdaService stores a hot-reload host path normalised (#4053), while the
provisioner recorded the raw template key as the code identity and compared
adopted functions against it. A template that spelled the same directory with
a trailing slash or a ".." segment, or a function adopted from a direct
CreateFunction, therefore looked like a code change and triggered an
UpdateFunctionCode that mounted the same directory again.
Build the identity from, and compare against, the normalised path. The raw key
still goes to Lambda so its validation and error messages are unchanged. Also
cover the documented SAM CodeUri form, s3://hot-reload//abs/path, through the
transform.
|
||
|
|
67f06c3ac9 |
feat(cloudformation): list a deleted stack and report its DeletionTime (#4246)
* feat(cloudformation): list a deleted stack and report its DeletionTime A deleted stack is already retained so DescribeStacks and DescribeStackEvents keep answering for it by stack id after the delete, but the record they answer with was incomplete in two ways. It carried no deletion time, so DescribeStacks reported DELETE_COMPLETE with nothing saying when. Stack now has a deletionTime, set as the stack reaches DELETE_COMPLETE from the same service clock the retention window uses, and the query handler emits DeletionTime wherever AWS does. ListStacks omitted deleted stacks entirely. AWS keeps one there as DELETE_COMPLETE long after DescribeStacks has stopped answering for it by name, which is how a client reconciles what it deployed against what is left, and a StackStatusFilter of DELETE_COMPLETE selects exactly those. Retained stacks are now merged into the listing, still scoped to the caller's account and region and still dropped once the window passes. A name reused after a delete lists twice, once per stack id, as it does on AWS. Resource Explorer reads the live map directly and is unaffected. Restores deleted-stack-retention-seconds to application.yml, which #849 dropped in a merge: the knob kept working on its @WithDefault, but the repository YAML is the source of truth for what a deployment actually runs. Pinned in the test YAML too, since the retention tests advance the clock past that exact window. Nothing here changes how a delete runs, and it does not make a multi-stack cdk destroy work: that client polls a destroy entirely by stack name, so a record retained by stack id, these two members included, never enters its path. DeleteStack does already return before the delete finishes, and the stack does pass through DELETE_IN_PROGRESS, but the whole delete completes in roughly 15ms, well inside one poll interval, so a client that starts watching when it issues the delete finds the stack gone by name on its first poll. Giving a deleting stack an observable window is separate work. * fix(cloudformation): set a stack's deletion time before publishing the status Stack.status is volatile and is documented as the publishing write of a deploy: a reader that observes a terminal status is guaranteed to observe every write that preceded it. deletionTime was assigned after it, outside that guarantee, so a DescribeStacks running concurrently with the last step of a delete could observe DELETE_COMPLETE while deletionTime was still null and answer with no DeletionTime element at all. Assigning it first puts it inside the same happens-before edge as the rest of the delete. The window is nanoseconds wide and no test can land in it reliably, so this carries none; the ordering rule is the thing being fixed, and the comment records it so the next edit here keeps it. * fix(cloudformation): retain a deleted stack before it leaves the live map The handover at the end of a delete removed the stack from the live map, wrote its removal through to storage, and only then retained it as deleted. A ListStacks landing between the removal and the retention found it in neither map and dropped it from the listing, though the stack both existed a moment ago and is retained a moment later. Retaining before removing closes that window. The stack is then briefly in both maps, which is harmless: they hold the same Stack, and listStacks now reduces by stack id, so it is listed exactly once throughout. Nothing else reads both maps, since resolveStackForDescribe consults the retained one only after the live lookup has missed. Greptile reported the listing could also show the stack twice. It could not: the old order removed before it inserted, so the two maps never overlapped. The duplicate only becomes possible with this ordering, which is why the reduction comes with it. The test drives 60 deletes with four concurrent listings each. It fails on every run against the old ordering and passes on every run against this one. It pins the retention window open through a profile: the window is measured on the test MutableClock, which advances on every read, and the pollers would otherwise expire the retained record themselves. * style(cloudformation): order the Stream import with the rest of java.util java.util.stream.Stream landed between java.util.regex and java.util.concurrent when it was added. It now follows both, the order AGENTS.md asks for. Only the line this branch introduced moves; the block's older irregularities are left where they are. * fix(cloudformation): read the live stacks before creating the deleted-stack view Retaining a stack before removing it keeps it in at least one map at every instant, but listStacks built both of its views up front, the retained one first and the live one after. A ConcurrentHashMap view reflects the table at some point at or since its own creation and is not guaranteed to reflect a modification made after it, so the retained view, created before the retain, need never show the stack, while the live view, created after the remove, can already miss it. A listing landing there loses the stack in both, which is the window the retain-before-remove ordering was meant to close. Traversing the retained view second does not help: creation bounds the guarantee, not traversal. The maps are now read one after the other instead of through a concatenated pipeline, the live one first and in full, so the retained view is created after any remove the live pass could have missed, and therefore after the retain that preceded it. The reduction by stack id stays: the overlap it covers is real. No test. The fault is the absence of a JDK guarantee rather than a behaviour: these views do in practice reflect a later put, so the old ordering passes every time and nothing can force it not to. The existing listing-race test still covers the retain-before-remove ordering this rests on. The java.util.stream.Stream import goes with Stream.concat, which the change removes. * test(cloudformation): stop the listing-race pollers on every exit path The pollers were stopped after awaitDeleted returned, so a throw from the delete or the wait left four non-daemon threads spinning on listStacks for the rest of the run. That holds the test JVM open and buries the failure that caused it under a hang, which is a far worse thing to debug than the failure itself. Shutdown moves into a finally, so a failing delete stops them on its way out. Each join is bounded and a thread still alive afterwards is interrupted and recorded, with the poller loop now checking its own interrupt flag so that interrupt is not merely decorative. The check that they all stopped is asserted after the try and never inside the finally, where it would replace whatever the delete threw with its own failure. The threads are daemons as a backstop, so a future edit that throws somewhere nothing throws today still cannot wedge the suite. Also replaces an assertTrue(false, ...) in the wait helper with fail(...), which says the same thing and reads as what it is. Noted here rather than slipped in. |
||
|
|
97a2a08e1f |
feat(lambda): deliver asynchronous invocation results to configured destinations (#4247)
* feat(lambda): deliver asynchronous invocation results to configured destinations
An event invoke configuration was stored and returned faithfully but never
applied, so a function with an OnSuccess or OnFailure destination computed its
result and the emulator dropped it. A CDK application that carries a function's
output on to a bus, as the Loan Broker sample does with an EventBridge
destination, saw nothing arrive.
An Event invocation now hands its result to AsyncInvokeDestinationRouter, which
delivers the invocation record AWS sends to all four destination kinds, routed
by the service in the destination ARN: an EventBridge event bus, an SQS queue,
an SNS topic, and another Lambda function. On a bus the record is the event
detail, under the source "lambda" and the detail type "Lambda Function
Invocation Result - Success" or "... - Failure", so a rule matching
detail.responsePayload.<field> sees the function's own response where AWS puts
it. A function error routes to OnFailure with a condition of RetriesExhausted, a
responseContext.functionError, and the error as the responsePayload.
The router is its own bean and reaches its collaborators through Instance
lookups because the dependency graph runs the other way: SnsService invokes its
Lambda subscribers and EventBridgeInvoker its Lambda targets, so injecting
those services into LambdaExecutorService eagerly would close a CDI cycle. The
lookup happens per delivery, which is also when a destination is first known to
exist, so a function without one costs a single map read. Delivery runs on the
invocation's pool thread under the destination account's request scope, and a
destination that rejects the record is logged: the caller was answered with 202
long before, and has nowhere to receive a late failure.
Retries and event age are still not applied, so a failure reaches its
destination once and approximateInvokeCount is always 1. The docs say so.
* fix(lambda): read an event invoke configuration as the function's own account
The configuration store is account-aware: PutFunctionEventInvokeConfig writes
into the caller's partition, keyed by that account. findEventInvokeConfig is
called from the asynchronous invoke pool, which carries no request context, so
the read fell back to the default account. A function in any other account
therefore looked as though it had no configuration and its destination was
silently skipped, with nothing logged, because having no destination is the
ordinary case this path is built to return quickly.
The read now runs under the function's owning account, taken from the function
itself and falling back to the account in its ARN, the same way the other
background workers re-establish an account before touching an account-aware
store.
* fix(lambda): bound a Lambda destination chain that leads back into itself
A function whose OnSuccess or OnFailure destination is a Lambda function, and
whose chain of those leads back to a function already in it, invoked forever.
Real AWS is not unbounded here either: recursive loop detection halts such a
chain after about sixteen invocations, so looping without end was a deviation
and not merely a hazard, and on a laptop it is a worse one than on AWS.
The number of destination hops that reached an invocation is now carried with
it, from the router through invokeArnFromDestination and into the executor, and
a Lambda destination at the sixteenth hop is dropped with a warning naming the
function the chain started from. A ThreadLocal, which is how the EventBridge
invoker bounds bus-to-bus forwarding, cannot serve here: every hop is an Event
invocation and so runs on a different pool thread.
The bound applies to Lambda destinations alone, the only kind that re-enters
this path. A queue, topic or bus at the last hop is still delivered, since it
ends the chain rather than extending it.
* docs(lambda): state the destination limits in the service docs
The alias constraint was recorded only in findEventInvokeConfig's javadoc, which
serves a maintainer reading the code and not a user reading the service docs,
and AGENTS.md asks for an intentional deviation to be documented. A destination
configured on an alias is not found, because the lookup matches the version the
invocation ran; $LATEST and an explicit version both work, and the CDK onSuccess
and onFailure properties store theirs under $LATEST.
Records the Lambda destination chain bound alongside it, so both limits of this
feature are in one place.
* refactor(lambda): make the destination routing switch an expression
AGENTS.md asks for switch expressions over switch statements without
qualification. The routing switch was a statement whose arms fell through to a
shared log line, with two of them returning early to skip it. Each arm now
yields whether the record was delivered and the log line is guarded on that,
which also removes the two returns hidden inside the arms.
The Lambda arm moves into its own method so its chain-bound check reads as a
condition on delivery rather than a second exit from the switch. No behaviour
changes: a record dropped for an unsupported ARN or for reaching the chain bound
is still logged at warn and still leaves the debug line unwritten.
* fix(lambda): carry the function and destination as event resources, and say S3 is not delivered
Two parity gaps against the capturing-records page, both found in review.
putOnEventBus set no Resources. AWS fills the event's resource field with the
invoked function and the destination, and EventBridgeService already emits the
member and matches rules against it (buildEventEnvelope reads entry Resources at
:1041 and writes `resources` at :1064; matchesPattern reads it at :894). Without
it a rule whose pattern matches on `resources` never fires -- the field arrives
empty rather than absent, so the pattern does not match and the record is dropped
at the bus rather than at the destination. Rules matching on `detail`, which is
the case the tests cover, are unaffected, which is why it stayed invisible.
The docs claimed all four destination kinds are supported. AWS has five: an S3
bucket, on failure only. The router keys on the service in the destination ARN
and has no s3 arm, so such a record reaches the default arm and is dropped with a
warning. That is the deploys-green-nothing-arrives shape this branch exists to
remove, so it is now a third bullet in the limits list rather than an omission,
and the opening sentence says four of five instead of all four.
The Resources test is measured killing a mutant: with the entry.put removed it
fails with "was: null", which is the defect verbatim.
* docs(lambda): correct the pre-fix mechanism, and scope the hop bound honestly
Two corrections from review, both to things this branch asserted.
The Resources javadoc and its test comment said the member "arrives empty
rather than absent, so the pattern simply does not match". It was absent, and
the route is worse than a mismatch: matchesPattern casts event.get("Resources")
to an ArrayNode unconditionally (EventBridgeService.java:894), so an absent
member throws NPE, the surrounding catch swallows it, and it is logged as
"Failed to parse event pattern" and reported as no-match. The record is dropped
at the bus and the log blames the caller's pattern. SesEventPublisher.java:215
already documents the same shape in almost the same words.
The limits list said a chain "stops at 16 hops" without qualification. The bound
is keyed on the destination being a Lambda ARN, so a cycle that leaves and
re-enters Lambda another way is not bounded at all: SnsService.java:1688 and
EventBridgeInvoker.java:109 each start a fresh chain at zero, so a topic that
fans back to the function, or a bus rule targeting it, loops forever. With
CallerRunsPolicy on the async executor that grows the stack once the queue
saturates rather than just spinning.
The code fix needs the depth threaded through both re-entry points, so it is
filed rather than done inline. The docs no longer claim what the code does not
do, which is the half that must not wait.
* fix(lambda): always emit millisecond precision in the record timestamp
Instant.toString() emits micro or nanosecond precision on JDK 9+, and emits no
fractional part at all when the nanos are zero. AWS always emits milliseconds
(2019-11-14T18:16:05.568Z), so a consumer parsing the record with a fixed .SSS
pattern breaks on the whole-second case. Same formatter shape as
ElasticBeanstalkQueryHandler, which already had this problem.
The test is deterministic on purpose. An assertion that only formats now() is
passed by truncatedTo(MILLIS).toString() about 999 runs in 1000, since that
differs only on an exact second -- I measured exactly that: the first version of
this test let the near-miss through, 16/16 green. formatRecordTimestamp is
package-private so the deciding input can be pinned, and the mutant now fails
with "expected 2019-11-14T18:16:05.000Z but was 2019-11-14T18:16:05Z".
LambdaEventInvokeConfigAccountScopeTest becomes an IntegrationTest. The earlier
round dismissed the conformance warning as a rule the repo ignores; review
counted it, and it does not: 778 of 922 @QuarkusTest classes follow the naming,
and 26 of 29 within services/lambda. The dismissal was wrong.
|
||
|
|
a574a6d01f |
fix(docker): keep host network mode for containers that publish ports (#4192)
* fix(docker): keep host network mode for containers that publish ports A spec with port bindings skipped HostConfig.NetworkMode on create and connected to the network after start, which Docker refuses for host, none and container:<id>. Such containers silently stayed on the default bridge with a published port, so an OpenSearch domain under FLOCI_SERVICES_DOCKER_NETWORK=host stopped listening on the host's :9200 once domains always published a host port (#2798). Namespace network modes now always go on the HostConfig, their port bindings are dropped since Docker publishes nothing there, and the post-start connect is skipped. A host-network container's endpoint resolves to localhost when Floci itself runs in Docker instead of a null host. * fix(docker): resolve container:<id> endpoints through the owning container resolveEndpoint only special-cased host, so a container sharing another container's network namespace fell through to resolveContainerIp, which has no network to read, and Floci stored a null host for it. The endpoint now follows HostConfig.NetworkMode to the owning container: localhost when that container is on the host network, otherwise its IP on the Docker network. Reading the mode from the inspect rather than the spec also covers adopted containers. * test(docker): pass portBindingHostIps to the network test spec helper ContainerSpec gained a 28th component in #4175 after this branch was cut, so the spec(...) helper added here no longer compiled once rebased onto main. |
||
|
|
ea60f70ad2 |
fix(apigatewayv2): cap HTTP_PROXY integration responses at the 10 MB payload quota (#4226)
HttpProxyInvoker read the whole integration response into memory with no limit. Stop reading once a response passes API Gateway's 10 MB payload quota and return 413 Request Entity Too Large, for Content-Length, chunked and close-delimited bodies alike. REST and HTTP APIs share this invoker, so both get the limit. |
||
|
|
317e007942 |
fix(redshift): fix Redshift emulation gaps found against the Terraform AWS provider (#3987)
* fix(redshift): add SnapshotArn and SnapshotCreateTime to snapshot responses DescribeClusterSnapshots and CreateClusterSnapshot never populated SnapshotArn or SnapshotCreateTime — the Snapshot model didn't carry either field. Real AWS returns both, and callers that filter on recovery-point age or restore by ARN have nothing to key off. SnapshotArn reuses the existing snapshotArn(clusterIdentifier, snapshotIdentifier) helper (already used for tagging, just never attached to the model). SnapshotCreateTime is captured via Instant.now() at snapshot creation and formatted with the same DateTimeFormatter.ISO_INSTANT convention already used elsewhere in this file for Expiration/CreateTime. Both elements are omitted from the XML response when the snapshot predates this field (an on-disk store surviving an upgrade), matching how the other optional elements in buildSnapshotXml already degrade. * feat(redshift): support DescribeLoggingStatus, EnableLogging, DisableLogging The Upbound Terraform provider's redshift Cluster resource calls DescribeLoggingStatus on every observe cycle, unconditionally, as part of its standard drift check across all configurable cluster aspects — not something a caller opts into. Without it, every cluster's observe step failed outright with InvalidAction, and the cluster could never report Synced/Ready even once fully created and available. Adds the three logging actions as a set, matching how EnableLogging/ DisableLogging/DescribeLoggingStatus share one response shape in the real API. No log delivery is emulated — only the configuration a caller set (enabled, bucket, prefix) is tracked and returned, the same graceful-scope choice already made for snapshot dump handling. XML wrapper element names (DescribeLoggingStatusResult, EnableLoggingResult, DisableLoggingResult) were verified against aws-sdk-go-v2's own generated deserializer, not assumed from the docs. * fix(redshift): default parameter group and MultiAZ on cluster responses Terraform provider's resourceClusterRead indexes ClusterParameterGroups[0] and requires MultiAZ to be exactly "enabled" or "disabled" unconditionally. Real AWS always attaches a default parameter group and never returns MultiAZ blank; floci previously omitted both, causing a panic and then a read error in the provider. * fix(redshift): resolve RestoreFromClusterSnapshot by SnapshotArn too Real AWS lets callers restore from either SnapshotIdentifier or SnapshotArn. Terraform's aws_redshift_cluster resource populates only snapshot_arn when that's the field configured, so the request carried no SnapshotIdentifier at all and floci NPE'd looking one up as null. * fix(redshift): use the real AWS error code for missing subnet groups RedshiftService threw "ClusterSubnetGroupNotFound", but AWS's actual code is "ClusterSubnetGroupNotFoundFault" and the Terraform AWS provider's generated deserializer type-matches on that exact string to recognize "doesn't exist yet, create it". A bare code fell through to an unclassified error, so the provider never got past Observe and a cluster subnet group could never be created through Crossplane. * fix(redshift): address PR review feedback Validate SnapshotArn (400 on malformed/missing, account and region check), honor ClusterParameterGroupName and MultiAZ, seed the default parameter group, allow CloudWatch EnableLogging, return 400 for missing subnet groups, sync docs, and add tests. * test(redshift): fix merge of logging tests with main's IAM role tests * refactor(redshift): share logging response helper and trim comments * fix(redshift): restore testDisableLogging's closing brace lost in the main merge Merging main's snapshot-copy-grant tests (#3628) next to the logging tests dropped the closing brace of testDisableLogging and the @Test annotation on describesSnapshotCopyGrants, so the latter body ran inside the former and the file failed to compile. * docs(redshift): resync action table order after the main merge make docs-sync moved ModifyCluster after the snapshot-copy-grant rows main added, matching the generator's canonical action order. --------- Co-authored-by: yarammanasa2001-max <271440416+yarammanasa2001-max@users.noreply.github.com> |
||
|
|
22c56157ee | feat(ecr): advertise TLS registry URIs on opt-in (#4252) | ||
|
|
eb039eb71c |
feat(cognito): serve managed login for native users with PKCE (#4238)
GET /oauth2/authorize with identity_provider=COGNITO, or none, now signs in the pool's own users through managed login instead of requiring a federated provider. It redirects to a plain sign-in form at /cognito-idp/login (/login on a custom domain), which checks the password as USER_PASSWORD_AUTH does, sets a pool-scoped `cognito` session cookie and redirects to the callback with code and state. A browser with a live session skips the form. /oauth2/token enforces PKCE (S256 only, as on AWS) when the authorization request sent a code_challenge, for managed login and federated sign-in alike, and refuses a code_verifier for a code issued without one (RFC 9700). The ID token carries the request's nonce. /cognito-idp/logout (/logout on a custom domain) ends the session and redirects to a registered LogoutURL, or back to the sign-in form for the redirect_uri form of the request. Discovery advertises code_challenge_methods_supported. Closes #4218 |
||
|
|
7e4d4dafae |
feat(rds): pause and resume Aurora Serverless v2 clusters at zero capacity (#4232)
An Aurora cluster whose ServerlessV2ScalingConfiguration has MinCapacity 0 now freezes its database container with docker pause once nothing has used it for SecondsUntilAutoPause, and resumes it for the next client, as Aurora Serverless v2 does. Every client of a backend container holds a lease while it uses it: each connection through the auth proxy (cluster, reader, instance and RDS Proxy endpoints), each RDS Data API call and open transaction, and each command Floci runs inside the container. A client that reaches a paused cluster is held, not refused, until the container runs again, after FLOCI_SERVICES_RDS_AURORA_RESUME_DELAY_MILLIS (default 0; Aurora takes about 15000). A connection that arrives while the pause is under way cancels it. While paused, the cluster and its instances stay available, DescribeEvents reports RDS-EVENT-0370 to 0374 for each instance, and ServerlessDatabaseCapacity, ACUUtilization and CPUUtilization report 0 once a minute. A cluster with a provisioned instance, in a global database or behind an RDS Proxy never pauses. A ModifyDBCluster that changes MinCapacity or SecondsUntilAutoPause resumes a paused cluster. Stopping, deleting or rebooting a cluster, shutting Floci down and resetting its state thaw a paused container first. FLOCI_SERVICES_RDS_AURORA_AUTO_PAUSE_ENABLED=false keeps every cluster running. Closes #4219 |
||
|
|
addee350ba |
fix(kinesis): expire shard records past the stream's retention period (#4224)
* fix(kinesis): expire shard records past the stream's retention period Shards kept every record for the life of the stream, so memory grew without bound and TRIM_HORIZON returned records older than the retention period. Drop records older than the retention period when a shard is written or read, including right after DecreaseStreamRetentionPeriod. Continuation and LATEST iterators now resume by sequence number instead of by array index, so trimming older records does not make a consumer skip data. Index-based iterators issued by earlier versions, such as persisted Firehose checkpoints, are offset by the number of records pruned since. * fix(kinesis): read a shard's records and pruned count under one lock A legacy index iterator is offset by the number of records pruned since it was issued. The records and the count were read in two separate lock acquisitions, so a prune between them left the count ahead of the snapshot and the consumer resumed too early, replaying records it had already read. Take both from one snapshot. * chore: rerun CI * test(kinesis): pin the service clock instead of stretching retention The JSON handler timestamp tests raised retention to 8760 hours so a fixed 2026 arrival timestamp survived pruning against the wall clock, which would start failing a year later. Build those services with a clock fixed just after the literal instead, and restore the fixed 2026-01-01 base in millisBehindLatestIsTimeDeltaWhenBatchLimitHit. |
||
|
|
f8f1b56ce9 |
feat(cloudfront): forward viewer headers, cookies and query strings per origin request policy (#4230)
Custom origins only ever received the origin custom headers: the serving controller built each origin request from them alone and dropped the query string, whatever cache policy, origin request policy or legacy ForwardedValues the matched cache behavior carried. CloudFrontOriginRequestBuilder now decides what reaches the origin. With a cache policy it forwards the union of the cache policy's ParametersInCacheKeyAndForwardedToOrigin and the origin request policy (every HeaderBehavior, CookieBehavior and QueryStringBehavior value). Without one it applies legacy ForwardedValues, including the headers CloudFront forwards by default. It also adds what CloudFront always sends: Host for the origin unless the viewer Host is forwarded, User-Agent "Amazon CloudFront", X-Forwarded-For, Via and X-Amz-Cf-Id. Authorization is kept on the methods CloudFront does not cache, and CloudFront-Forwarded-Proto, -Viewer-Address and -Viewer-Http-Version are generated when a policy asks for them. Origin custom headers now replace every same-named viewer header, and signing parameters are still never forwarded. The eight AWS managed origin request policies are served by their AWS IDs and cannot be updated or deleted. With no origin request policy and nothing selected by the cache policy, no cookies or query strings are forwarded, as before. Closes #4217 |
||
|
|
4ca0e085cd |
feat(cloudfront): serve POST, PUT, PATCH and DELETE viewer requests (#4229)
The serving controller only declared GET, HEAD and OPTIONS, so a write method on a distribution host matched the resource class but no method and fell through to a bare 405, even when the cache behavior allowed all seven methods. POST, PUT, PATCH and DELETE are now served under the same AllowedMethods check (403 "Invalid method." otherwise) and the same trusted key group enforcement as the read methods. Custom origins receive the method, the viewer request body, its Content-Type and its Authorization header, with Content-Length taken from the body; GET and HEAD still reach the origin without Authorization, as on CloudFront. In-process S3 origins answer these methods with 403 Access Denied instead of forwarding them, which is documented. Closes #4216 |
||
|
|
188542e67f | feat(ssm): seed the EKS optimized AMI parameter paths (#4191) | ||
|
|
f2d6710b24 |
fix(rds): apply DBInstanceClass, AllocatedStorage and EngineVersion on ModifyDBInstance (#4214)
* fix(rds): apply DBInstanceClass, AllocatedStorage and EngineVersion on ModifyDBInstance ModifyDBInstance parsed the password, IAM auth, subnet group, option group, security groups and the backup and monitoring settings, but never read DBInstanceClass, AllocatedStorage or EngineVersion. A resize or an engine upgrade returned 200 while DescribeDBInstances kept reporting the values the instance was created with, so a caller that diffs its configuration against a read-back saw the same pending change on every run. The three members move into a DbInstanceScalingChanges record that the handler fills from the request and the service applies, with the rules the AWS API reference states for them: - AllocatedStorage below the current size fails with InvalidParameterCombination - an increase under 10% is rounded up to 10% greater on PostgreSQL, MySQL and MariaDB, and taken as given on SQL Server - the same size is not a change and is left alone - a different major EngineVersion needs AllowMajorVersionUpgrade Floci applies the change immediately rather than deferring it to the preferred maintenance window: it runs no maintenance window and models no PendingModifiedValues, so a deferred change would never be applied at all. * fix(rds): reject a ModifyDBInstance scaling change before applying any member The scaling members were validated as they were assigned: the class was set, then the storage was resolved, which can refuse a shrink, then the engine version was checked, which can refuse a major upgrade. The instance a modify works on is the stored object rather than a copy, so a request refused at the second or third step had already written the earlier ones, and a read-back reported a class the 400 said it never got. The checks now run in resolveFor, ahead of every setter in modifyDbInstance, including the password rotation that reaches the running container. applyTo is left as pure assignment of an already-resolved record. |
||
|
|
daecc6da17 |
fix(route53resolver): CreateResolverEndpoint reads IpAddresses, as AWS names it (#4180)
* fix(route53resolver): CreateResolverEndpoint reads IpAddresses, as AWS names it
CreateResolverEndpoint read its address list from a member called
IpAddressRequests. AWS names that member IpAddresses; the list's SHAPE is named
IpAddressRequest, which is where the wrong wire name came from.
The distinction is not cosmetic. Every AWS SDK, the CLI and the Terraform
provider serialise IpAddresses, and the CLI refuses to send IpAddressRequests at
all because no such member exists in its model. So the operation dispatched and
no real client could call it:
{"Name":"ep","Direction":"INBOUND","SecurityGroupIds":["sg-1"],
"IpAddresses":[{"SubnetId":"subnet-1"}]}
-> 400 InvalidParameterException: IpAddressRequests is required
That is the worst shape a gap can take, because every cheap check says the
service works: it is in the service directory, /_floci/health lists it, an
operation-name grep finds it, and a does-it-route probe passes.
Reads IpAddresses, still accepting the old spelling so anything written against
the previous behaviour keeps working — the existing CustomResources tests use it
and are untouched. The error message names only the AWS member, since it is the
sole hint a caller gets. The idempotency record keeps its internal member name
deliberately: renaming it would make every endpoint stored by an earlier build
read as absent, which that code reports as a replay conflict.
Tests: the AWS member is accepted, the legacy one still is, a retry that switches
between the two spellings is not a conflict, and the missing-member error names
IpAddresses. 55 Route53Resolver tests pass.
Reported as #4108. Found while confirming that an earlier finding — Route53Resolver
absent entirely — had been fixed upstream: the probe written for it asserted only
that the call dispatches, which is what let this hide behind it.
* style: use -- rather than an em dash in added prose
AGENTS.md forbids em dashes in all content and the conformance check flags them.
Two in javadoc lines this branch added. Comments only, no behaviour change.
* docs(route53resolver): name the list shape correctly, and trim the member note
The list shape is `IpAddressesRequest`; `IpAddressRequest` is the shape of each
element, and that element name is where the wrong wire spelling came from. Both
the service doc and the Javadoc on ipAddressesOf had it as the list's own name.
The Javadoc also carried a paragraph on how the bug stayed hidden, which the PR
description already covers at length. What a reader of this method needs is the
member name and the legacy alias, so that is what is left.
|
||
|
|
de50859273 | fix(sns): match nested message-body policies in arrays (#4234) | ||
|
|
97aa084209 | fix(sns): require IAM role ARN for Firehose subscriptions (#4233) | ||
|
|
625bcb80d7 |
docs(ec2): document ten dispatched operations missing from action tables (#2605) (#3769)
* docs(ec2): document ten dispatched operations missing from action tables (#2605) AttachVolume, DetachVolume, DescribeSnapshots, CreateFlowLogs, DeleteFlowLogs, DescribeFlowLogs, RequestSpotInstances, DescribeSpotInstanceRequests, CancelSpotInstanceRequests, DescribeVpnGateways are dispatched by Ec2QueryHandler but had no rows in docs/services/ec2.md. Adds the rows by hand with descriptions drawn from the handlers; EC2 stays on the docs generator deferred_handlers allowlist. Fixes #2605 * docs(ec2): clarify DescribeVpnGateways returns an empty set |
||
|
|
4b3923712a |
feat(redshiftserverless): add namespace lifecycle and tagging (#3631)
* feat(redshiftserverless): add namespace lifecycle Amazon Redshift Serverless was absent entirely: every call returned UnknownOperationException, so Terraform's aws_redshiftserverless_namespace could not be planned or applied against Floci. Add a JSON 1.1 service under the RedshiftServerless. target prefix with CreateNamespace, GetNamespace, ListNamespaces, UpdateNamespace, and DeleteNamespace. Namespaces are account and Region scoped and stored through StorageFactory. AWS defaults are applied on create (dbName dev, kmsKeyId AWS_OWNED_KMS_KEY, empty logExports, status AVAILABLE), adminUserPassword is accepted and never returned, DeleteNamespace returns the removed namespace with status DELETING, and UpdateNamespace applies only the supplied fields. Workgroups, snapshots, and the tagging operations remain unemulated. * feat(redshiftserverless): add namespace tagging operations Terraform's aws_redshiftserverless_namespace calls ListTagsForResource on every read once tags are involved, so the namespace lifecycle alone left the resource broken as soon as a config set tags. Add ListTagsForResource, TagResource, and UntagResource. Lookup is by resourceArn rather than namespace name, scoped to the caller's Region, since that is how AWS keys these operations; the namespace is currently the only taggable Redshift Serverless resource, so any other ARN is reported absent. TagResource merges into the existing tags, UntagResource removes by key, and tags passed to CreateNamespace are readable back and survive UpdateNamespace. * fix(redshiftserverless): emit creationDate as ISO-8601 per the API model The awsJson1.1 default is epoch seconds and 133 call sites use it, but this model overrides it: TimestampFormatTrait ISO_8601 on creationDate (and on all eleven other timestamp members in the package, audited). Strict clients broke on the number: Terraform's Go SDK failed to decode and orphaned the created namespace outside state; the Java SDK failed to unmarshall. Only botocore's lenient parsing let CLI checks pass. Emitted via the repo's millisecond-ISO idiom; format pinned by regex in the integration test and by a new handler-level unit test class covering the wire layer that had none (timestamp shape, nextToken emission, maxResults type guard). Checklist note added to AGENTS.md + CONTRIBUTING.md so the next service checks the trait before reaching for the epoch idiom. * docs(redshiftserverless): the ISO-8601 rule is per member, not model-wide Review follow-up: the earlier claim that every timestamp member in this model carries TimestampFormatTrait(ISO_8601) is wrong — 15 of the model's 30 INSTANT members carry no trait and fall back to the awsJson1.1 epoch default. The shipped code is unaffected (creationDate, the only timestamp emitted, is genuinely ISO_8601), but the claim was load-bearing guidance: whoever adds snapshots or scheduled actions next would have applied ISO-8601 to trait-free members and reintroduced the bug in the opposite direction. Narrowed in all four places it appeared. * fix(redshiftserverless): validate collection types, copy-on-update; drop em dashes A present iamRoles, logExports, tags or tagKeys member that was not a JSON array parsed to null and was then indistinguishable from an omitted member, so a malformed UpdateNamespace silently kept the stored value and returned 200 instead of reporting the request as invalid. Only a missing or null member now means "omitted"; a present member of the wrong type, or a collection holding a non-string element, is a ValidationException naming the member. updateNamespace mutated the stored Namespace in place while GetNamespace and ListNamespaces read without taking the same monitor, so a concurrent reader could observe a torn object with some fields updated and some not. Build the new state on a copy and store that instead, which also makes the write-back explicit. The same in-place mutation was present in tagResource, untagResource and deleteNamespace, so all four now copy. Merge semantics are unchanged. Replace the em dashes in the timestamp guidance with commas and periods, per the repository ban. * fix(redshiftserverless): reject Redshift reserved words as namespace names CreateNamespace rejects a namespace name that is an Amazon Redshift SQL reserved word, so names like select or user passed the length and [a-z0-9-] checks here and were persisted. Add the documented reserved word list to the shared namespace-name validator, which create, get, update and delete all reach, so the rejection is consistent. |
||
|
|
7c94f69571 | feat(ec2): bound instance containers to their instance type resources (#4189) | ||
|
|
133ef62d27 |
feat(dynamodb): vector indexes and SearchVectors (#4215)
* feat(dynamodb): define vector indexes on the table control plane * feat(dynamodb): serve SearchVectors against vector indexes * feat(dynamodb): validate vector attributes on write * feat(dynamodb): report vector write capacity on writes * fix(dynamodb): reject a PartiQL read of a vector index * test(dynamodb): cover vector search in Floci's own suite * fix(dynamodb): match AWS on vector member paths and the f32 number format * fix(dynamodb): match AWS on the vector search validation gaps * perf(dynamodb): stop retaining and recomputing per candidate in vector search * docs(dynamodb): document that indexes are not stored |
||
|
|
6fadba8d57 |
fix(cloudformation): apply EC2 Instance UserData and IamInstanceProfile in place (#4206)
UpdateStack kept a reused AWS::EC2::Instance's prior UserData and IamInstanceProfile because Ec2Service had no in-place path for either: the provisioner reconciled only InstanceType and SecurityGroupIds. On AWS both are mutable, UserData with the "some interruptions" of a stop and a start. EC2 gains the three association actions, AssociateIamInstanceProfile, ReplaceIamInstanceProfileAssociation and DisassociateIamInstanceProfile, with botocore's wire names, all five members of the association including the timestamp the instance now records, and the errors moto documents (IncorrectState for a second association, InvalidAssociationID.NotFound for an unknown id). ModifyInstanceAttribute accepts UserData.Value on a stopped instance, answering IncorrectInstanceState otherwise, the order Terraform's provider performs as stop, modify, start. The association id derivation moves from the handler into Ec2Service so the provisioner can name an association. Ec2InstanceCfnProvisioner rewrites a changed UserData across a stop and a start (an already stopped instance stays stopped), resolves the profile name to its ARN at provision time as the RunInstances handler does, associates or replaces a changed profile, and disassociates one only when the template declared it last time, recorded in a __Floci attribute so a profile a launch template set is never stripped. A dropped UserData is left as it is, the same rule SecurityGroupIds follows. Tests: Ec2InstanceCfnProvisionerTest covers the stop/modify/start order, the stopped case, associate, replace, disassociate and the undeclared-profile guard; Ec2IamInstanceProfileAssociationIntegrationTest and Ec2UserDataAttributeIntegrationTest pin the wire behaviour; CloudFormationEc2InstanceIntegrationTest updates both properties on one instance and reads them back through EC2. |
||
|
|
8d9ae9554d |
fix(elbv2): dispatch a shared listener port by the hostnames rules declare (#4207)
* fix(elbv2): dispatch a shared listener port by the hostnames rules declare Two load balancers with a listener on the same port both answered 502. Floci serves every load balancer from one socket per port, and listener selection keyed only on the load balancer's own DNS name, so a request carrying any other Host header matched neither key. With one load balancer a size-1 fallback covered that up; adding a second removed the fallback and silently broke both. Listener selection now also consults the host-header conditions the listener's rules already declare. A load balancer that names the hostname it serves, which is the configuration AWS needs anyway, claims that hostname here too. The DNS-name match and the single-listener fallback are unchanged and still take precedence in that order. A port taken by a second load balancer now logs a warning naming both, since nothing else reported the collision: the targets behind them stay healthy and no API call fails. Real AWS has no load-balancer selection step, because every load balancer has its own DNS name and addresses; host-header rules only choose a rule inside one listener. Selecting a listener by Host header is a Floci deviation forced by the shared socket, and is documented as one. * test(elbv2): pin the AWS host-header matching semantics selection relies on The AWS docs state that a hostname is not case-sensitive, that * matches 0 or more characters and ? exactly 1, and that the rule *.example.com matches test.example.com but not example.com. Listener selection now depends on that matching, so cover it directly: a case-shifted Host still resolves, and a wildcard rule does not let its listener claim the bare domain. Also record that HostHeaderConfig.RegexValues is unsupported, so a load balancer naming itself only through a regex cannot be selected this way. |
||
|
|
51b6485173 |
feat(kms): support RSA imported key material (#4152)
* refactor(kms): encapsulate import key material logic in KmsKeyType implementations * feat(kms): support RSA key import * fix(kms): check aes key length * fix(kms): wrapping algorithm value validation * docs(kms): update docs to reflect asymmetric RSA import support * fix(kms): add private CipherUtils constructor * test(kms): add tests for rsa key material import |
||
|
|
ffe56f735d |
feat(stepfunctions): route RDS Data execute statement (#4179)
Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com> |
||
|
|
9dd2bd62e4 | feat(kms): implement ReplicateKey for multi-region keys (#4176) | ||
|
|
e947b6a2a1 |
feat(ses): add v2 GetMessageInsights (#4157)
* feat(ses): add v2 GetMessageInsights Serves the per-recipient event timeline for a sent message. The timeline is derived at send time from the events SesRecipientEvents classifies for the send, the same classification that drives configuration-set event publishing and identity notifications, then stored on the SentEmail record, so the read path is a plain lookup and no new event store is needed. SentEmail also gains the EmailTags the operation returns, and a raw send now stores its parsed MIME subject, when present, as a simple send does. Insights additionally report DELIVERY for an ordinary recipient so a plain send does not look stuck at SEND; a suppressed recipient never gets DELIVERY, since it is dropped before the relay, and a message the content scan rejected ends every recipient's timeline at REJECT. What gets published is unchanged. Probed against real SES in us-east-1: the operation is gated on Virtual Deliverability Manager and reports that before it looks at the message id, a missing message names the account alongside the id, Isp carries the literal UNKNOWN_ISP when the provider cannot be identified, BounceType is the upper-case enum member, and an account-suppressed recipient is reported with BounceSubType ON_ACCOUNT_SUPPRESSION_LIST and SES's own suppression text as the diagnostic, the upper snake spelling this operation uses where the published events say OnAccountSuppressionList. Floci deliberately records the mailbox-simulator sends and the multi-recipient mail that VDM drops, because dropping both would leave insights permanently empty, and returns one entry per envelope recipient where an AWS response carries at most one. * test(ses): pin the message-insights VDM gate to one account The gate reads the account VDM attributes, which are account-scoped like every other SES store, but no test said so: the isolation test enables VDM for both of its accounts. An account that never enabled it now has to meet the gate while others in the same region are past it. * feat(ses): report a content-rejected raw send in message insights The raw send path classified its recipients with a hardcoded false, because the content scan did not exist on this branch's base. It does now, so the real scan result reaches the timeline: a rejected raw send reports SEND then REJECT instead of a delivery it never had. Its stored tags follow the same rule the published events already use, the request's own tags only, so tags read off a refused message's headers cannot resurface through GetMessageInsights. |