Commit Graph
3835 Commits
Author SHA1 Message Date
TATSUNO “Taz” Yasuhiro 0492fc9842 feat(lambdaweb): CloudFormation types for Lambda Web Functions (#5722)
* feat(lambdaweb): CloudFormation types for Lambda Web Functions

AWS::Lambda::WebFunction, AWS::Lambda::WebFunctionRevision and
AWS::Lambda::WebFunctionEndpoint provision through the resource
registry. Ref of each is its ARN. Every property of a revision is
createOnly in the registry schema, so a changed revision mints a new one
and the displaced revision is deleted once the update commits. An
endpoint keeps its identity while its function, name, type and regions
stay the same. Fn::GetAtt on RegionalEndpoints is recorded as a gap.

Part of #5699

* fix(lambdaweb): compare a revision against the function's default log group

revisionMatches filled a request without a log group with the existing
revision's log group, so a template that dropped a custom log group kept
the old revision. The default is the function's log group, as when a
revision is created. replaceTags returns the updated function.

* fix(cloudformation): put a Lambda Web function or endpoint back after a failed stack update

A function's tags and an endpoint's mutable configuration are changed in
place on update. The provisioner now snapshots them before the change and
restores them from rollbackUpdate, as the other in-place provisioners do.
The function attributes after a tag update come from the updated
function, so UpdatedAt moves with the tag change.

* test(cloudformation): roll a Lambda Web stack update back after a failed revision

A revision that fails to create after the endpoint moved to a replaced
revision rolls the stack back. The endpoint returns to the kept revision
and the replacement is deleted. The doc page says that a CloudFormation
endpoint is always Disabled with RevisionWeights, since the schema has no
AutoDeploymentMode, and that a failed update puts in-place changes back.

* fix(cloudformation): refuse AutoDeploymentMode on a Lambda Web endpoint

The registry schema has no AutoDeploymentMode property and AWS fails a
template that sets it at validation. An endpoint from CloudFormation is
always Disabled and routes by RevisionWeights. Floci passed the property
through to the service, which accepted LatestRevision.

* refactor(lambdaweb): share the create and tag steps between the API and CloudFormation paths

createFunction and createFunctionShell both check the name and refuse a
duplicate under the function's lock. tagResource and replaceTags both
check the tags, lock, write, stamp and persist. Each pair now calls one
private helper, so the two paths cannot drift.
2026-10-15 19:02:50 -04:00
Matheus Oliveira 01cc020419 refactor(account): share the alternate-contact not-found exception (#5755)
getAlternateContact and deleteAlternateContact each built the same
ResourceNotFoundException. Move it into a notFound() helper next to
validation() so the two stay in step.

Follow-up to #5560.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-15 18:59:10 -04:00
Jackson Price 945f5d3995 fix(cloudformation): restore SSM parameters on failed updates (#5752)
A stack update that changed an AWS::SSM::Parameter and then failed on a
later resource ended in UPDATE_ROLLBACK_FAILED with the new value left
in place: the provisioner had no rollback.

An update that keeps the name now keeps the parameter's value, settings
and managed tags before it writes, and the rollback writes them back as
a new version unless the parameter still holds them. A changed Name
creates the replacement and leaves the displaced parameter to the
shared ReplacementCleanup record: a committed rename deletes it unless
UpdateReplacePolicy is Retain, a rollback deletes the replacement, and
ContinueUpdateRollback retries a restore or delete that failed. A
snapshot is spent when the update commits, and one a skipped rollback
left is dropped when the next update starts.

A create or replacement is one PutParameter without overwrite that
carries the tags, as AWS's handler sends it, so a name held outside the
stack fails the resource instead of being overwritten or adopted; a
dispatcher stub's id is taken over by a create. As AWS's handler checks
that the parameter exists before an update writes it, a parameter
deleted outside the stack fails the update in place, and a rollback
that finds it gone, with ParameterNotFound. A delete treats
ParameterNotFound as already deleted.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-15 18:27:31 -04:00
Matheus Oliveira 9174147cb6 fix(account): implement DeleteAlternateContact (#5560)
* fix(account): implement DeleteAlternateContact

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* docs(account): document DeleteAlternateContact

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-15 18:02:19 -04:00
Jackson Price ad8fba7f45 fix(cloudformation): evaluate conditions with intrinsics, require parameter values (#5737)
* fix(cloudformation): require a value for every declared parameter

CreateStack, UpdateStack and CreateChangeSet accepted a template that
declares a parameter with no Default when the request gave it no value.
The stack deployed with the parameter unset: a condition compared it as
an empty string, and a Ref resolved to the parameter's own name.

Such a request now fails with ValidationError "Parameters: [Env] must
have values", naming every such parameter in declaration order, before
the SAM transform and the dependency preflight run and before any stack
state changes. An empty value counts as a value. An update does not
carry values over, so it needs a value or UsePreviousValue, which keeps
the deployed one, for each parameter without a Default.
UsePreviousValue on a parameter with no deployed value passes none,
rather than an empty string. A request its stack refuses outright, an
update of a stack that is missing or cannot be updated or a create over
a name in use, still gets that refusal. A parameter that an AWS::Include
defines, which only execution merges, is not checked up front.

The same check refuses CreateStackSet and UpdateStackSet, before the
stack set changes or an operation is recorded. UpdateStackSet resolves
UsePreviousValue against the previous template's Defaults too, since a
stack set keeps only the values it was given. A nested stack resource
whose Parameters leave a child parameter without a value fails, before
the child is created or changed. Those Parameters now resolve as a
property value: an Fn::If may choose the whole map, and an AWS::NoValue
value passes nothing.

A CreateStackInstances whose targets cannot be resolved, or whose
change set is refused, now ends its operation FAILED. Left RUNNING, it
refused every later operation on the stack set.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(cloudformation): evaluate conditions through the template engine

Conditions resolved only a bare Ref, and only to a parameter, the
account or the region. Every function other than that Ref compared as
an empty string inside Fn::Equals: Fn::FindInMap, a Ref to
AWS::StackName or AWS::StackId, Fn::Join. A condition on a mapped value
or on the stack's own name was decided wrongly, so the wrong resources,
or none, were created.

The operands now resolve through the template engine, with the
template's Mappings and the stack's name and id. The change-set preview
and the dependency preflight evaluate against the stack too: the live
one an update targets, or the name a create takes, whose id does not
exist yet. An operand the engine cannot resolve compares as an empty
string, as every function did before, so a template that evaluated then
still does. A declared parameter that a stack stored by an older Floci
lacks still compares as an empty string, and AWS::NotificationARNs is
the empty list, now in properties and outputs too.

CloudFormation does not allow Fn::ImportValue in a condition, so a
template being deployed with one there is refused with "Template error:
Cannot use Fn::ImportValue in Conditions.", also in an operand that
evaluation never reaches. A SAM template's change set, or its stack,
fails with that reason instead. A stored template compares the import
as an empty string, so it never blocks an update that supplies a new
template; UsePreviousTemplate checks the stored one as it would a new
one.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(cloudformation): check a create's dependencies with its stack id

A create's dependency preflight evaluated AWS::StackId as an empty
string while the execution used the stack's id, so a dependency on a
resource whose condition reads the stack id could pass the preflight
and then fail the deploy, or the other way round. A create over a name
in use was checked against the stack holding the name instead, and
could get a dependency error rather than AlreadyExistsException.

createChangeSet now allocates the new stack's id before the preflight
and creates the stack with it, so the preflight, the change-set preview
and the execution evaluate the same id. An update, or a create that
attaches to a REVIEW_IN_PROGRESS placeholder, is checked against that
stack as before, and a create over a name in use is checked as the new
stack it asks for.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(cloudformation): place the parameter check before dependency checks

The parameter section said template errors such as a dependency cycle
come first, but createChangeSet checks the parameter values before the
dependency checks, which evaluate conditions that read those values.
Say so, and keep the stack's own refusal ahead of both.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(cloudformation): order the stack's refusal after dependency errors

The previous commit said the stack's own refusal comes ahead of both
the parameter check and the dependency checks. It comes ahead of the
parameter check only: a request its stack refuses still gets a
template's dependency error first, as on main. Say so, and re-wrap the
conditions paragraph.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(cloudformation): say parameter values are checked before dependency errors

The parameter section still read as if a template's dependency errors
came first. createChangeSet checks the parameter values before the
dependency checks, which evaluate conditions that read the values, so
a template with a cycle and a missing value gets the parameter error.
Say that, and that a stack's own refusal replaces the parameter error
but still follows a dependency error.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* test(cloudformation): pin a missing value ahead of a dependency cycle

A template with both a DependsOn cycle and a parameter without a value
gets "Parameters: [Env] must have values" and creates no stack.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* refactor(cloudformation): name the tolerated parse failures ignored

requireParameterValues and parametersWithDefaults return when the
template does not parse, as intended: there is nothing to check or to
add, and the preflight and the execution report the parse error. Name
the caught exception ignored and say why, as AGENTS.md asks.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* refactor(cloudformation): say only execution reports a parse failure

The comment on the ignored parse failure in requireParameterValues
said the preflight reports it too. The dependency preflight skips a
template that does not parse; only executing the change set reports
the error.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-15 16:56:00 -04:00
Robin BaeckmanandRobin Baeckman 8eddae4ed6 fix(ec2): restore and stop the instances of every account (#5103)
Startup restore runs from @PostConstruct and shutdown from a lifecycle
hook, both outside any request, so an account-aware keys() sees only
the default account. Every other account's EC2 state was skipped:

- after a restart its VPCs and subnets were not re-declared, so paths
  that do not declare lazily, such as an EKS node joining its VPC,
  found no network; reconcileOrphans also judged its VPC networks
  against the default account only;
- its instances' private addresses were not re-reserved and their
  IMDS registrations were not restored, so IMDS stopped answering;
- shutdown, and a state reset, which wipes every account, did not stop
  its running instances.

Restore and shutdown now walk every account's VPCs, subnets and
instances. Restore runs each instance as its own account, so the
security groups and prefix lists it resolves come from that account, in
the instance's own region, and both paths write to the owning partition.
VPCs are declared default account first, then in account and key order,
because overlapping CIDRs go to whichever VPC is declared first. The
port-forward persister, which also runs on container executor threads
with no request, writes to the account that holds the instance instead
of the current one, and writes nothing when no account holds it any more
(terminated meanwhile). A pre-multi-account key is migrated once, or
dropped when a scoped copy already exists.

Co-authored-by: Robin Baeckman <27041454+RobinBaeckman@users.noreply.github.com>
2026-10-15 16:52:54 -04:00
David 9cd9002e73 feat(rds): EnableHttpEndpoint, DisableHttpEndpoint and HttpEndpointEnabled (#5736)
* feat(rds): EnableHttpEndpoint, DisableHttpEndpoint and HttpEndpointEnabled

EnableHttpEndpoint and DisableHttpEndpoint answered UnsupportedOperation
and DBCluster carried no HttpEndpointEnabled, so Terraform's
enable_http_endpoint and CDK's enableDataApi never read back what they
set.

Clusters now record the flag and report it. The two actions take the
cluster's ARN and raise ResourceNotFoundFault and
InvalidResourceStateFault as the model lists them; CreateDBCluster,
ModifyDBCluster and the AWS::RDS::DBCluster EnableHttpEndpoint property
set it too. Turning it on is refused for engines other than Aurora
PostgreSQL and Aurora MySQL. The Data API itself does not check the
flag, so existing callers keep working.

Closes #5732

* refactor(rds): one cluster ARN parser, and stricter Data API inputs

clusterForResourceArn repeated the ARN parsing, cluster: prefix and
account and Region check of clusterIdentifierFromArnOrName; both now
call clusterIdFromArn, each raising the error its API documents.

The Data API engine check takes aurora-postgresql, aurora-mysql and the
older aurora name exactly instead of any name starting with aurora, and
the AWS::RDS::DBCluster EnableHttpEndpoint property accepts true or
false only, so a malformed value fails instead of turning the endpoint
off.

* fix(rds): take only aurora-mysql and aurora-postgresql for the Data API

The API reference lists those two engines, and new clusters cannot carry
the bare aurora name, so the check no longer accepts it.
2026-10-15 16:49:23 -04:00
Allen Sanborn a37c27516a feat(route53resolver): implement ListResolverEndpointIpAddresses (#5731)
* feat(route53resolver): implement ListResolverEndpointIpAddresses

The Terraform provider lists an endpoint's IP addresses right after
CreateResolverEndpoint, so the missing operation (UnknownOperationException)
failed every aws_route53_resolver_endpoint create.

Built from the IpAddresses recorded at create time: one ATTACHED entry per
request with a deterministic rni- IpId. Unknown endpoint ids raise
ResourceNotFoundException. Not paginated, like the sibling List operations.

* docs(route53resolver): update service matrix operation count

* refactor(route53resolver): add endpoint IP addresses with a single addAll

* fix(route53resolver): distinct IpIds for repeated entries; fail on missing IP record

ListResolverEndpointIpAddresses hashed only the endpoint id and the entry,
so two identical entries (two addresses in one subnet, both left for AWS to
pick, which IpAddressesRequest allows) shared an IpId. Include the entry's
position in the recorded list, which is normalised once at create and so
stable across reads.

An endpoint whose recorded IP requests are missing returned an empty list
beside a nonzero IpAddressCount. Throw the modeled
InternalServiceErrorException instead.

* test(route53resolver): import List/HashSet instead of fully qualifying (checkstyle NoFqcn)

* fix(route53resolver): return InternalServiceErrorException as HTTP 400

The Route 53 Resolver model gives InternalServiceErrorException no
httpStatusCode, so clients expect the awsJson default of 400, as with
every other Resolver error.
2026-10-15 16:44:58 -04:00
Allen Sanborn 5544a119d3 fix(ec2): ignore NoDevice block device mappings at launch (#5739)
A RunInstances or CreateFleet BlockDeviceMapping with NoDevice set removes
its device regardless of the other values it carries. The root volume type
resolution and the VolumeType validation read Ebs on such entries, so a
request that removed a template's gp3 root still got gp3, and a removed
mapping naming an unknown VolumeType failed with InvalidParameterValue.
Drop NoDevice entries before both, on the request-only and template-merged
paths alike.
2026-10-15 16:39:12 -04:00
XuJian 0eee5ee28d fix(scheduler): validate replacement cleanup addresses (#5713)
* fix(scheduler): validate replacement cleanup addresses

* fix(scheduler): share schedule name validation
2026-10-15 15:51:14 -04:00
Aniket Shukla fb6adc00d8 feat(rds-data): opt into retryable database resume errors (#5703)
* feat(rds-data): opt into retryable database resume errors

* fix(rds): keep lease release safe after timer shutdown

* refactor(rds): share pause cancellation between acquisition modes

* docs(rds-data): list resume errors in configuration references
2026-10-15 15:15:11 -04:00
Ridwan ac83817802 fix(bedrock): resolve the KMS key before updating a guardrail (#5710)
UpdateGuardrail set the name, description and blocked messaging on the
stored DRAFT before resolving kmsKeyId. getGuardrail returns the live
stored object, so a request rejected for an unusable key still left those
fields applied, while updatedAt, the policies and kmsKeyArn kept their old
values.

The key is now resolved into a local before any setter runs, the same
validate-before-mutate order #2501 gave UpdateMemory. It stays after the
guardrail lookup, so an unknown guardrail is still reported as
ResourceNotFoundException first.

Fixes #5654
2026-10-15 14:16:04 -04:00
Allen Sanborn 1e423420ed fix(ec2): resolve a NAT gateway's network interface and mark its Elastic IP associated (#5622)
* fix(ec2): resolve a NAT gateway's network interface and mark its Elastic IP associated

CreateNatGateway gave each gateway address a networkInterfaceId of
"eni-" + randomHex(17), but nothing else knew about that interface:
DescribeNetworkInterfaces had no NAT arm, so the id DescribeNatGateways
publishes (aws_nat_gateway.network_interface_id) answered
InvalidNetworkInterfaceID.NotFound. The Elastic IP the gateway took was
also never marked associated, so DescribeAddresses showed a held
allocation as free.

The interface id is now derived from the gateway id, as endpoint ENIs
are, and DescribeNetworkInterfaces reports one requester-managed
nat_gateway interface per gateway address, built from the stored
address so the two reads cannot disagree. CreateNatGateway records the
association, interface and private address on the allocation (no
instanceId), and DeleteNatGateway clears them if the association is
still the gateway's.

* fix(ec2): refuse a NAT gateway on an occupied Elastic IP, keep its association, scope its ENI lookup to the account

CreateNatGateway rejects an allocation already held by an instance or another gateway
(Resource.AlreadyAssociated) under the lock that writes the association. DisassociateAddress
rejects an association owned by a NAT gateway. The NAT arm of DescribeNetworkInterfaces reads
gateways and subnets for the account asked about.

* fix(ec2): lock NAT gateway EIP release, treat a legacy gateway's EIP as held

DeleteNatGateway releases the Elastic IP under the lock CreateNatGateway
takes. CreateNatGateway also refuses an allocation any live gateway
references, covering gateways persisted before Address records were
marked. The CloudFormation networking test gives the replacement NAT
gateway a new EIP: replacement creates before it deletes, and AWS's
CreateNatGateway refuses an EIP still associated elsewhere.

* fix(ec2): AssociateAddress refuses a NAT gateway's Elastic IP; legacy gateways hold theirs

AssociateAddress checks for a gateway holding the allocation and writes
under the allocation lock CreateNatGateway and DeleteNatGateway take, so
an instance cannot take over an address the gateway still claims. The
gateway scan behind that check, and CreateNatGateway's, now includes
unmigrated pre-account-isolation gateway records for the default
account, never another account's.

* fix(ec2): scope NAT gateway ownership checks to the caller's records

callerNatGateways scanned every account's gateways before filtering. Read
the caller's own records, plus unprefixed legacy records only for the
default account.

* fix(ec2): create a NAT gateway failed on an Elastic IP already in use

CreateNatGateway with an allocation another gateway or an instance holds
no longer answers 400. As the NatGateway shape documents, the gateway is
created in state failed with FailureCode Resource.AlreadyAssociated and
FailureMessage "Elastic IP address <alloc> is already associated". It
gets no interface, claims nothing, and does not count as a holder.
AWS::EC2::NatGateway fails the resource and deletes the failed gateway.

ReleaseAddress on an allocation a NAT gateway holds, legacy gateways
included, answers InvalidIPAddress.InUse. DisassociateAddress and
ReleaseAddress run under privateIpAllocationLock. The NAT interface lookup
reads legacy unprefixed gateways and subnets for the default account. It
also loads the interface's tags, and DeleteNatGateway deletes them.
endpointEniId and natEniId become one helper, eniIdFromSeed.

* test(cloudformation): say why the replacement template keeps NatEip

The replacement template keeps NatEip for two reasons. On AWS a gateway
given an Elastic IP the displaced gateway still holds is created failed.
And Floci update cleanup deletes removed resources before the old copies
of replaced ones, so dropping the EIP while replacing its gateway would
try to release it while it is still held.

* fix(ec2): a failed NAT gateway does not pin its subnet or VPC

#5503 made DeleteSubnet and DeleteVpc refuse while a NAT gateway that is
not deleted sits in the subnet. A failed gateway was never created and
holds no interface, so it no longer counts, matching the Elastic IP
holder check.
2026-10-15 13:53:49 -04:00
Vũ Thế Huy d3fce14256 feat(redshift-serverless): add release track, managed workgroup and reservation reads (#5691)
* feat(redshift-serverless): add release track, managed workgroup and reservation reads

Add GetTrack, ListTracks, ListManagedWorkgroups, ListReservations,
ListReservationOfferings, GetReservation, GetReservationOffering and
CreateReservation so SDK, CLI and IaC clients no longer get an unknown
operation error. Floci models no zero-ETL managed workgroups and sells no
reservations, so the lists are empty and the reservation lookups answer
ResourceNotFoundException. The two release tracks are current and trailing.

Required members, patterns and lengths come from the AWS model through
RedshiftServerlessRequestShapes; only the track names, which the model leaves
unenumerated, are checked by hand.

* refactor(redshift-serverless): reuse Pagination.paginate and remove unused admin handle method

Rely on Pagination.paginate for maxResults and nextToken validation in listTracks and listWithoutItems, matching the other Redshift Serverless lists. Remove the unused handle method and its duplicate unknown-operation response in RedshiftServerlessAdminJsonHandler.
2026-10-15 13:46:35 -04:00
Langning Zhang ea45f81a81 fix(s3): reject undersized multipart upload parts (#5718)
* fix(s3): reject undersized multipart upload parts

Signed-off-by: boulea7 <zln1905391059@163.com>

* fix(s3): reuse multipart size error helper

Signed-off-by: boulea7 <zln1905391059@163.com>

---------

Signed-off-by: boulea7 <zln1905391059@163.com>
2026-10-15 12:55:58 -04:00
Vũ Thế Huy b4c012fba4 fix(ecs): apply EFS access point PosixUser and CreationInfo to task volumes (#5606)
* fix(ecs): apply EFS access point PosixUser and CreationInfo to task volumes

An ECS task mounting EFS through an access point ignored the access
point's own settings, so the volume stayed root:root 0755 and a non-root
task could not write to it. Resolve the access point from EfsService and
initialise the volume root from RootDirectory.CreationInfo, and run the
container as PosixUser (uid:gid plus secondary gids). Each part falls
back independently to floci.storage.efs.*. An access point on another
file system, or with incomplete CreationInfo/PosixUser, rejects the launch.

Owner ids use long so unsigned 32-bit POSIX ids are not narrowed.

Closes #5480

* fix(ecs): attach PosixUser groups as supplementary groups instead of replacing container user

Preserve the container definition or image user when mounting an EFS access point, and attach the PosixUser gid and secondary gids as supplementary groups instead of overriding the container user.

Also stabilize ElbV2PreserveHostHeaderIntegrationTest socket connection to avoid public DNS resolution timeouts in CI.

* fix(ecs): validate CreationInfo permissions and filter null secondary GIDs

* revert(elbv2): revert listener test wait and loopback address change

* fix(ecs): share octal permissions check with ContainerLifecycleManager
2026-10-15 12:01:04 -04:00
danielxoi fa682b2d62 fix(cloudformation): clean up, roll back and delete AWS::EC2::VPC like the other EC2 types (#5503)
* fix(cloudformation): clean up, roll back and delete AWS::EC2::VPC like the other EC2 types

A CidrBlock change, or a tenancy change other than dedicated to default,
replaces the VPC, but the provisioner never recorded the displaced one and had
no delete arm, so the old VPC was left behind; in-place Tags, EnableDnsSupport
and EnableDnsHostnames changes were not snapshotted, so a later failing
resource left the VPC changed and reported rollback as not implemented.

Ec2VpcCfnProvisioner now follows Ec2NetworkCfnProvisioner: ReplacementCleanup
records the displaced VPC and deletes it after the update commits or restores
it on rollback; a prior-state snapshot restores DNS attributes, tags and a
dedicated-to-default tenancy change on rollback, eagerly when provision itself
fails; and a delete arm through CfnDeletes.safeDelete removes the VPC on stack
teardown, tolerating only InvalidVpcID.NotFound so stack-external dependents
fail the delete with DependencyViolation, as on AWS.

* refactor(cloudformation): use the shared CfnRollback.guarded in the VPC provisioner

* fix(ec2): count instances and NAT gateways as subnet and VPC dependents

DeleteSubnet and DeleteVpc checked subnets, security groups, route tables,
ACLs, gateways and endpoints but not the instances and NAT gateways living in
a subnet, so a stack teardown could remove a subnet and its VPC out from under
an instance launched into it out of band. Both now fail with
DependencyViolation while an instance that is not terminated (shutting-down
still holds its interface) or a NAT gateway that is not deleted sits in the
subnet, as on AWS. The rollback integration test also pins Boom after the VPC
with DependsOn so the scenario cannot pass by ordering alone.

* fix(cloudformation): keep the VPC and subnet rollback snapshot until the restore succeeds

rollbackUpdate removed the in-place snapshot before restoring; a restore that
threw left the resource persisted as UPDATE_FAILED with no prior state for a
ContinueUpdateRollback retry. Ec2VpcCfnProvisioner and the pre-existing
Ec2NetworkCfnProvisioner now restore first and remove after, as the AgentCore
provisioner already did. The describeTags loop shared by Ec2Tags.reconcile and
the VPC snapshot moves to Ec2Tags.current.

* fix(ec2): count standalone network interfaces and interface endpoints as subnet dependents

A subnet is pinned by any network interface in it, not only the ones an
instance or NAT gateway owns: a standalone interface from
CreateNetworkInterface and an interface or Gateway Load Balancer endpoint
keep DeleteSubnet at DependencyViolation on AWS too. The endpoint test that
deleted a subnet out from under a live endpoint relied on that state being
reachable; it now asserts the refusal and that the published interface ids
are unchanged.

* fix(cloudformation): wait for terminated on instance delete and resolve VPC properties before creating

With real containers an instance is still shutting-down when the stack's
instance delete returns, so the subnet delete that follows was refused by the
new resident check and the stack ended DELETE_FAILED. The instance provisioner
now polls until the instance is terminated or gone, as CloudFormation does.

The VPC provisioner created the VPC before EnableDnsSupport, EnableDnsHostnames
and Tags were resolved, so a resolution failure left it untracked; the resolves
now run first, as the subnet provisioner does. Ec2Tags.current drops reserved
aws: keys so a rollback snapshot never tries to write one, and the replacement
integration test waits in the stack's own region.
2026-10-15 11:14:56 -04:00
dkatavic a318dc7b90 fix(msk): publish a host listener when Floci runs in a container (#5651)
* fix(msk): publish a host listener when Floci runs in a container

* fix(msk): list both listeners in GetBootstrapBrokers when a bootstrap hostname is set

With floci.services.msk.bootstrap-hostname set, GetBootstrapBrokers
returned only the host listener's address, <hostname>:<port>. Inside a
sibling container that is usually the container itself, so the setting
broke broker discovery for containers on the Docker network, the case the
Docker-network default exists to keep working.

It now returns both listeners, <container-name>:9092,<hostname>:<port>.
Kafka clients try bootstrap entries until one connects, and the broker then
advertises the address of the listener they came in on, so host and
sibling-container clients can each discover the broker through the MSK
API. The broker's listeners and advertised addresses are unchanged; only
the API response is.

The container name is used rather than its IP because it fails fast on the
host, where it does not resolve, while an IP the host cannot route to waits
for a connect timeout. It goes first for callers that read only the first
entry, such as isReady's fallback after a restart.

A blank bootstrap hostname is now treated as unset in both places that read
it. Before, the advertised address fell back to localhost while the
bootstrap response still switched to the host form.

* fix(msk): resolve broker readiness from the container id, not an in-memory map

* fix(msk): release the Kafka host port when setup fails before the container starts

* docs(msk): document the bootstrap-hostname setting

* fix(msk): probe broker readiness on the broker's own Docker network

* test: import LinkedHashMap instead of qualifying it inline

* fix(msk): try the next Kafka host port when Docker reports it in use

When Floci runs in a container, PortAllocator.allocate() probes ports in
Floci's own network namespace, so it cannot see a host process that
already holds one, such as a local Kafka or a second Floci. Docker then
refuses the bind, and startContainer released the port and failed the
cluster even though the rest of the kafka-host-port range was free.
Before the host listener, container mode published no Kafka port, so
this is new with it.

startContainer now goes through PortAllocator.allocateAndStart, as the
ECR registry and EC2 instances do: a port Docker reports as in use moves
on to the next one, and the Redpanda listener args and container spec
are rebuilt for each candidate. allocateAndStart also releases the port
on any other failure before the container runs, volume setup included,
so it replaces the hand-written try.
2026-10-15 11:06:27 -04:00
XuJian 7f8383db38 feat(cloudformation): provision SES email identities (#4812)
* feat(cloudformation): provision SES email identities

* fix(cloudformation): retry pending SES update rollback

* fix(cloudformation): keep recovered SES resource complete

* fix(cloudformation): retain recovered SES state on failed replacement

* test(cloudformation): use shared waiter for SES DKIM verification
2026-10-15 10:26:40 -04:00
Daniël van Ziel fdfc74146e fix(config): scope recorder and rule timing state by account (#5719) 2026-10-15 10:19:49 -04:00
Daniël van Ziel 3ad8c25a4f fix(cognito): validate email attributes before storing users (#5460)
* fix(cognito): validate email attributes before storing users

* fix(cognito): reject escaped and quoted email separators

* fix(cognito): preserve blank attribute deletion on updates

* test(cognito): use inline mocks for final verification services
2026-10-15 09:52:59 -04:00
XuJian 15fb050d91 fix(eks): scope pod identity to the cluster account (#5696)
* fix(eks): scope pod identity to the cluster account

* test(eks): remove invalid cross-account pod identity association
2026-10-15 09:39:54 -04:00
Vũ Thế Huy 77384dc3de feat(redshift-serverless): validate requests against the AWS model constraints (#5641)
* feat(redshift-serverless): validate requests against the AWS model constraints

Generate the input constraints (required members, length, pattern, enum,
number range, list size) from botocore's Redshift Serverless model with
tools/aws/regen_redshift_serverless_shapes.py and vendor them under
src/main/resources/aws, like the DynamoDB request shapes. A new
RedshiftServerlessRequestShapes check runs before dispatch and answers a
ValidationException. Pagination members are left to the services, which keep
reporting InvalidPaginationException.

Move the request parsing and error helpers that the JSON handler, the usage
limit service and the service each carried a copy of into ServerlessSupport,
so the resource families that follow share one implementation.

* fix(redshift-serverless): address review findings on request validation

- Match a model pattern against the whole value, so an unanchored pattern such
  as the account id no longer accepts a value that merely contains a match.
- Count string lengths in Unicode code points, so a tag of 200 supplementary
  characters is not rejected for exceeding 256 UTF-16 units.
- Validate only the actions the handler implements, so a modeled but
  unsupported action keeps answering UnknownOperationException.
- Read every string member through ServerlessSupport.text and reject a tag key
  or value that is not a string, so a numeric nextToken or tag member is a
  ValidationException instead of being treated as absent or coerced.
- Regenerate the vendored shapes from botocore 1.43.113, the version
  tools/aws/requirements.txt pins.
- Cover the rejected-request case with a state check, and add the pattern, code
  point, page token and tag regressions.

* refactor(redshift-serverless): use VendoredResources, ServerlessSupport.notFound and update docs
2026-10-15 09:06:46 -04:00
Matheus Oliveira 340e727ede fix(ec2): prevent deleting the local VPC route and return InvalidRoute.NotFound for missing routes (#5603)
DeleteRoute removed the local route CreateRouteTable seeds for the VPC CIDR
and reported success. Since CreateRoute answers RouteAlreadyExists for that
destination, the route table was left without intra-VPC routing and with no
way to put the route back. DeleteRoute also reported success for a
destination the table does not hold, hiding caller mistakes.

Reject the seeded local route with InvalidParameterValue and report an
unknown destination with InvalidRoute.NotFound, matching AWS. The route is
identified by its CreateRouteTable origin, so a route repointed by
ReplaceRoute stays undeletable while repointed.

The CloudFormation route restore path now tolerates the already-gone
InvalidRoute.NotFound case through CfnDeletes.safeDelete.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-15 07:34:56 -04:00
andrei-fabricdata fc5e1aea0a feat(stepfunctions): emit execution status change events to EventBridge (#5567)
* feat(stepfunctions): emit execution status change events to EventBridge

STANDARD executions now publish "Step Functions Execution Status Change"
events (source aws.states) to the default EventBridge bus on RUNNING,
SUCCEEDED, FAILED, TIMED_OUT and ABORTED, so rules matching aws.states
fire as they do on AWS. EXPRESS executions emit nothing, as on AWS.

StepFunctionsEventPublisher follows the EcsEventPublisher pattern.
RUNNING is published when StartExecution creates the execution, terminal
statuses from the worker's completion callback, and ABORTED from
StopExecution only, so a stopped execution emits exactly one ABORTED.
An idempotent StartExecution and the startup sweep of executions
abandoned by a restart emit nothing.

* fix(stepfunctions): match the documented execution status change event

Address review feedback on the aws.states events:

- Always send stateMachineVersionArn and stateMachineAliasArn, null
  when unused, as AWS's documented events do.
- Report redrive status as the documented examples do: FAILED and
  TIMED_OUT are REDRIVABLE with "Execution is <status> and is
  redrivable"; RUNNING, SUCCEEDED and ABORTED are NOT_REDRIVABLE with
  "Execution is <status> and cannot be redriven".
- Name States.Timeout as the error of a TIMED_OUT event.
- Apply the 248 KiB rule: input is left out when the escaped input
  and output together exceed it, output when the escaped output alone
  does, and inputDetails/outputDetails.included report it.

* test(stepfunctions): check event absences without waiting on empty queues

The integration test long-polled SQS for 2 s after each case to show
nothing more arrived, so the class waited about 10 s by design. It now
asserts only the events that should arrive. The absences that matter
are checked in StepFunctionsServiceExecutionEventsTest: it captures the
completion callback from a mocked AslExecutor and verifies that an
EXPRESS execution publishes nothing and that the worker's callback
after StopExecution adds no second ABORTED.

Add StepFunctionsExecutions.waitForTerminalState to the shared testing
package and use it here; moving the other Step Functions integration
tests onto it is left for a separate PR.
2026-10-15 07:03:30 -04:00
David ad1b225591 feat(cloudformation): apply AssociatedRoles on RDS clusters and instances (#5656)
* feat(cloudformation): apply AssociatedRoles on RDS clusters and instances

AWS::RDS::DBCluster and AWS::RDS::DBInstance ignored AssociatedRoles,
so a CDK DatabaseCluster with s3ImportBuckets deployed with no role on
the cluster.

The roles are now associated when the resource is created, through the
same checks as AddRoleToDBCluster and AddRoleToDBInstance; a list RDS
refuses fails the resource and deletes the new database. An update adds
the roles the template gained and removes the ones the previous
template declared and this one drops, so a role associated outside the
stack is kept. An Aurora cluster member carrying its own
AssociatedRoles is a ValidationError, as the schema calls the property
not applicable there. addRolesToNewDbCluster now also refuses a role
named twice in its own list.

Closes #5638

* fix(cloudformation): follow AWS on repeated roles, and check before changing a database

A renamed instance's predecessor was deleted before the new instance
took its roles, so a refused list left neither; the roles now go on
first. The property is resolved before it is read, so Fn::If around the
list or an entry works and AWS::NoValue leaves it out, and any other
value that is not a list is a ValidationError rather than "no roles".

Repeated roles follow AWS's handlers: an instance skips a role or
feature already associated (AWS ignores DBInstanceRoleAlreadyExists),
while a cluster's list is checked first on an update too, and a role
the template newly declares is always added, so one attached by hand
fails the update with DBClusterRoleAlreadyExists. A rolled back cluster
replacement also restores the record of which roles the stack declared.

* fix(cloudformation): undo a failed role update's own changes

An update changed roles one at a time, so when a later step was
refused the roles it had already added stayed on the database while
the stack restored its old record, and a retry failed on them with
DBClusterRoleAlreadyExists. A refused step now removes the roles the
update added and puts back the ones it removed before the error is
reported. The cluster check also takes the template's engine, now that
it checks feature names, and the roles record reader catches only the
JSON parse error.
2026-10-15 06:59:49 -04:00
Andre Kurait f08a443ec9 perf(lambda): avoid code-copy helper shutdown delay (#5646)
* perf(lambda): avoid code-copy helper shutdown delay

* test(lambda): scope the code-copy fixture threshold

Signed-off-by: Andre Kurait <akurait@amazon.com>

* chore(ci): retry the EKS registry fixture check

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-15 06:57:38 -04:00
Andre Kurait 5a72b4f561 fix(apigateway): validate imported models in their deployment context (#5645)
* fix(apigateway): resolve imported request model references

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): snapshot request model schemas for deployments

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): match the default body validation error

Signed-off-by: Andre Kurait <akurait@amazon.com>

* test(apigateway): expect the AWS default validation message

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): address model snapshot review findings

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): resolve model URLs from deployment snapshots

Signed-off-by: Andre Kurait <akurait@amazon.com>

* test(apigateway): make model reference cases collectable

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(apigateway): accept canonical model URLs in every partition

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-15 06:50:46 -04:00
TATSUNO “Taz” Yasuhiro 6f78083080 feat(lambdaweb): Lambda Web Functions control plane (#5706)
* feat(lambdaweb): Lambda Web Functions control plane

The lambda-web service model (apiVersion 2025-03-07) signs as lambda, so
it is served under the lambda service at /2025-03-07/... with the AWS
wire shapes, state words and error wording of the 20 operations on web
functions, revisions, endpoints, tags and the resource policy.

Revisions and endpoints converge at once. They are stored Active and an
endpoint update is stored Successful, while the create and update
responses report the transitional state AWS reports, so a CLI waiter
settles on its first poll. Code comes from an S3 object that must exist.
IamAuth, the resource policy and the endpoint domain are stored but not
served yet.

Part of #5699

* fix(lambdaweb): carry the page position in the token

The nextToken of a list operation was a UUID keyed into an in-memory
anchor map that only grew and was not scoped to the account. The token
is now a core Pagination cursor that encodes the request (operation,
region, account, function, filters and page size) and the cursor of the
item the page ended on. A token reused with other parameters gets the
AWS "does not match the request" error and any other token the AWS
"invalid or has expired" error.

AWS issues UUID tokens and rejects any other shape, so Floci no longer
reproduces the pattern error for a malformed token.

* fix(iam): resolve a Lambda Web revision or endpoint named by its ARN

The route resource for IAM enforcement took the path segment after
revisions or endpoints as the id. A revision or endpoint ARN in that
position carries slashes, so the resource ARN ended in the ARN's first
segment and a policy scoped to the revision or endpoint did not apply.
The id is now the last segment of such an ARN.

* fix(lambdaweb): add the values of a repeated state filter

AWS lists a function when any state filter in the request names its
state. A later state filter replaced the earlier one, so a request with
state=Active followed by state=Failed listed nothing.

* fix(lambdaweb): refuse empty arrays in a resource policy

AWS answers an empty Action or Resource array with the policy syntax
error and an empty principal array with the invalid principal error,
which wins when all three are empty. Floci stored such a policy.

* fix(lambdaweb): judge a wildcard principal by the operator and value of its condition

A trusted condition key alone kept an Allow for every principal out of
the public check. AWS blocks the policy unless a positive operator pins
the key: StringNotEquals and the IfExists forms do not count, nor does a
wildcard in an account value or in the account field of an ARN value,
while a wildcard elsewhere in an ARN and a literal * under StringEquals
do.
2026-10-15 06:46:52 -04:00
Hector Ventura d4d4f16dfd feat(ui): add a light and dark theme toggle to the landing page (#5695)
* feat(ui): add a light and dark theme toggle to the landing page

The landing page was dark only. A button in the top bar, shown on the
dashboard and on the /_floci/ui wait view, switches between a dark and a
light theme. With no choice made the page follows the OS colour scheme,
including a change while it is open; a choice is remembered in
localStorage under floci.theme, next to the news setting, and the page
still switches for the current view when storage is blocked. The theme
is set by the head script before the stylesheet paints, so a light page
does not flash dark on load.

The dark palette is unchanged. The light one keeps the same accent
family with every text colour at 4.5:1 or better against the page
backgrounds, and the five colours that were written as literals (logo
dot, button text, code snippets, error box, the copied border) are now
variables both themes set.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* feat(ui): name the emulator in the top bar and keep a page-view theme choice

The page will be shared by the other Floci emulators, so the top bar now
says which one serves it, floci-aws, next to the logo, and the page title
and the version pill's tooltip name it too.

A theme picked with the toggle while storage is blocked could be undone
by an OS colour-scheme change later in the same page view, because the
OS listener only checked the stored choice. The click is now remembered
in memory as well, so the OS is followed only until the user picks.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* chore(ui): pin the floci-ui console image to 0.7.0

The console image defaulted to floci/floci-ui:latest, and a cached
latest tag is never pulled again, so a machine kept whatever console it
first downloaded. The default is now the released 0.7.0 tag, in the
config default, application.yml and the three docs tables that list it.
FLOCI_SERVICES_UI_IMAGE still overrides it.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-15 00:03:24 -04:00
David Phillips dbe7fdb92e fix(logs): enforce stream resource permissions (#5694)
* fix(logs): enforce stream resource permissions

* fix(logs): retain request partitions for stream permissions
2026-10-14 23:42:14 -04:00
Priamo Germosen 4be2b8b043 fix(codeartifact): capture an empty readme for npm versions published without one (#5683)
A version published with no readme field was silently skipped in
checkRepublish's readmeByVersion map, so GetPackageVersionReadme answered
ResourceNotFoundException for a version that genuinely exists on Verdaccio.
pypi already records an empty string in the equivalent case (twine uploads
with no description field), so npm now does the same: every version in the
publish envelope gets an entry, with recordPublishedPackageVersionReadme's
existing null-to-"" normalization doing the rest.

Follow-up requested on #5644's approval.
2026-10-14 22:22:17 -05:00
Priamo Germosen 425cd3167d feat(iam): resolve policy variables in Resource patterns and Condition values (#5639)
A ${...} in a Resource pattern or a Condition value was matched as the text it
is written as, so a statement scoped to arn:aws:iam::*:user/${aws:username}
matched no user at all. AWS's own IAMUserChangePassword policy is written that
way and floci vendors it verbatim, so under enforcement it authorized nothing,
and it is not alone: 244 of the 1586 vendored managed policy documents carry a
variable, and of the 1635 occurrences in them 1443 sit in a Condition value
and 192 in a Resource. The Condition share is where the loss bites hardest,
since a variable that cannot resolve quietly drops a Deny that AWS honours.

The keys a variable resolves against arrived with #5568, which put
aws:username, aws:userid and aws:PrincipalType into the request context. This
is the other half of that work: without substitution the keys answer nobody,
and without the keys substitution has nothing to find.

Variables now resolve wherever the evaluator matches a statement, which covers
every document it reads: identity policies, resource policies, session
policies, permissions boundaries, SCPs, and the Condition of a role trust
policy, whose own Version now reaches the condition check. A trust policy is
the narrow case, since sts:AssumeRole is authorized before there is a session
to describe: that context carries aws:PrincipalArn, the account and region
keys, sts:RoleSessionName and sts:ExternalId, so a variable naming
aws:username, aws:userid or aws:PrincipalType finds nothing there, which
iam.md now says.

Two of the rules are easy to miss. Substitution is gated on "Version":
"2012-10-17", because under the older 2008-10-17, which is also the default
when the element is absent, the user guide says variables "are instead treated
as literal strings in the policy"; the version therefore rides on each parsed
statement, since statements from many documents are evaluated as one list. And
a variable with no value is not an empty string: in Resource the pattern "will
not match any resource", in NotResource that same rule excludes nothing, and
in a Condition the positive operators do not match while the inverted ones do,
which is what makes the Deny AWS documents for an unset principal tag fire.

The rest, also from the user guide: a variable resolves only in the resource
portion of an ARN, after the fifth colon; only with the string and ARN
condition operators, never Numeric, Date, Bool, IpAddress or Null; only for a
single-valued key, a multivalued one having no one value to stand in, which a
default does not rescue, since a default answers a key with no value rather
than one with several; and case-insensitively by key name, a name that holds
no space, the guide allowing one inside a quoted default and nowhere else. A
spaced name, an empty ${}, a missing brace and an unquoted default are the
forms the guide's policy checks call errors, and each stays the text it is.
${*}, ${?} and ${$} stand for a literal character, so the glob gained an
escape marker, honoured only on a pattern that came back from substitution and
stripped from whatever arrived in the policy: a document can write the marker
as a JSON escape, and reading it as one would turn a wildcard of the
document's own into a literal character and narrow the statement it sits in. A
resolved value is not escaped, matching AWS, whose policy checks warn that
variables "can be evaluated as effective wildcards".

Verified at this commit: 7442 tests across the 439 IAM, core, enforcement and
resource-policy classes the evaluator is reached from, Checkstyle and
docs-check clean. AWS's own IAMUserChangePassword document is attached to a
user and called on the request path, both of its patterns included, the second
scoping a user under a path. Each rule was probed by reverting it alone, which
is how two weak tests were found: a valueless variable beside a wildcard and
the operator restriction both needed a case whose answer flips. The escape
marker is probed from both sides, by letting the resolver keep one that
arrived in a policy and by honouring markers on every pattern rather than only
a substituted one, and each side fails a different case of the same test.
2026-10-14 22:22:06 -05:00
David Phillips a55352bf9d fix(elbv2): preserve default listener certificates (#5692)
* fix(elbv2): preserve the default listener certificate

* fix(elbv2): keep certificate checks independent of other VPCs
2026-10-14 23:13:33 -04:00
XuJian 4c3d9cad2d fix(s3): validate multipart upload part numbers (#5655)
* fix(s3): validate multipart upload part numbers

* test(s3): verify rejected upload parts are not stored
2026-10-14 23:13:00 -04:00
Kenshin Okinaka 2ea6653c65 refactor(ses): move the send-address checks into ses.address (#5689)
SesAddressSyntax, SesAddressLength, SesSendAddresses and SesEncodedWord
are stateless address parsing and validation that depend only on the
model and core packages. Only the entry points the send path calls are
public; the walker and the encoded-word helper stay package-private
inside the new package. No behaviour change.
2026-10-14 22:02:10 -04:00
Jackson Price e15c081d33 fix(acm): reject empty SAN arrays in certificate requests (#5688)
RequestCertificate answers an explicit empty SubjectAlternativeNames
array with a 400 ValidationException, as ACM does: the API requires at
least one name in the list. CloudFormation certificate resources keep
accepting an empty list and request the certificate for the domain
name alone, as before.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-14 20:57:53 -04:00
Jackson Price 190ed52249 fix(appconfig): accept a quoted Ion type parameter in Accept (#5687)
GetLatestConfiguration and the legacy GetConfiguration compared the
type parameter of an Accept media range verbatim, quotes included. So
application/ion with type="AWS.AppConfig.FeatureFlags" did not match,
and a feature flag profile with variants came back as the stored JSON
instead of Ion. RFC 9110 section 5.6.6 makes a quoted-string parameter
value the same value as its token form.

The type value is now read as a token, or as a quoted-string without
its DQUOTEs and with each quoted-pair standing for the character after
its backslash (section 5.6.4). A quoted-string that is not closed, or
that has text after its closing DQUOTE, does not match. The media range
and the q weight are read as before.

Closes #5673

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-14 20:48:24 -04:00
TATSUNO “Taz” Yasuhiro 503899df05 fix(dynamodb): treat a null ReturnConsumedCapacity as absent, as AWS does (#5686) 2026-10-14 20:46:17 -04:00
David Phillips 430af5fce7 fix(rds): keep Aurora member passwords owned by their cluster (#5685)
* fix(rds): keep Aurora passwords owned by the cluster

* test(rds): cover member changes across regions
2026-10-14 20:43:53 -04:00
LiamCato 8145ffd00e feat(opensearch): allow configuring a data volume for domain containers (#5581)
* feat(opensearch): allow configuring a data volume for domain containers

* fix(opensearch): isolate configured storage and prepare bind mounts

Include account and Region from the domain ARN in configured volume
names and bind paths, preserving the optional deployment namespace.

Treat missing ownership markers as FLOCI_MANAGED and remove name-based
ownership inference. Retain explicitly operator-owned storage and use
persisted volume names for managed cleanup.

Reuse the storage helper container lifecycle to prepare bind-directory
ownership and owner write access from the selected image. Leave existing
files untouched, propagate preparation failures, and release reserved
ports when storage preparation fails.

Preserve Linux daemon path syntax on Windows while keeping native
Windows paths and named volumes working.

Consolidate OpenSearchDomainManagerTest setup, add regression coverage
and a Linux Docker integration test, and update configuration comments
and documentation examples.

Fix an existing bug where opensearch container names did not include
account or region id.
2026-10-14 20:34:28 -04:00
Victor Marques 66756f7b9c fix(docker): skip stale connection checks for named pipes (#5400)
Disable stale connection validation for named-pipe endpoints because Docker may block while the HTTP client checks pooled connections. Keep the existing validation for TCP and Unix sockets.

Fix #5394
2026-10-14 19:39:38 -04:00
David Phillips 92b2cf74f7 fix(rds): inherit Aurora member master credentials (#5667)
* fix(rds): inherit Aurora member master credentials

* fix(rds): retain defaults for incomplete cluster credentials

* test(rds): keep credential checks compatible with Java 17

* fix(rds): keep Aurora managed secrets on the cluster

* fix(rds): reject member credentials and publish offline changes

* fix(rds): match the member username error message

* fix(rds): release proxy listeners before reboot

* test(rds): shorten listener retirement failure checks
2026-10-14 19:31:42 -04:00
Allen Sanborn 1883855c94 fix(core): give launched containers the port Floci listens on (#5577)
ContainerReachableEndpoint.baseUrl() took the port from floci.base-url, which
advertises the host-facing address. Under a port mapping such as
`docker run -p 4811:4566 -e FLOCI_BASE_URL=http://localhost:4811`, Lambda, ECS,
Flink, MWAA, EC2 and CloudFormation custom-resource containers got an
AWS_ENDPOINT_URL on port 4811, which is refused inside the Docker network where
Floci listens on 4566.

The port is now the one Floci listens on: quarkus.http.port, which defaults to
floci.port but can be overridden on its own, or floci.port when TLS is on,
since the HTTP server then moves to a loopback-only internal port and
TlsProxyServer serves clients on floci.port. URLs returned to host clients
still come from base-url.

ContainerReachableEndpointTest covers the embedded DNS and Docker host paths,
a custom listen port and hostname, quarkus.http.port overridden alone, and
TLS; ContainerLauncherTest asserts a launched function gets the listen port
when base-url advertises another. SidecarContainersProfile sets floci.port and
quarkus.http.port alongside the test port.

Closes #4987
2026-10-14 18:31:17 -05:00
Hector Ventura 3afb5b430e fix(partitions): source the China CloudFront suffix and GovCloud API Gateway zones (#5618)
* fix(partitions): source the China CloudFront suffix and GovCloud API Gateway zones

Two values listed as open questions have a published source in the China and
GovCloud user guides, so they become vendored facts in aws/region-facts.json
instead of a commercial constant.

A generated CloudFront distribution domain name ended in cloudfront.net in
every partition. The China guide's CloudFront page names the default domain
there as *.cloudfront.cn
(https://docs.amazonaws.cn/en_us/aws/latest/userguide/cloudfront.html), and
the commercial suffix is the one in the example name of the botocore
CloudFront model (Distribution$DomainName, DistributionSummary$DomainName).
floci.services.cloudfront.domain-suffix loses its cloudfront.net default and
becomes optional: unset, the suffix follows the request's partition, with the
commercial one where a partition has no CloudFront; set, it applies in every
partition as before. CloudFront distributions and streaming distributions,
Cognito and AppSync custom domains and edge-optimized API Gateway domains all
resolve it through CloudFrontEdgeDomain.domainSuffix.

A regional API Gateway custom domain reported one placeholder hosted zone id in
every region. The GovCloud guide's API Gateway page states the regional
endpoint zone for us-gov-west-1 (Z1K6XKP9SAGWDV) and us-gov-east-1
(Z3SE9ATJYCRCZJ)
(https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-abp.html);
those two regions now report it, and the generator resolves each region
through its description in partitions.json. No source gives the zone for any
other region, which keeps the placeholder and stays an open question.

The generator reads both sentences from either rendering of a guide page: the
page text, or the Markdown AWS serves at the same URL with .md, which escapes
the asterisk in the CloudFront sentence.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(partitions): require each sourced fact and resolve edge domains in the request's partition

The GovCloud API Gateway page parser accepted a page stating only one
region's regional hosted zone, so an edited guide would have dropped the
other zone from region-facts.json without failing. It now requires a zone
for every aws-us-gov region.

The region-facts self check validated cloudfrontDomainSuffix only when it
was present. It now requires the suffix for aws and aws-cn, and the
regional hosted zone for both GovCloud regions, as it already requires
consoleHost; a missing commercial suffix would otherwise have reached
the orElseThrow in CloudFrontEdgeDomain.domainSuffix at runtime.

CloudFrontEdgeDomain.create resolved its partition from the region alone,
falling back to the commercial one, so an AppSync or API Gateway custom
domain in a region no partition publishes (allowed under
allow-unknown-regions) took the commercial suffix and hosted zone in a
China deployment. It now takes the partition the caller's RegionResolver
resolves, which falls back to the deployment's partition, as the
CloudFront and Cognito paths already do.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-14 19:25:56 -04:00
Priamo Germosen 8f907023b2 feat(codeartifact): implement GetPackageVersionReadme (#5644)
Supports npm, pypi, and nuget, matching AWS's own documented restriction
for this action (not maven, Swift, generic, Ruby, or Cargo, which carry
no readme in real CodeArtifact).

Neither npm nor pypi can answer this live after the fact. A real
Verdaccio packument GET hoists readme to the top level only, for the
single most-recently-published version, and drops the per-version field
from its own response entirely, even though a real npm client's publish
envelope genuinely sends one per version (confirmed against a live
Verdaccio 6.10.4 container with a captured real npm-publish fixture).
pypiserver has no description field anywhere in its model or its RPC2
route (confirmed by reading pypiserver's own source at the pinned
version), so it never had a live path to begin with.

Both formats are therefore captured at publish/upload time instead:
npm's per-version readme field is read off the real publish envelope by
NpmPublishEnvelopeScanner and recorded after a successful forward to the
Verdaccio sidecar, and pypi's is read off the upload form's description
field the same way it already was. Both go through the same
recordPublishedPackageVersionReadme method and the same
packageVersionReadmes account-scoped store, cleaned up on
DeleteRepository and DeletePackage the same way packageOriginConfigs
already is. nuget is accepted as a valid format but always 404s, since
nothing in Floci implements the real NuGet wire protocol and no nuget
package version can ever exist here.

Refactors validatePackageToken to delegate to a new non-throwing
isValidPackageToken, reused by the readme capture path (fed raw
publish/upload input, never through the JSON API's own validation) to
guard the same escape-collision invariant escapeKeySegment depends on.
Extracts the container-backed revision synthesis already used by
GetPackageVersionAsset into a shared helper so GetPackageVersionReadme
reports a consistent revision for the same version coordinate.
2026-10-14 17:33:50 -05:00
Priamo Germosen 29ead624f8 fix(iam): authorize a Smithy RPC v2 call as the operation its route runs (#5620)
A Smithy RPC v2 call names its operation in the path, /service/<service>/operation/<operation>,
not in a Query Action or an X-Amz-Target header. Enforcement found no action for it, and an
unknown action is allowed, so under enforcement any known key could run any operation of SQS, SNS,
DynamoDB, Kinesis, Step Functions, CloudWatch or Marketplace over RPC v2, explicit denies included.

Enforcement also took the call's shape from the protocol claim, which the claim filter reads before
routing, while the CBOR endpoint dispatches whatever its route matched. The two disagree in
several ways:
- An unrecognised smithy-protocol value leaves the call unclaimed. With strict claiming off, the
  default, it is still served, so an unsigned call was not refused.
- An X-Amz-Target header on the call named the operation it was checked as, while the path named
  the one that ran.
- A path with a prefix before /service/ is claimed as RPC v2 while another route serves it.

The filter now reads the service and operation from the route the call reached, the values the
endpoint dispatches. It authorizes that operation as the action AWS checks for it, under the
serving service's namespace, and records the call's claim, so the unsigned refusal and the CBOR
error format apply whatever its smithy-protocol header says. A call on any other route is handled
as before.

The resources and condition keys a request names in its body were read only from JSON, and a CBOR
body fell back to a wildcard resource: a deny on one queue, table or stream did not apply, a grant
on one did not match, and a ForAllValues dynamodb:LeadingKeys condition granted every key. The
body is now read as CBOR when its content type says so, on the RPC v2 path and on the
x-amz-cbor-1.1 one, which had the same gap.
2026-10-14 17:33:39 -05:00
Priamo Germosen 46f4977b23 fix(ses): publish to an SNS topic only when its policy allows SES (#5650)
Under IAM enforcement, SES published event-destination events and identity notifications to
whatever SNS topic it was configured with, through an internal call nothing checked, so a caller
refused sns:Publish could still put messages on a topic by pointing a configuration set at it. On
AWS, SES publishes as ses.amazonaws.com and the topic's policy decides: it has to allow SES, under
an aws:SourceArn naming the configuration set or identity whose configuration names the topic.

- ServiceCallAuthorizer decides a call one AWS service makes to another's resource on its own
  behalf from the target's resource policy alone, read through the same providers the request
  filter uses and picked by the target ARN's service. A target with no policy refuses, and with
  enforcement off every call is allowed. ResourcePolicyProviders collects what the providers
  supply, for the filter and the authorizer alike.
- IamConditionContextResolver.serviceCallContext builds that call's request context from the IAM
  User Guide's global keys: aws:PrincipalIsAWSService, aws:PrincipalServiceName and
  aws:PrincipalServiceNamesList, aws:SourceArn and aws:SourceAccount, aws:ResourceAccount and
  aws:RequestedRegion, and none of the keys that describe an IAM principal. A publish to an SNS
  topic from SES also carries aws:SourceOwner, which the SNS Developer Guide lists SES among the
  services setting, and which the default topic policy checks.
- SnsResourcePolicyProvider supplies a topic's policy and the account in its ARN, also when the
  topic does not exist. A topic with no Policy attribute gets the default a new topic has, for the
  topic's own account. Topic policies so also take part in a JSON-protocol request that names a
  topic, as any resource policy does.
- SesEventPublisher asks before publishing to SNS: for an event destination with the configuration
  set's ARN, for an identity notification with the ARN of the identity that names the topic, the
  sender's own or its domain's, both with the sending account. A refused event is dropped. A
  notification SES cannot publish, because the topic is gone from its own account or its policy
  refuses SES, also takes the topic out of the identity's bounce and complaint settings and turns
  email feedback forwarding back on, as the SES Developer Guide describes; a delivery setting
  stays. The identity's notification settings are written under the identity lock, so that
  write and an API call changing them cannot lose each other.
- CreateReceiptRule and UpdateReceiptRule ask the same question of an action's TopicArn, with the
  rule's ARN as aws:SourceArn, and answer InvalidSnsTopic when the topic's policy does not let SES
  publish, which the SES API Reference lists as "could not publish to the topic, possibly due to
  permissions issues". The rules still route no mail.
- A resource policy statement that names the caller only through its account, by its id, root ARN
  or S3 canonical user ID, delegates to that account (IAM User Guide, "AWS account principals"):
  across accounts it is still the owner's half of the grant, but within the account it no longer
  grants on its own, and the caller's identity policies have to allow the request. Floci let such
  a statement grant on its own, for bucket and function policies already, so a topic policy naming
  its own account would have let every user of the account publish.
- A Deny's NotPrincipal follows the IAM User Guide ("AWS JSON policy elements: NotPrincipal"): it
  spares an IAM caller only when it names the caller's account as well as the caller, since without
  the account AWS "might deny access to the entire account", and never spares one with a permissions
  boundary attached, which it "will always deny". CallerArns says whether a boundary is attached to
  the user or to the role a session assumed. An Allow's NotPrincipal still grants everyone it does
  not name, as Access Analyzer warns it can.
2026-10-14 17:32:55 -05:00
jwoa95andPriamo 17c40cecbd fix(cognito): reject token validity outside AWS's limits (#5160)
* fix(cognito): reject token validity outside AWS's limits

CreateUserPoolClient and UpdateUserPoolClient accepted any positive token
validity, so a client with one-minute access and ID tokens, or a
20-minute refresh token, worked locally and failed on deploy. AWS allows
access and ID tokens between 5 minutes and 1 day and refresh tokens
between 60 minutes and 3,650 days, in each token's TokenValidityUnits
unit (hours for access and ID tokens, days for refresh tokens, by
default). A client outside them now fails with InvalidParameterException
"Invalid range for token validity.", the message AWS returns.

floci.services.cognito.enforce-token-validity-limits (env
FLOCI_SERVICES_COGNITO_ENFORCE_TOKEN_VALIDITY_LIMITS, default true) turns
the check off for tests that want tokens shorter than AWS allows.

* test(scheduler): start recurring test schedules in the future

Since #5610 a rate schedule's first occurrence is its creation time, so
a schedule is due the moment it exists. The application's own dispatcher
keeps ticking every 10 seconds during @QuarkusTest and sees every
schedule, so a tick that lands between CreateSchedule and the test's own
dispatcher fires the schedule once more than the test expects.

Four tests create an enabled rate(1 minute) schedule and count exact
deliveries: recurringScheduleStartsOneExecutionPerOccurrence,
stepFunctionsDeleteScheduleStopsFutureOccurrence,
rateScheduleDeliversEachOccurrenceWithItsScheduledTime and
executionIdsDifferBetweenOccurrences. They now create the schedule
through SchedulerTestHarness.createRecurringSchedule, which sets a
StartDate a day ahead, and tick past it on their scoped dispatcher. The
application's dispatcher skips a schedule before its StartDate, and the
test profile and its tick interval stay as they are.

* test(compat): poll OpenSearch domain readiness every 250 ms against Floci

OpenSearchTest waited for the domain to finish processing in its own loop
that slept 5 s between checks and swallowed InterruptedException. Floci
flips Processing to false on its own 3 s readiness poll, so the test
could sit up to 5 s past the moment the domain was ready.

The wait now goes through TestFixtures.await, polling every 250 ms
against Floci and keeping the 5 s cadence against real AWS, with the
same 3 minute timeout.

* fix(opensearch): run domain containers under an init process so a stop ends them at once

The OpenSearch image's entrypoint is a bash script that starts the server
as its child instead of exec'ing it. Running as PID 1, that script ignores
SIGTERM, so every DeleteDomain, and every shutdown for each domain, waited
out the whole 5 s stop timeout before Docker sent SIGKILL. The server
never saw the SIGTERM either way.

Domain containers now run under Docker's init process, which takes the
SIGTERM and ends the container at once. Stopping a ready 2.11.1 container
took 5.27 s (exit 137) without it and 0.26 s (exit 143) with it, and
DeleteDomain in the compatibility OpenSearchTest took 5.3 s.

The two startDomain tests' shared setup moves into one helper, which the
new init test uses too.

* fix(cognito): keep a RefreshTokenValidity of 0 at 30 days in any unit

AWS replaces a RefreshTokenValidity of 0 with "the default value of 30
days". Floci stored the bare number 30 in the client's refresh token
unit, so a client with RefreshToken=minutes issued 30-minute refresh
tokens. With the token validity limits, any later UpdateUserPoolClient
that left the validity alone re-checked that stored 30 minutes and
failed with "Invalid range for token validity.", for a client Floci had
accepted.

A 0 now becomes 30 days in the client's refresh token unit (2592000
seconds, 43200 minutes, 720 hours or 30 days), on create and on update,
and the limits check runs on that normalized value. Also imports UUID on
a test line that spelled it out in full.

* fix(cognito): reset the settings UpdateUserPoolClient omits to their defaults

AWS: "If you don't provide a value for an attribute, Amazon Cognito sets
it to its default value." The developer guide adds that an update with
one parameter "sets all others to a default value". Floci kept the
stored value of every setting the request left out, so a client could
end up with a combination AWS never produces: an AccessTokenValidity of
60 kept from a minutes client, read in the hours of a units-only update,
was refused as out of range, where AWS resets the validity and accepts.

CreateUserPoolClient and UpdateUserPoolClient now build their settings
in one place, with a new client's default for each one the request
omits, and the update copies them onto the stored client. ClientName is
the exception: the API documents no default for it, so an update without
one keeps the name. The id, the secrets, the dates and the branding are
not settings and stay as they are. An explicitly empty list still clears
the setting.

The AuthSessionValidity tests and the boto3 compatibility test that
asserted the old keep-on-omit behaviour now expect the 3-minute default.

* test: share one self-signed and one user-cert TLS profile across the TLS integration tests

CustomDomainTlsIntegrationTest, TlsEnsureHostIntegrationTest, TlsHttp2HostRoutingIntegrationTest and EcrTlsDataPlaneDockerIntegrationTest each declared a self-signed TLS profile whose static block wrote its own CA-issued leaf before boot, and under @QuarkusTest that leaf is the one served. They now share SelfSignedTlsProfile, which writes one leaf for all four: the SANs TlsConfigSource uses by default, without 127.0.0.1, plus the API Gateway custom domain the HTTP/2 test routes to. The custom domain and ensure-host tests connect by IP and expect a name the leaf doesn't cover yet to be refused, and the JDK falls back to the peer address when the SNI name doesn't match, so a 127.0.0.1 SAN would let those handshakes through. The leaf and its metadata are written fresh every run, which also drops hostnames an earlier run learned at runtime, and the container CA bundle the ECR test relied on is written beside them.

TlsIntegrationTest and TlsUserCertIntegrationTest declared the same user-provided certificate setup apart from paths. They share UserCertTlsProfile, which keeps the certificate file carrying its private key, since TlsUserCertIntegrationTest checks /_floci/ca.pem never echoes it.

Both profiles live in the config test package, beside every class that uses them and the package-private default SAN list, and expose their paths as compile-time constants, so a test can read them without initializing the profile class and rerunning its static block under the running application.

Sharing an application also means no class may leave anything behind for the next. TlsHttp2HostRoutingIntegrationTest now removes the bucket, CloudFront public key, key group and distribution, and the REST API, domain name and base path mapping it creates. EcrTlsDataPlaneDockerIntegrationTest deletes the manifest it pushes, TlsIntegrationTest its queue and TlsUserCertIntegrationTest its parameter. CustomDomainTlsIntegrationTest and TlsEnsureHostIntegrationTest already end with a state reset, which keeps the configured names from the profile's metadata, so neither changes the leaf a later class is served.

The ECR test's registry container also outlived every run: keep-running-on-shutdown defaults to true and the test config never overrides it, and the next application to start adopted the container by name, a developer's own Floci registry included. SelfSignedTlsProfile now names it in the run's sidecar namespace, which SidecarContainersProfile exposes for this, and stops it at shutdown. The test checks for Docker through SidecarContainersProfile.requireDockerAndImage, so a registry a killed run left behind is removed like any other abandoned sidecar.

Part of #4542.

---------

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-10-14 17:40:23 -04:00
Jackson Price 91c67c69df fix(appconfig): serve legacy deployed configuration requests (#5658)
* fix(appconfig): serve legacy deployed configuration requests

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* fix(appconfig): keep 404 for an unknown application or profile

GetConfiguration now maps only a missing environment to
BadRequestException, as a missing or undeployed environment was
observed on AWS. An unknown application or configuration profile stays
ResourceNotFoundException (404), as the API reference lists.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

* docs(appconfig): note GetConfiguration error codes

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-14 17:38:58 -04:00