mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
917e94914ff719d02f39cff9537de9aec080e84e
1837
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
dc61c1a8a5 |
feat(core): derive ARN partition from the region (#3334)
AwsArnUtils.Arn.of hardcoded the "aws" partition, so every ARN the emulator minted for a GovCloud or China region named the wrong partition. Correctness here was not a property of the call site: all 115 Arn.of callers and the 132 that reach it through RegionResolver.buildArn were equally wrong, including the ones following the documented pattern. AwsRegions gains partitionFor and dnsSuffixFor, with the region patterns transcribed from botocore's partitions.json regionRegex values so they stay comparable against it. Only the non-commercial partitions need a rule; an unrecognised region resolves to "aws", which is what the SDKs do and keeps a region AWS launches tomorrow working rather than failing closed. EksTokenMinter carried the same table for STS hostnames and now delegates to it, so a partition cannot go missing from one and not the other. Global services pass an empty region and keep "aws". That gap is documented on Arn.of rather than closed: an IAM ARN in a GovCloud deployment really is arn:aws-us-gov:iam::..., but nothing in the region argument can say so, and those call sites need a partition from the deployment instead. AwsArnUtils is referenced from 120 files and had no test of its own, so this adds one, written against the previous behaviour before the change and covering the resource field's colon handling that the callers depend on. No test in src/test or compatibility-tests constructs an ARN from a non-commercial region: the six that mention one are parsing a hostname or validating a supplied ARN. The emitted ARNs are therefore unchanged for the whole suite. |
||
|
|
31f8860c11 |
fix(s3): validate multipart completion parts (#3312)
* fix(s3): validate multipart completion parts * fix(s3): accept CLI multipart ETags |
||
|
|
8b25e5003d |
fix(lambda): defer handler validation to invocation (#3332)
Fixes #3311 |
||
|
|
8a4c6494ed |
chore(tls): pin the certificate path against backslash mangling (#3336)
The sibling Azure emulator lost TLS startup on Windows: a path such as D:\Dev\floci\data\tls\cert.crt reached the HTTP server as D:Devflocidatatlscert.crt and died with NoSuchFileException. That is not general SmallRye behaviour, which is what makes it easy to reintroduce. Expression handling leaves a value with no '$' untouched and deliberately compiles without escape processing; the damage comes from StringUtil.split, reached only by the converter for collection-typed properties, which consumes every backslash. So the property's declared type is the entire defence. This emitter is safe today only because it writes quarkus.tls.key-store.pem.0.cert, a scalar Path. The key it wrote before the TLS registry migration, quarkus.http.ssl.certificate.files, is an Optional<List<Path>> and is mangled. Nothing recorded that distinction, so moving back to a plural key would silently break Windows again. Adds tests that assert a Windows-shaped path round-trips through a scalar property, demonstrate the mangling on the collection path so the reasoning is evidence rather than assertion, and fail if the collection-typed keys are ever emitted again. Also hoists the internal HTTP and HTTPS port literals into constants on TlsConfigSource. TlsProxyServer routes to those ports and had its own independent copies, so the two could drift apart silently. |
||
|
|
278d9ec83e |
refactor(core): parse XML through one hardened factory, not four (#3337)
CloudFront, Route 53 and S3 each stood up a private XMLInputFactory and each restated the same three hardening properties: namespace-aware, DTDs off, external entities off. XmlParser already had a fourth copy. Four copies of security-relevant configuration is three too many, and a copy that one day forgets a property is an XXE hole with nothing to catch it. XmlParser gains newStreamReader, exposing the factory it already holds, for callers whose parsing goes past the extraction helpers because they read attributes. The three controllers drop their own factories and their ten call sites go through it. Behaviour is unchanged by construction: the four factories were byte-identical before this, same properties and same values, so no test needed touching. That was the check, not an afterthought. Tests pin what is being centralised, which nothing covered before. Worth recording what they found: SUPPORT_DTD=false does not reject a document type declaration, it silently skips it. The protection is that nothing declared inside takes effect, so an entity referenced from it fails as undeclared rather than expanding, and an external one is never read. The tests assert that behaviour rather than the refusal I first assumed. |
||
|
|
82eaaaeee7 |
refactor(cloudformation): move the Batch types into BatchCfnProvisioner (#3285)
* refactor(cloudformation): move the Batch types into a per-service provisioner AWS::Batch::ComputeEnvironment, JobQueue and JobDefinition move out of the legacy monolith into BatchCfnProvisioner, continuing the decomposition. The three provisioning methods and the three helpers only they called (computeEnvironmentOrder, containerProperties, retryStrategy) move across unchanged; the generic property helpers they leaned on have other callers and stay behind, re-expressed here against ProvisionContext, which already offers resolveOptional, generatePhysicalName and resolveTags. Behaviour preserving: same request shapes, same physical ids, same Fn::GetAtt attributes. The defects these arms carry (nothing is deleted on stack delete, updates re-create rather than update, Priority is defaulted although the schema requires it) are left exactly as they were and are fixed in the commits that follow, so this move stays reviewable on its own. BatchService was the monolith's only remaining use of the field, so the field, its constructor parameter and its import go too. Batch is absent from DELETE_NEEDS_STACK_RESOURCE, so that set is untouched. The inventory rows move from LEGACY_SWITCH to BatchCfnProvisioner and the test fixture gains the inferred wiring; without the latter a fixture test naming Batch would fall through to the stub arm and pass on a fake id. docs-sync reports the generated table already current, and the schema-coverage gate finds no new attribute gaps: each type's only top-level read-only property is its ARN, which was already set. Monolith 6,457 to 6,292 lines, legacy types 47 to 44. * fix(cloudformation): delete Batch resources when their stack is deleted The legacy switch had no AWS::Batch arm in any of its delete paths, so deleting a stack left the compute environment, job queue and job definition behind. The stack reported DELETE_COMPLETE over resources that were still there, and a re-created stack then failed on the names it had supposedly released. Batch refuses to remove a running entity, as AWS does: DeleteJobQueue rejects an ENABLED queue, and DeleteComputeEnvironment rejects one that is not DISABLED or is still referenced by a queue. So each delete disables first and then removes, which is what the real resource handlers do. CloudFormation already tears down in reverse dependency order, so a queue is gone before the environment it points at. A job definition is deregistered, which is AWS's own semantic for that type: the revision goes INACTIVE rather than disappearing. Deliberately not CfnDeletes.safeDelete. Every BatchService failure carries the same ClientException code, so tolerating it would be the catch-all AGENTS.md rules out: a genuine refusal such as "still associated with a job queue" would be swallowed into a green stack delete instead of surfacing as DELETE_FAILED. Already-gone is handled by looking first instead, which also keeps the disable step from throwing on a resource removed out of band, and makes a repeated delete idempotent. That check matters most for the job definition, the one call of the three that throws when its target is missing. Nine unit tests cover the ordering, the idempotent repeat, and that a refused delete propagates rather than being swallowed. * fix(cloudformation): update Batch resources in place instead of re-creating them provision runs again on every UpdateStack, and the legacy switch always created. That broke both ways. A named compute environment or job queue called create a second time under the same name, and createComputeEnvironment and createJobQueue both reject a duplicate, so the stack update failed. An unnamed one generated a fresh random name each time, creating a second entity and orphaning the first. An update that keeps the name now goes through UpdateComputeEnvironment or UpdateJobQueue, the schemas' update handlers, and keeps the prior physical id. Only the properties those handlers accept are pushed through: the names, Type and JobQueueType are createOnly, so a change there is a replacement the engine drives rather than something to force into an update. A job definition needs no update branch, because RegisterJobDefinition on an existing name records a new revision, which is exactly how AWS updates one. The name is kept steady by reading the attribute recorded at create time, the way SqsCfnProvisioner reads QueueName beside the queue URL. ProvisionContext's stablePhysicalName and reusesPriorEntity do not fit here: both fall back to the prior physical id, which for Batch is an ARN rather than a name, so they would feed an ARN back in as a name. Their javadoc says as much. For a stack created before that attribute was recorded, the name is recovered from the prior ARN so those stacks update in place too rather than duplicating. Six more unit tests: in-place update for both types, a rename creating instead of updating, an unnamed resource keeping its generated name, the ARN fallback, and a job definition re-registering under the same name. * fix(cloudformation): enforce the Batch schemas' required properties Three properties the registry schemas mark required were optional here, so a template missing one applied cleanly against floci and then failed on AWS, which is the divergence the emulator exists to prevent. AWS::Batch::JobQueue requires Priority; the switch substituted 1, so the service's own "priority is required" check could never fire. ComputeEnvironment and JobDefinition both require Type; an absent one reached the service as a null and JobDefinition additionally defaulted to "container". All three now fail the resource with the repo's ValidationError wording, matching how Ec2NetworkCfnProvisioner reports a missing required property. Also drops the Revision attribute from AWS::Batch::JobDefinition. Revision is not a property of that type in the registry schema, and the legacy resource spec gives the type no attributes at all, so Fn::GetAtt on it fails on AWS. Offering it let a template pass here and break there. Nothing in the repo reads it. The physical id stays the job definition ARN despite the schema's primaryIdentifier naming JobDefinitionName, because the legacy spec and the type's documented Ref both point at the ARN; changing it would be visible to existing templates on evidence that does not agree with itself. The integration test now covers the two stack-level defects end to end: an update that changes only updatable properties keeps both physical ids and moves the queue's priority, and a stack delete leaves neither entity behind. Both assertions fail without the preceding two commits. * fix(cloudformation): clean up the Batch entity a replacing update displaces Renaming a compute environment or job queue creates the replacement and leaves the original live in Batch forever. The provisioner recorded nothing, so the engine was never told a replacement had happened: no DELETE_IN_PROGRESS event, no cleanup phase, and nothing to delete the displaced entity even under the default UpdateReplacePolicy. Wired to the shared ReplacementCleanup the way CloudFrontCfnProvisioner does it rather than re-derived: attributesBefore is copied as the first statement of provision, and record runs at the end of each arm once the new physical id is assigned, which is what lets it compare the prior id against the new one. The four hooks delegate straight through. An in-place update keeps the prior ARN, so it records nothing and stays outside the cleanup path. AWS::Batch::JobDefinition is deliberately not wired the same way. The registry schema gives it primaryIdentifier JobDefinitionName, not the ARN, and registering revision 2 does not retire revision 1 on AWS: the prior revision stays ACTIVE and a running job may still name it. Every registration mints a new ARN, so treating a changed physical id as a replacement here would have the cleanup deregister a live revision. Only a changed name replaces the definition, and that decision is taken before the register call overwrites the recorded name, since the check reads that attribute. Five unit tests: a renamed environment recording its predecessor, completeUpdate actually deleting it, an in-place update owing nothing, a revision bump owing nothing, and a renamed definition owing its predecessor. Mutation checked by dropping the record call, which fails the first two and nothing else. * fix(cloudformation): restore an in-place Batch update when the stack rolls back An in-place compute environment or job queue update committed and then could not be undone. Without a rollbackUpdate hook the resource fell to "Rollback is not implemented for AWS::Batch::JobQueue", which is not a quiet gap: CloudFormationService adds it to the rollback failures, so the whole stack reports UPDATE_ROLLBACK_FAILED and the committed template is not restored either. A stack whose Batch resource sat anywhere ahead of the failing one could not roll back at all. Snapshot the entity before the update call and put it back, following LambdaEventInvokeConfigCfnProvisioner: replacement first through the cleanup record, then the snapshot for the in-place case. The describe is the only source, because the template holds the desired state rather than the current one. The snapshot is spent only once the restore succeeded, so a restore that throws leaves it for the next attempt instead of reporting a rollback that never happened, and a resource this update never touched carries none and answers false rather than claiming one. Simpler than the Events rule this pattern comes from: each Batch update is a single service call, so a throw leaves nothing half-applied and no in-provision restore arm is needed. A job definition instead names the revision the failed update registered, which is deregistered on rollback while the resource points at the prior one again. Snapshotting is best effort. An entity the describe cannot find leaves none, and rollbackUpdate then answers false rather than restoring a guess; failing the update there would break a working update over missing rollback insurance. The integration test is the one that proves the hook is reached: a stack whose later resource cannot provision now reaches UPDATE_ROLLBACK_COMPLETE with the queue back on its original priority. Reverting rollbackUpdate puts it back to UPDATE_ROLLBACK_FAILED, reason "The following resource(s) failed to roll back: [Queue, Compute]". * fix(cloudformation): reject a Batch job queue Priority that is not a valid integer Priority reached Integer.parseInt unguarded on both the create and the update path, so a template carrying "high", or a Ref resolving to something that is not a number, threw NumberFormatException out of the provisioner. The stack surfaced that as a 500 rather than the failed validation it is, while every other bad property in this class raises ValidationError with a 400. Parsed through a helper that raises the same ValidationError instead, and bounded while there: the registry schema types AWS::Batch::JobQueue Priority as integer with minimum 0 and maximum 1000, so a value outside that is as invalid as a non-numeric one and AWS rejects both. This is the same schema-sourced enforcement the required-properties commit already applies, reaching the one property it left parsing unchecked. Three unit tests: a non-numeric value on create, the same on the update path, and an out-of-range one. Mutation checked by restoring Integer.parseInt, which fails all three and nothing else. * docs(cloudformation): say why the Batch deletes cannot use CfnDeletes.safeDelete The javadoc already said safeDelete was deliberate, but not enough to stop the question being asked again: it read as a limitation of BatchService rather than of the API. It is the API. Batch declares exactly two errors on DeleteComputeEnvironment, DeleteJobQueue and DeregisterJobDefinition, ClientException at 400 and ServerException at 500, and no not-found code anywhere in the service model. safeDelete takes the specific already-gone code by design, so there is none here to pass it. Tolerating ClientException instead would be the catch-all AGENTS.md rules out, swallowing a real refusal such as "Cannot delete compute environment still associated with a job queue" into a green stack delete. Giving Batch a Floci-only not-found code to satisfy the pattern would put a code on the wire AWS never sends, which is the wire contract this emulator exists to keep. Also names EcsCfnProvisioner, which does tolerate a blanket ClientException for its task-definition arm, so the divergence reads as deliberate rather than as an oversight. Comments only. No behaviour change, so the existing tests are what prove it inert. * docs(cloudformation): record what a Batch rollback cannot undo A compute-environment rollback restores every value the environment already carried and cannot remove one the failed update introduced. The snapshot holds what the describe returned, so a serviceRole or computeResources key that was absent beforehand is absent from the snapshot, the restore call omits it, and UpdateComputeEnvironment leaves an omitted field alone while merging computeResources rather than replacing it. The value survives a rollback the stack reports as successful. That cannot be closed here. UpdateComputeEnvironment is the only way to put the environment back and its request shape has no removal: every member other than computeEnvironment is an optional set-value, and the partial-merge semantics are AWS's own. So this is disclosed on rollbackUpdate and pinned by a test, the way CognitoCfnProvisioner records its own in-place rollback limitation, rather than worked around. Job queues are not affected. updateJobQueue assigns computeEnvironmentOrder wholesale rather than merging it, and state and priority are always present, so that restore is exact. The test asserts the surviving value rather than only that the rollback returned true, so it goes red if the merge semantics ever change without this note changing with them. Mutation-checked: making the restore send an empty serviceRole fails it. |
||
|
|
483dfb4e1c |
feat(agentcore): expand Bedrock AgentCore control-plane coverage (#3317)
* feat(agentcore): emulate CreateBrowser * feat(agentcore): emulate GetBrowser * feat(agentcore): emulate ListBrowsers * feat(agentcore): emulate DeleteBrowser * feat(agentcore): emulate CreateBrowserProfile * feat(agentcore): emulate GetBrowserProfile * feat(agentcore): emulate ListBrowserProfiles * feat(agentcore): emulate DeleteBrowserProfile * feat(agentcore): emulate CreateCodeInterpreter * feat(agentcore): emulate GetCodeInterpreter * feat(agentcore): emulate ListCodeInterpreters * feat(agentcore): emulate DeleteCodeInterpreter * feat(agentcore): emulate CreateGatewayRule * feat(agentcore): emulate GetGatewayRule * feat(agentcore): emulate ListGatewayRules * feat(agentcore): emulate UpdateGatewayRule * feat(agentcore): emulate DeleteGatewayRule * feat(agentcore): emulate CreateApiKeyCredentialProvider * feat(agentcore): emulate GetApiKeyCredentialProvider * feat(agentcore): emulate ListApiKeyCredentialProviders * feat(agentcore): emulate UpdateApiKeyCredentialProvider * feat(agentcore): emulate DeleteApiKeyCredentialProvider * feat(agentcore): emulate CreateOauth2CredentialProvider * feat(agentcore): emulate GetOauth2CredentialProvider * feat(agentcore): emulate ListOauth2CredentialProviders * feat(agentcore): emulate UpdateOauth2CredentialProvider * feat(agentcore): emulate DeleteOauth2CredentialProvider * feat(agentcore): emulate GetResourcePolicy * feat(agentcore): emulate PutResourcePolicy * feat(agentcore): emulate DeleteResourcePolicy * docs(agentcore): update expanded coverage * fix(agentcore): align expanded control-plane contracts * fix(agentcore): address PR review findings * test(agentcore): cover persistent delete replay |
||
|
|
283890dce9 | feat(stepfunctions): add SNS Publish service integration (#3316) | ||
|
|
650914f5f1 |
feat(stepfunctions): resolve Fail state ErrorPath and CausePath dynamically (#3302)
A Fail state now resolves Error and Cause dynamically from ErrorPath and CausePath, evaluated against the state input through the same JSONPath resolver a payload template field uses. CreateStateMachine now also rejects a Fail state that declares both Error and ErrorPath, or both Cause and CausePath, as AWS does, and rejects a non-string ErrorPath/CausePath value at definition time rather than letting it reach execution and fail with States.Runtime. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * Fix #3255 |
||
|
|
d44a3fef62 |
fix: bound CloudTrail delivery retries (#3298)
* fix: bound CloudTrail delivery retries * fix(cloudtrail): reserve limits for failed deliveries * fix(cloudtrail): reserve in-flight retry capacity * fix: preserve per-trail CloudTrail flush isolation * test: make CloudTrail burst assertions deterministic * test: preserve CloudTrail delivery order coverage * chore: rerun CI * chore: rerun CI |
||
|
|
abfa8e949e |
fix(iam): report the real default version of AWS-managed policies (#3275)
Signed-off-by: Matheus André <matheusandr2@gmail.com> |
||
|
|
460aa0718e |
feat(cloudwatch): provision AWS::CloudWatch::Dashboard (#3231)
* 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. |
||
|
|
6eca8540a8 |
feat(aps): implement AMP rule groups namespaces (#3330)
* feat(aps): implement AMP rule groups namespaces Closes #3329 * fix(aps): validate rule groups namespace names and tag ARN scope |
||
|
|
b377134fcb |
fix(dynamodb): keep stream iterators stable after trimming (#3313)
* fix(dynamodb): keep stream iterators stable after trimming * fix(dynamodb): detect trimmed empty stream iterators Track stream records issued after zero-sequence iterators so retention overflow returns TrimmedDataAccessException. * test: scope VPC endpoint deletion assertion * fix: stabilize DynamoDB stream cursors |
||
|
|
8921ca1118 |
feat(ec2): answer MonitorInstances and UnmonitorInstances (#3319)
* feat(ec2): answer MonitorInstances and UnmonitorInstances
Both actions returned UnsupportedOperation. Detailed monitoring is a CloudWatch
billing switch with no behaviour an emulator can meaningfully model, which is
presumably why it was left out -- but declining the call is more costly than
answering it, because one unsupported action fails an entire deployment regardless
of how much of the rest of it succeeded. An aws_instance declared with
monitoring = true
calls MonitorInstances immediately after RunInstances, so the whole configuration
is discarded over a flag with no state behind it.
Acknowledge the requested state and echo every instance the caller named. Nothing
is stored: there is no monitoring data to serve, and DescribeInstances does not
report a monitoring state today, so persisting one would only create a second
place for it to be wrong.
Reference: the MonitorInstances response shape -- instancesSet of
InstanceMonitoring, each with instanceId and monitoring.state, plus requestId --
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_MonitorInstances.html
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_UnmonitorInstances.html
One deliberate deviation: AWS reports state "pending" because the change is applied
asynchronously, then settles on "enabled". The emulator has nothing to settle, so it
reports the terminal state directly. Reporting "pending" for a transition that would
never complete would be worse for any client that polls.
* fix(ec2): reject monitoring for an instance that does not exist, and store the state
Two problems, both of which made the action answer confidently about something it
had not done.
The handler echoed every InstanceId back with a 200 without resolving it, and did
not even take a region to resolve it with. Naming an instance that does not exist
got a success response saying its monitoring was enabled. Every other instance
operation raises InvalidInstanceID.NotFound; this now does too, by delegating to
the service and resolving each id through getRequiredInstance, which is the same
shape stopInstances and the rest already use.
The state was also never stored. Instance already carries a monitoring member and
DescribeInstances already emits it, so MonitorInstances reported "enabled" while
every subsequent read still said "disabled". The state now persists, so the round
trip agrees with itself.
The previous tests asserted the old behaviour: they passed a made-up instance id and
expected 200. They are rewritten to launch a real instance, and two cases are added
for the not-found path plus one that reads the state back through DescribeInstances.
* test(ec2): name the monitoring suite for what it is, an integration test
It is a @QuarkusTest driving the HTTP endpoint, and the repository's dominant
convention for those is *IntegrationTest: 607 of the 736 @QuarkusTest classes on
main follow it. Renaming rather than arguing, since the evidence here points at
the convention.
* test(ec2): cover monitoring through the SDK path, not only the Query wire
AGENTS.md asks for management APIs to be validated with SDK clients and "not only
handcrafted HTTP requests". The Java test drives the Query endpoint with RestAssured,
which is right for pinning exact XML but does not exercise the path aws_instance
actually takes: monitoring = true calls MonitorInstances through the SDK, which parses
the response rather than reading whatever XML we happen to emit.
Three cases in the awscli suite, which is where EC2 SDK coverage already lives:
enable and read back through DescribeInstances, disable and read back, and reject an
instance that does not exist. The read-backs are the point rather than padding: the
bug this guards against was the handler answering "enabled" while every later read
still said "disabled", which asserting on the mutating call's own response cannot see.
Verified as far as this machine allows. run-instances, the teardown and the harness
plumbing all work against a local emulator; the three assertions themselves cannot
pass here because the released 2.0.1 image predates MonitorInstances, which is the
gap this PR closes. They run against the branch build in CI.
|
||
|
|
2d5a8f705b |
fix(amazonmq): add configuration for AMQP and console host port ranges (#3315)
Signed-off-by: Matheus André <matheusandr2@gmail.com> |
||
|
|
8180d4b3b8 | feat(acm): enhance email validation to report approval mailboxes and omit DNS records (#3290) | ||
|
|
66ca9dc4a6 |
fix(dynamodb): bind every PartiQL parameter type and reject unordered operands (#3288)
* fix(dynamodb): bind every PartiQL parameter type and reject unordered operands PartiQL parameters only bound S, N, BOOL and NULL. Every other type was rejected with "Unsupported parameter type in parameters array", so a statement could not compare against B, SS, NS, BS, L or M. Keep those parameters as their wire node and pass them through unchanged. Binding them makes the ordering operators reachable for types that have no ordering, so <, <=, >, >= and BETWEEN now reject any operand outside S, N and B. The message names the operator as it was written. Takes tier2/partiql in the dynamodb-conformance suite from 70 to 113 of 186, with no regression elsewhere in the suite. * fix(dynamodb): validate PartiQL parameters as AttributeValues before they run A parameter was bound on the first type key it carried. A value with zero or several type keys was accepted, and a binary that is not base64 reached the comparison and failed with a 500. Check every parameter the way AWS reads a request. Base64 is checked first and fails with SerializationException. Then each value must carry exactly one type key, down through lists and maps, or it is a ValidationException with the AWS wording. The binary comparison in ExpressionEvaluator now decodes through the guarded path, so a FilterExpression against a binary that is not base64 is a 400 as well. Checked against real DynamoDB in ap-northeast-1 on 2026-09-10. |
||
|
|
dde11aeb6a |
fix(cloudformation): keep unchanged VPCs and security groups on stack update (#3033)
* fix(cloudformation): keep unchanged VPCs and security groups on stack update provision() re-runs for every resource on every UpdateStack, changed or not. Ec2VpcCfnProvisioner called createVpc() and provisionSecurityGroup() called createSecurityGroup() unconditionally, so an untouched VPC or security group was re-created under a fresh id on every update - silently orphaning every subnet, route table and group that referenced the old one. The security group case hid behind the VPC one: because the VPC id changed too, the (name, vpcId) duplicate check never fired, so the stack still reported UPDATE_COMPLETE while leaking a second group. Both now reuse the resource the stack already points at. A changed CidrBlock (VPC) or a changed GroupName (security group) is still treated as a replacement, and a resource deleted out of band still falls back to create. Adds CfnUnchangedResourceUpdateIntegrationTest, which asserts physical-id retention across an update for VPC, security group, S3 bucket, SQS, SNS, log group, ECR, KMS alias and Kinesis. Asserting UPDATE_COMPLETE alone is not enough - a re-created resource passes that while breaking every reference to it. * fix(cloudformation): reconcile a reused security group's inline rules Reusing an unchanged security group instead of re-creating it exposed a second bug in the same arm: authorizeSecurityGroupIngress/Egress append without a duplicate check, and the inline SecurityGroupIngress/SecurityGroupEgress loops run on every provision pass. A reused group therefore accumulated another copy of every inline rule on each UpdateStack. Re-creating the group had masked this, since each update authorized onto a brand new group. Clear the rule sets the template declares before re-authorizing, which also drops rules the template no longer lists. A set the template does not declare is left alone, so a group keeps its default egress. Also narrows reuse: GroupName, GroupDescription and VpcId are immutable on a security group, so a template that changes one wants a new group rather than an edit to this one. Only the GroupName check was exercised before. Adds securityGroupInlineRulesAreNotDuplicatedByAnUpdate, which asserts the group still describes each inline rule exactly once after an update. Verified non-vacuous: without the revoke it fails with the rule present twice. * test(cloudformation): focused provisioner coverage for AWS::EC2::VPC Mirrors S3CfnProvisionerTest: mocks only Ec2Service and pins the create path's Fn::GetAtt keys (VpcId, CidrBlock, DefaultSecurityGroup) alongside the three update outcomes - reuse when nothing changed, replacement on a changed CidrBlock, and a fresh create when the VPC is gone from the backend. The integration test asserts physical-id retention end to end but cannot show which service call was made; this pins that createVpc is not called at all on an unchanged update. * fix(cloudformation): authorize only the inline rules a group is missing Clearing the declared rule sets before re-authorizing fixed the duplication but introduced a worse defect: a group can also carry rules from standalone AWS::EC2::SecurityGroupIngress/Egress resources, and the revoke took those with it, so an unrelated stack update silently closed ports another resource owns. A rule rejected mid-authorize also left the prior set already deleted, with nothing to restore it. Reconciliation is now additive. Each declared rule is authorized only when the group does not already carry it, compared on a canonical key since IpPermission and its range types define no equals. Nothing is revoked, so neither failure mode is reachable. The trade-off is explicit: a rule dropped from the template is no longer revoked. Doing that safely needs the provisioner to record which rules it authorized, which this arm cannot do while it lives in the legacy monolith. Also compares the VpcId a template would actually resolve to rather than the raw property. createSecurityGroup resolves an omitted VpcId to the region's default VPC, so the stored group always has one - comparing against a null property let a template that drops VpcId keep a group in the VPC it had named. Adds anUpdateLeavesRulesOwnedByStandaloneResourcesAlone. Verified non-vacuous: restoring the revoke fails it with the standalone rule gone. * fix(cloudformation): branch AWS::EC2::VPC on the context's prior id provision() serves create and update, and assigns the new physical id onto the resource as it runs, so deciding create-vs-update by reading that id back flips mid-method. AGENTS.md step 4 asks for ctx.isUpdate()/ctx.priorPhysicalId() instead, and the Scheduler provisioner shed the same pattern in #2985. The two agree on today's call path, since the engine seeds both from the same existing id, so this is the convention rather than a live defect. The test was the part that had it wrong: it built a create-path context and set the prior id only on the resource, so it passed either way. Pinned by anIdOnTheResourceAloneDoesNotCountAsAnUpdate, which provisions a resource carrying an id under a create context and fails when the VPC is looked up for reuse instead of created. * fix(cloudformation): match a security group rule that names its peer A rule naming its peer through SourceSecurityGroupName was re-authorized on every update. Ec2Service.resolveGroupReferences fills in groupId on the pair as it records the rule, the declaration toIpPermission hands back on the next pass carries only the name, and the duplicate key preferred the id whenever one was present, so the two forms never matched and the group accumulated another copy of the rule each time. Both sides now resolve a bare name to its group id before keying, the same lookup the service performs, confined to the group's own VPC because names are unique per VPC. A name matching nothing there stays a name, which is also what the service does, so an unresolvable peer still compares equal to itself. Pinned by aRuleNamingItsPeerByNameIsNotDuplicatedByAnUpdate, which reports the rule twice when the resolution is dropped. Its DependsOn is load-bearing: the peer has to exist when the rule is first authorized, or the stored pair keeps the unresolved name and both sides agree for the wrong reason. Also moves a doc comment back onto the test it describes. * test(cloudformation): parse the describe body with XmlParser The physical-id helper pulled LogicalResourceId/PhysicalResourceId pairs out of the DescribeStackResources response with a regex, which the repo rules forbid for XML. extractGroups on "member" gives the same pairs as a map per resource, so the member is picked by its logical id rather than by matching across tags. |
||
|
|
cf1aabce39 |
feat(ec2): back each VPC with a real Docker network in RFC 1918 space (#3272)
* 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. |
||
|
|
4cb9314a2d |
fix(dynamodb): read every attribute through an ALL-projection index in PartiQL (#3309)
A PartiQL read qualified with a secondary index trimmed each item to the attributes the index projects, but projectedAttributeNames returns only key attributes for an ALL projection, because "all attributes" cannot be enumerated from a schemaless table. Query, Scan and the selection validator each guard that case with "ALL".equals(projectionType); the PartiQL read path did not. Against an index that stores the whole item, a qualified SELECT * therefore dropped every non-key attribute, and naming one explicitly was rejected with "does not project". Both are wrong data rather than an error, and both disappear on the same statement against the base table. The existing coverage used only INCLUDE and KEYS_ONLY indexes, so neither case surfaced. The integration test adds an ALL-projection index and asserts SELECT *, an explicit non-key column, and Query over the same index agreeing; the INCLUDE and KEYS_ONLY expectations are unchanged. |
||
|
|
2fbe2b7c64 |
fix(ec2): generate real key material in CreateKeyPair and fingerprint imported keys (#3307)
* fix(ec2): generate real key material in CreateKeyPair
CreateKeyPair returned a fixed string literal as KeyMaterial:
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA0Z3VS5JJcds3xHn/ygWep4Ib/ue7YiKbCIZgYpYDe0+FAKE
-----END RSA PRIVATE KEY-----
That is a 63-character body -- a placeholder, not a truncated key. It does
not parse:
$ ssh-keygen -y -f key.pem
Load key "key.pem": invalid format
and it was byte-identical for every key pair in every region. No public
half was stored either, so Ec2ContainerManager.injectSshKey() had nothing
to write to authorized_keys for a created key.
The AWS API reference for CreateKeyPair describes the response as "an
unencrypted PEM encoded RSA or ED25519 private key", with KeyFingerprint
being "the SHA-1 digest of the DER encoded private key" for a key pair AWS
created. This is the only call that ever discloses the private key, and
callers are expected to use it directly: the Packer amazon-ebs builder
creates a temporary key pair, writes the returned material to a file, and
SSHes in with it. A placeholder cannot serve that, so no Packer build --
and no test that SSHes into an instance -- could work.
Generates a real 2048-bit RSA key pair (the size and type AWS uses for the
default KeyType=rsa), returns it as a PKCS#1 "BEGIN RSA PRIVATE KEY" PEM to
match AWS's encoding rather than Java's native PKCS#8, stores the matching
OpenSSH public key so injection has something to inject, and reports a real
SHA-1 fingerprint. KeyPairGenerator is already used this way in KmsService,
CognitoService and EksOidcService, and bcpkix is already a dependency.
ImportKeyPair reported the same constant fingerprint for every key. It now
reports the MD5 of the DER public key, which is what AWS reports for
imported keys. Only ssh-rsa is decoded back to a SubjectPublicKeyInfo; for
other key types the digest is taken over the wire-format blob, which is
stable and distinct per key but not byte-identical to AWS. Material that
does not parse yields no fingerprint rather than a digest of garbage, and
the caller falls back to the old placeholder.
Tests parse and use the material rather than pattern-matching it -- the
original literal would satisfy any shape check, which is how it survived.
They assert the PEM parses as a 2048-bit RSA key, that the emitted public
key is genuinely the other half of the returned private key, that distinct
calls yield distinct keys, that the OpenSSH length-prefix framing round
trips, and that an imported key's fingerprint ignores the trailing comment.
Related: the SSH path is also blocked by sshd never starting; see the
companion fix for Ec2ContainerManager.startSshd().
* test(ec2): cover the CreateKeyPair and ImportKeyPair wiring
Ec2KeyMaterialTest exercises the generator directly, so reverting the Ec2Service
side of the change left the whole EC2 suite green: 821 tests passed with
createKeyPair still handing out the placeholder literal. The production wiring
was the part with no coverage.
These two go through Ec2Service. The first parses what createKeyPair returns
rather than matching its shape, since the placeholder was a well formed PEM
envelope around 63 bytes and satisfied any pattern check, and asserts the public
half is stored, because that is what RunInstances injects into authorized_keys.
The second asserts two imported keys get different fingerprints, which the old
constant could not.
With the Ec2Service change reverted these fail as
"malformed PEM data: unable to decode base64 string: Index 63 out of bounds for
length 63" and "expected: not equal but was:
<00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00>".
* fix(ec2): bound imported key blob fields and fingerprint ed25519 as AWS does
Two problems in the ImportKeyPair path, both reachable with caller supplied
PublicKeyMaterial.
SshReader.readBytes allocated an array sized by a length read straight out of
the blob, and only then checked that the bytes were there. An eleven byte
request could declare a two gigabyte field, and the resulting OutOfMemoryError
is an Error, so the catch inside fingerprintOf did not contain it. The declared
length is now rejected before it is allocated when it is negative, larger than
what remains in the buffer, or over an absolute ceiling of 64 KiB. Bounding by
the remainder ties the allocation to the size of the request that carried it.
ed25519 imports were fingerprinted with MD5 over the wire blob. EC2 reports the
base64 encoded SHA-256 digest for ed25519 key pairs however they were created,
which is the ssh-keygen value without its SHA256: prefix and with the base64
padding kept.
The RSA import path is unchanged and was already right: AWS documents the check
as "openssl rsa -pubout -outform DER | openssl md5 -c", which is MD5 over the
DER SubjectPublicKeyInfo rather than over the SSH blob, and that is what
RSAPublicKey.getEncoded produces.
The existing fingerprint tests asserted digest shape, or compared the service
against the same helper it calls, so neither could see a wrong scheme. The new
ones pin both key types to values derived outside this codebase from fixed
throwaway keys, and assert the RSA value is not the MD5 of the SSH blob, which
is the scheme it could plausibly be confused with.
Refs: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/verify-keys.html
|
||
|
|
a339f3ae70 |
docs(lambda): correct the FunctionName charset claim in CodeStore (#3310)
The Javadoc on getVersionsPath, and the matching comment in CodeStoreTest, say floci "does not restrict the character set of FunctionName today, only that it is non-blank". That is wrong. LambdaArnUtils.validateName has validated the name since #450, against [a-zA-Z0-9-_.]+ with a 256 character ceiling. The conclusion both comments draw is unaffected: a dot is an accepted character, so "foo.v1" really is a function a user can create, and it really would have collided with a "<name>.v<n>" sibling directory. Only the stated reason was wrong, and it misdescribes the validation a reader would go on to look for. Both now name the actual pattern and point at #3238, which tracks the divergence from the live service. Comments only. No behaviour change. Refs #3238 |
||
|
|
b988dc5d1a |
feat(athena): support ListTagsForResource for workgroups (#3242)
* 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. |
||
|
|
d466ffe099 |
fix(s3): preserve SSE-KMS key ID metadata (#2145)
* 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> |
||
|
|
42bc0d934f |
fix(ecs): reconcile services in every account, not just the default one (#3297)
* fix(ecs): reconcile services in every account, not just the default one The reconciler is scheduled on a plain ScheduledExecutorService, so its thread has no active request scope. Every account-aware storage read inside it therefore resolves to the default account: AccountAwareStorageBackend falls back to defaultAccountId when it catches ContextNotActiveException. reconcileServices() iterates services.entrySet(), so it only ever saw the default account's services, and the services.put write-back in reconcileService landed in the default account too. A service created in any other account stayed at runningCount 0 forever with nothing logged, while the same service in the default account converged in about ten seconds. IaC hangs rather than fails on this, because aws_ecs_service with wait_for_steady_state polls until runningCount reaches desiredCount. Enumerate the accounts that own a service through AccountAwareStorageBackend.scanAllAccountEntries, then run each tick inside RequestScopes.runAs for that account. That helper exists for this case and its javadoc says so, and CurEmissionScheduler, AslExecutor and CloudFormationService already use it. The default account is always included, so single-account behaviour is unchanged, and the existing reconcile logic is reused as is. Each account's work is also guarded. scheduleAtFixedRate silently stops every future execution if the task throws, so one account's failure must not kill reconciliation for the rest or for the process. Fixes #3296. Verified: 1. EcsReconcilerMultiAccountTest moves a service to a non-default account and asserts the reconciler still places its task. It fails without the change (expected 1, was 0). EcsReconcileTickResilienceTest covers the guard. Full ECS suite green, 191 tests. 2. End to end against the real pulumi-aws v5 provider. An aws_ecs_service with wait_for_steady_state in account 000000000001 hung for the full 600s timeout before the change and reaches steady state in 16s after it. * fix(ecs): attribute each reconciled task to the account in its ARN reconcileTasks iterates taskHandles, which is a single in-memory map shared by every account, so running it inside the per-account loop reconciled every task once per account. Whichever account ticked first could claim a task whose containers had exited, leaving the owning account's runningTasksCount stale and emitting the STOPPED event on the wrong bus. Reconcile tasks once and scope each task to the account in its own ARN; only service reconciliation loops over accounts now. * fix(ecs): log task ARNs the reconciler cannot attribute to an account |
||
|
|
35159c5aaa |
fix(stepfunctions): persist execution history across restarts (#3291)
* 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 |
||
|
|
d3530d90c9 |
fix(cloudtrail): bound log flush memory (#3293)
* fix(cloudtrail): bound log flush memory Drain pending records in bounded batches and stream JSON directly into gzip while preserving event order on retries. * fix(cloudtrail): drain flush backlogs safely (#3293) * fix(cloudtrail): clean up flush locks (#3293) * chore: retrigger CI * fix(iot): tolerate closed clients during shutdown |
||
|
|
47d96f619f | fix(appconfigdata): return empty payload on repeat polls (#3295) | ||
|
|
520568ef93 |
fix(sqs): bound message move task history (#3292)
* fix(sqs): bound message move task history * test(cloudtrail): isolate scheduled flush in integration test |
||
|
|
4d199b144e |
fix(dynamodb): add missing request validation (#3287)
* fix(dynamodb): add missing request validation for AWS parity - CreateTable rejects PAY_PER_REQUEST with ProvisionedThroughput - an INCLUDE projection without NonKeyAttributes on a GSI or LSI - a non INCLUDE projection carrying NonKeyAttributes - a StreamSpecification with StreamEnabled false plus a StreamViewType - Scan rejects TotalSegments above 1000000 - UpdateItem rejects ExpressionAttributeNames or Values supplied with no expression - a SET through a missing intermediate map path. * fix(dynamodb): validate GSI projection on UpdateTable create UpdateTable accepted an INCLUDE projection without NonKeyAttributes and a non INCLUDE projection carrying NonKeyAttributes. Real DynamoDB rejects both with the same message as CreateTable, and it does so before the table lookup. * fix(dynamodb): reject an empty NonKeyAttributes list on index projections An empty NonKeyAttributes array was accepted on CreateTable and UpdateTable index projections. Real DynamoDB rejects it with a length constraint on the 1-based member path, before the projection type check, and treats a null NonKeyAttributes as not specified. |
||
|
|
9fa36e9741 |
fix(sfn): apply state input and output paths (#3289)
* fix(sfn): apply state input and output paths Fixes #3258 Signed-off-by: 7487 <1042653432@qq.com> * test(sfn): cover default and parallel output paths Signed-off-by: 7487 <1042653432@qq.com> --------- Signed-off-by: 7487 <1042653432@qq.com> |
||
|
|
895adce214 |
fix(cloudformation): provision CloudFront policies and origin access controls (#3228)
* 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. |
||
|
|
3218d2404e |
refactor(cloudformation): move the Events types into EventsCfnProvisioner (#3286)
* refactor(cloudformation): move the Events types into a per-service provisioner AWS::Events::Rule, EventBus and EventBusPolicy move out of the legacy monolith into EventsCfnProvisioner, continuing the decomposition. The block was already contiguous and self-contained: 18 methods and five constants, none of them referenced from outside, and EventBridgeService was the monolith's only user, so the field, its constructor parameter and both imports go too. Behaviour preserving. The event bus arm in particular already carried real logic worth keeping intact: rollback ownership, the created-time check that refuses to delete a bus recreated out of band, managed tag and policy tracking, and the rejection of an unsupported mutable update. All of it moves unchanged. Rule and EventBus were listed in DELETE_NEEDS_STACK_RESOURCE because deleting them needs stored attributes rather than the physical id alone: a rule remembers the custom bus it lives on, and a bus remembers the creation time proving the stack still owns it. That logic moves into the provisioner's delete(StackResource, String) override and both entries leave the set, which is what CfnDeletePrecedenceTest gates. EventBusPolicy keeps the id-only form, its composite busName|statementId id being enough. The four existing Events test classes needed no changes: they build the provisioner through CfnProvisionerFixture, so wiring the new provisioner there is all it took for them to exercise it. 40 tests across them still pass, and the schema-coverage gate finds no new attribute gaps. Monolith 6,457 to 5,954 lines, legacy types 47 to 44. * fix(cloudformation): keep an Events rule's identity and targets across an update provision runs again on every UpdateStack, and the rule arm got both halves of that wrong. An unnamed rule generated a fresh physical name each time, so the second update created a second rule and left the first behind, still matching events and still delivering to its targets. Name is createOnly and a rule's physical id is its name, so ctx.stablePhysicalName applies directly here, unlike the Batch types whose physical id is an ARN and which need the name read from a stored attribute. Targets were never driven to the template's desired state. PutTargets upserts by id and removes nothing, so a target dropped from the template stayed on the rule and kept receiving events indefinitely. The desired set is now reconciled after the put, which also covers a template that declares no Targets at all: that means no targets, so the sweep runs either way. The Targets property is checked for being an array before it is iterated. Five unit tests: an unnamed rule keeping its name, an explicit name still winning, a dropped target being removed, a cleared Targets list removing all of them, and an unchanged set removing nothing. * fix(cloudformation): surface a failed Events policy removal instead of hiding it Deleting an AWS::Events::EventBusPolicy wrapped the whole removal in a bare catch (Exception) that logged at debug and returned. Every failure was hidden: the statement stayed on the bus while the stack reported DELETE_COMPLETE, which is the outcome AGENTS.md rules out for deletes, since a real failure has to reach the stack as DELETE_FAILED. RemovePermission distinguishes its failures, unlike the Batch services where a single ClientException covers everything. It raises ResourceNotFoundException both when the bus is gone and when the statement is not on it, and those are the two cases that genuinely mean "already deleted". So the removal now goes through the shared CfnDeletes.safeDelete tolerating only that code, and anything else, a malformed statement id for instance, propagates. Two unit tests: an already-gone statement counting as deleted, and a ValidationException reaching the caller rather than being swallowed. * fix(cloudformation): drop the em dash from the moved Events javadoc The javadoc came across from CloudFormationResourceProvisioner verbatim. That file holds 30 em dashes but is an existing file, and the doc-style gate only scans the files a PR adds, so moving the prose into a new file is what surfaced a violation that was always there. * fix(cloudformation): read the prior event bus id from the provision context provision serves create and update, and it assigns the new physical id as it runs, so a resource-derived identity check can flip mid-method. The moved code read the prior bus name off the resource. It was captured before the assignment so the behaviour was right, but the convention exists precisely so the next edit cannot quietly break it. * fix(cloudformation): validate the Events policy StatementId The registry schema for AWS::Events::EventBusPolicy and the botocore model agree that StatementId is [a-zA-Z0-9-_]+, 1 to 64 characters, but nothing checked it, so an AWS-invalid value was accepted. It also made the physical id ambiguous. This provisioner keys a policy statement as "<bus name>|<statement id>" and the delete splits on the last separator. Neither the modeled bus-name pattern nor the statement-id one admits a pipe, so holding the value to the model closes that at source rather than by guessing at the split. * fix(cloudformation): restore rule targets when a stack update rolls back The reconciliation sweep this branch added can delete a live target, which nothing could put back: without a rollbackUpdate hook the resource fell to "Rollback is not implemented for AWS::Events::Rule", so a failed stack update left the rule no longer delivering to it and the stack reported UPDATE_ROLLBACK_FAILED. Before the sweep, targets were only ever upserted and there was nothing to restore. Snapshot the rule's targets before the first target call of an update and put them back on failure, following PipesCfnProvisioner: the snapshot is spent by whichever end the update reaches, restoring inside provision when this rule's own reconciliation failed and through rollbackUpdate when a later resource did. The restore is exact rather than additive, so a target the failed update added does not survive it. A restore that fails itself is recorded on the resource instead of thrown, so the stack reports the original failure. The snapshot carries the rule name, its bus and the region because the rollback hook is handed the stack resource alone, and a rule on a custom bus is keyed by that bus. This restores targets, not the rule's own properties, which putRule overwrites on the same path. That gap predates this branch. * refactor(cloudformation): hold the Events provisioner to a single injected service AGENTS.md requires a CloudFormation provisioner to inject only the service it wraps. This one also took an ObjectMapper, carried over from PipesCfnProvisioner when its rollback snapshot was modelled on that class. The package already has a second convention for exactly this job, and it is the one that satisfies the rule: LambdaEventInvokeConfigCfnProvisioner, the other snapshot-based rollback provisioner, holds a private static mapper and injects only its service, as do LambdaEventSourceMappingCfnProvisioner, Ec2NetworkCfnProvisioner and ReplacementCleanup. The configured mapper adds a 100 MB string limit and lenient empty-bean serialization. Neither reaches this code: EventBridge caps a bus policy near 10 KB and a target's Input at 8192 characters, both far under Jackson's default, and every type serialized here has real properties. No behaviour changes, so the existing tests are what prove the swap is inert. |
||
|
|
c4027bbf54 |
feat(iot): MQTT over WebSocket at /mqtt (#3150)
* 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 |
||
|
|
006f3c77c9 |
fix(cloudfront): echo OriginSslProtocols and round-trip legacy cache behavior fields (#3182)
A custom origin's OriginSslProtocols was dropped from the GetDistribution and CreateDistribution response. The AWS provider flattens CustomOriginConfig.OriginSslProtocols.Items with no nil guard, so the missing object segfaults it on the read that runs at the end of create. The legacy forwarded_values cache-behavior path lost more than that. Track it alongside the crash fix since both are the same read-back gap: 1. CustomOriginConfig now echoes OriginSslProtocols, round-tripping the submitted protocols and defaulting to TLSv1.2 when the client sends none. 2. DefaultTTL and MaxTTL were emitted only when greater than 0, so an explicit default_ttl = 0 (the usual "do not cache" with forwarded_values) read back as absent and drifted on every plan. Presence is now tracked separately from the value, so a submitted 0 round-trips and an unsubmitted TTL stays absent. 3. ForwardedValues echoed Headers and QueryStringCacheKeys as a bare Quantity 0 and the parser kept only QueryString and Cookies.Forward, so whitelisted headers, query-string cache keys and cookie names came back empty. All three now round-trip as Quantity/Items pairs, scoped so the shared Name element lands in the right block. 4. Both cache behaviors also round-trip ForwardedValues, SmoothStreaming and FieldLevelEncryptionId. Fixes #3208. Verified: 1. CloudFrontControllerTest gains tests that fail without the change and pass with it: OriginSslProtocols is present and round-trips, an explicit DefaultTTL of 0 survives the read-back, an unsubmitted TTL stays absent, and whitelisted headers, query-string cache keys and cookie names round-trip. Full CloudFront suite green, 181 tests. 2. End to end against the real pulumi-aws v5 provider. A distribution with a custom origin, defaultTtl 0 and whitelisted headers and cookies creates, reads back with no segfault, and destroys clean. The same run panics in flattenDistributionConfig before the change. |
||
|
|
64538f7d32 |
feat(iam): resolve resource and request tag condition keys for EC2 and S3 (#3212)
* 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. |
||
|
|
5b7c2c4a62 |
feat(cloudwatch): store and serve metric stream definitions (#3214)
* 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. |
||
|
|
f77cf4da77 | fix(ec2,ssm): explain missing IMDS registration for SSM-only managed instances (#3283) | ||
|
|
f30ba77ac0 |
fix(ec2): answer DescribeTransitGatewayConnects with an empty list (#3274)
* fix(ec2): answer DescribeTransitGatewayConnects with an empty list LZA's tgw-associations-and-propagations module calls this unconditionally alongside DescribeTransitGatewayVpcAttachments. floci does not yet support creating Connect attachments, so the action was entirely unhandled and the module failed with "Operation DescribeTransitGatewayConnects is not supported", found while running LZA phase2 against parent 1176. Since floci has no Connect attachments to return, an empty list is the wire-faithful answer for every account. Requested attachment ids still validate against the shared tgw-attach- id namespace: malformed ids reuse the existing InvalidTransitGatewayAttachmentID.Malformed check, well-formed but unknown ids get InvalidTransitGatewayConnectID.NotFound. * test(ec2): cover DescribeTransitGatewayConnects over the Query protocol and make the service hook void The service method only validates the request; the handler always renders an empty transitGatewayConnectSet, so returning a List of VPC attachments suggested a resource type it never produces. It is void now. Two integration tests drive the action through the EC2 Query dispatch and pin the response wire shape (EC2 namespace, requestId, empty transitGatewayConnectSet) and the Malformed / Connect NotFound error codes. |
||
|
|
c57b8ff5f6 |
fix(apigateway): report rootResourceId and the API key defaults (#3269)
* fix(apigateway): report rootResourceId and the API key defaults
GetRestApi, CreateRestApi and GetRestApis returned only id, name, description,
createdDate, apiStatus, tags and endpointConfiguration. Three documented response
members were missing. None of them is ever supplied by the caller, so a client has
no way to obtain them other than from the response.
rootResourceId is the most load bearing. The root resource is created with the API
and is already reachable through GetResources, it was just not reported on the API
itself -- which is where a client reads it in order to parent its first resource:
resource "aws_api_gateway_resource" "hello" {
rest_api_id = aws_api_gateway_rest_api.api.id
parent_id = aws_api_gateway_rest_api.api.root_resource_id # was empty
path_part = "hello"
}
apiKeySource and disableExecuteApiEndpoint are reported with the AWS defaults,
HEADER and false. Neither is settable on a REST API here: createRestApi ignores
both and updateRestApi patches only /name and /description, so the emulated value
is always the default. Reporting it beats omitting it, because a client that reads
an absent member back as "" or null sees a difference from the configuration it
just sent and never converges.
Reference: the GetRestApi response syntax and elements, including the sample
response carrying "rootResourceId" --
https://docs.aws.amazon.com/apigateway/latest/api/API_GetRestApi.html
apiKeySource is documented there with valid values HEADER | AUTHORIZER.
Tests assert that the reported rootResourceId is the same id GetResources gives the
"/" resource, and that a resource can actually be created against it.
* fix(apigateway): refuse to delete the root resource of a REST API
Reporting rootResourceId on the API only holds up if the resource at "/" is
still there. deleteResource had no guard, so a caller could delete the root and
leave the API with nothing to report and nothing to parent a new resource on,
a state with no way back short of recreating the API.
The root is created with the API and has no pathPart to address it by; it goes
away when the API does, via deleteRestApi, which cascades through the store and
is unaffected by this. putRestApi already skipped "/" when clearing resources.
The botocore model shipped with awscli 2.36.30 (apigateway/2015-07-09) lists
BadRequestException, httpStatusCode 400, among the errors of DeleteResource,
which settles the error type for a delete the service refuses to carry out. It
does not document the root-resource case either way, so the refusal itself is a
deliberate choice for the reason above rather than verified AWS parity, and the
message is descriptive rather than copied from AWS.
* fix(apigateway): let a vanished API cost only its rootResourceId
ListRestApis renders a snapshot of the APIs and resolves each one's root
afterwards, and that lookup read the API's resources, whose first act is to load
the API itself. An API deleted between the snapshot and the render was therefore
already gone by the time its root was looked up, and the NotFoundException it
raised turned the whole listing into a 404 rather than costing the caller one
member of one item.
The lookup moves into ApiGatewayService.findRootResourceId, which returns an
empty Optional for an API that is no longer there. The tolerance is narrow: only
NotFoundException is caught, every other AwsException still propagates, and
GetRestApi on a missing API is still a 404 because it loads the API directly.
|
||
|
|
922eb0b9e5 |
fix(acm): reflect the requested ValidationDomain in DescribeCertificate (#3264)
* fix(acm): reflect the requested ValidationDomain in DescribeCertificate RequestCertificate ignored DomainValidationOptions entirely: the handler never read the field, and generateDomainValidation hardcoded ValidationDomain to the certificate domain. A caller that asked for ValidationDomain=db.de read back the FQDN and could not tell whether the request was accepted as sent, even though the value decides which mailboxes may approve the certificate. Carry the requested ValidationDomain per DomainName through to the stored DomainValidation, and reject the entries AWS rejects: a DomainName that is not part of the request, and a ValidationDomain that is neither the domain itself nor one of its superdomains. That superdomain rule already backed ResendValidationEmail, so it moves to a shared helper rather than being written twice. Domains with no requested entry keep validating against themselves, which is what AWS reports when the caller supplies nothing. * fix(acm): reject incomplete DomainValidationOptions entries Both DomainName and ValidationDomain are required members of DomainValidationOption, but the parser skipped an entry missing either one, so RequestCertificate returned 200 and the domain quietly fell back to validating against itself. Reject those entries with the same InvalidDomainValidationOptionsException the other bad entries already get. Also brace the array guard, per the repository style rule. |
||
|
|
141b15939f |
fix(firehose): isolate streams by account and region (#3267)
* fix(firehose): isolate streams by account and region * test(firehose): preserve default owner resolution * fix(firehose): migrate owner-scoped state and source reads * fix(firehose): avoid ambiguous legacy checkpoints |
||
|
|
8e10fd1ea6 |
fix(ram): enforce resource share principal visibility (#3266)
* fix(ram): enforce resource share principal visibility * fix(ram): restrict resource share visibility * fix(ram): handle reassociated invitations |
||
|
|
290559cff0 |
fix(lambda): scope extracted function code by region (#3265)
* fix(lambda): scope extracted function code by region * fix(lambda): isolate new paths from legacy code * chore(ci): retry transient pull request checks |
||
|
|
e02accff4a |
fix(memorydb): scope resources by account and region (#3261)
* fix(memorydb): scope resources by account and region * fix(memorydb): migrate legacy records during scans |
||
|
|
496b376da1 |
fix(ec2): nest cidrBlockState in AssociateVpcCidrBlock response (#3243)
AssociateVpcCidrBlock returned cidrBlockState as a bare string instead of the nested <state> element that DescribeVpcs already returns for the same association. terraform-provider-aws's SDK waiter for aws_vpc_ipv4_cidr_block_association parses the nested shape, so it never observed a valid state and polled DescribeVpcs until giving up, hanging `terraform apply` on any secondary_cidr_blocks entry. Fixes #3241 |
||
|
|
eb3a6b23ef |
fix(ec2): match cidr-block-association filters on DescribeVpcs (#3257)
DescribeVpcs silently ignored the cidr-block-association.* and ipv6-cidr-block-association.* filters: unrecognized filter names fell through matchesFilter's default -> true, so every VPC in the account matched regardless of the requested association. terraform-provider-aws's waiter for aws_vpc_ipv4_cidr_block_association polls DescribeVpcs filtered by cidr-block-association.association-id and asserts exactly one VPC comes back. With more than one VPC in the account that assertion failed with a too-many-results error, which the SDK's retry machinery treats as not-found-yet rather than a fatal error, so the waiter retried until its create timeout, hanging terraform apply on any secondary_cidr_blocks entry. Fixes #3256 |
||
|
|
f4954dec02 |
fix(dynamodb): word BatchWriteItem key rejections the way AWS does (#3227)
* fix(dynamodb): word BatchWriteItem key rejections the way AWS does A key value can arrive on three surfaces, and AWS words the rejection differently on each. The boolean that told a Key argument from a PutItem item body is now an enum with a third value for BatchWriteItem. BatchWriteItem reports a schema mismatch rather than naming the types, and uses the "are not valid." form for an empty key value. PutItem and TransactWriteItems keep the "Type mismatch for key" form. An empty binary key value is now rejected on every surface. It was accepted before, where the empty string was already rejected. * fix(dynamodb): report a missing BatchWriteItem key as a schema mismatch * fix(dynamodb): use the same empty string key wording on every surface |
||
|
|
67198c7064 |
fix(elasticache): honor the requested Port on CreateReplicationGroup (#3276)
* fix(elasticache): honor the requested Port on CreateReplicationGroup
Port is a modeled optional input on CreateReplicationGroup ("the port number
on which each member of the replication group accepts connections"), but
allocateProxyPort took no argument and always handed out the next free port
from the base of the range. A caller that pinned a port read back a different
one, which Terraform reports as a replacement-forcing change and therefore as
permanent drift.
allocateProxyPort now takes the requested port and honors it when it is free
and inside the proxy range, matching NeptuneService.allocateProxyPort. Floci
multiplexes every group's proxy onto one host, so two groups genuinely cannot
share a port; when the requested one is taken or out of range this logs why
and falls back to the next free port rather than failing the create. In
cluster mode only the first node can take the requested port, because the
group reports its port from that node.
The compatibility fixtures pinned 6379, the bottom of the range and the port
floci would have allocated anyway, so they asserted nothing and passed by
coincidence. They now pin 6395, which fails without this fix.
* fix(elasticache): refuse a requested Port that cannot be honored
Honoring Port left one path that quietly ignored it: a requested port that was
already held by another replication group, or outside the range this emulator
serves, fell back to the next free one. The describe then reported the allocated
port, so a caller who pinned one still read back a different value and still saw
the replacement-forcing drift that honoring Port exists to remove. The narrower
case reproduced the bug the change was written to fix.
The fallback could only ever hit a caller who did ask for a port, since one who
does not care passes no Port at all and never reaches that branch, so it served
nobody. An explicit port is now either honored or refused with
InvalidParameterValue, the sender fault CreateReplicationGroup declares, naming
the port and the reason so the caller can pick another. Unpinned creates still
scan the range exactly as before, and the restore path for persisted groups is
unaffected because it asks for no particular port.
The two tests that pinned the old fallback are inverted rather than dropped, so
the new contract is held just as firmly, and one more proves an unpinned create
still falls back when the base port is taken.
NeptuneService.allocateProxyPort carries the same substitution and RdsService
ignores a requested port entirely; both are left for their own changes.
Raised by the review on this PR.
|