Commit Graph
2092 Commits
Author SHA1 Message Date
Allen Sanborn 2af7ed71a7 feat(redshift): implement snapshot copy grant lifecycle (#3628)
* feat(redshift): implement snapshot copy grant lifecycle

Terraform's aws_redshift_snapshot_copy_grant needs the full CRUD, and all
three actions returned InvalidAction. Add CreateSnapshotCopyGrant,
DescribeSnapshotCopyGrants and DeleteSnapshotCopyGrant to the Query handler,
backed by a new storage map on RedshiftService.

The grant name is the key: a duplicate create raises
SnapshotCopyGrantAlreadyExistsFault, and describe-by-name or delete of a
missing grant raises SnapshotCopyGrantNotFoundFault. Describe without a name
returns every grant. KmsKeyId is optional and defaults to the account's
AWS-managed Redshift key alias ARN, mirroring how Ec2EbsEncryptionService
stands in for a default key.

Tags ride along on create, since the CLI sends them inline as
Tags.Tag.N.Key/.Value on this action rather than via CreateTags, and
snapshotcopygrant ARNs now resolve in the tagging operations alongside the
other Redshift resource types.

* test(redshift): cover snapshot copy grants through the real SDK

* fix(redshift): paginate DescribeSnapshotCopyGrants

The action returned every grant in one page and ignored MaxRecords and
Marker, so a client with more grants than fit in a page had no way to walk
them.

Page through the shared Pagination helper, which sorts by the grant name and
encodes the last returned name as an opaque base64 cursor, so ordering is
stable and a marker stays resumable when grants are created or deleted
between pages. Marker is emitted only while further pages remain, which is
what tells a paginating client to stop.

MaxRecords follows the Redshift model: default 100, and a value outside
20 to 100 is rejected with InvalidParameterValue rather than clamped.

The model documents SnapshotCopyGrantName and Marker as mutually exclusive
but declares no error for sending both, so this filters by name and then
paginates instead of rejecting the pair. A name matches at most one grant,
which fits in any page.

* fix(redshift): enforce the SnapshotCopyGrantName contract

AWS validates SnapshotCopyGrantName as 1-63 characters, first a lowercase
letter, then lowercase letters, digits or single hyphens with no trailing
or doubled hyphen. Create accepted anything non-blank, so names Redshift
rejects (1grant, Grant, grant--copy, grant-, 64 characters) persisted
locally and diverged from AWS.

Validate in RedshiftService before persistence, matching the existing
snapshot identifier check, and answer InvalidParameterValue as the rest of
the handler does.

* fix(redshift): return 400 for SnapshotCopyGrantNotFoundFault on Describe and Delete

AWS documents SnapshotCopyGrantNotFoundFault as HTTP 400 in the error tables
for both DescribeSnapshotCopyGrants and DeleteSnapshotCopyGrant; we returned
404. Two existing wire-level assertions in RedshiftOperationsTest pinned the
wrong status, so they move with the code, and the unit tests now assert the
status alongside the error code.

The third throw site, in the tagging helper, deliberately stays 404: the
status belongs to the action rather than the fault code, and that path is
reached only from CreateTags/DeleteTags/DescribeTags, whose documented
missing-resource error is ResourceNotFoundFault at 404. A regression pins
that, and a comment says why the two differ.

Refs:
https://docs.aws.amazon.com/redshift/latest/APIReference/API_DescribeSnapshotCopyGrants.html
https://docs.aws.amazon.com/redshift/latest/APIReference/API_DeleteSnapshotCopyGrant.html
https://docs.aws.amazon.com/redshift/latest/APIReference/API_CreateTags.html

* fix(redshift): serialize grant create/delete, and use ResourceNotFoundFault on the tag path

Two findings from the latest review round.

createSnapshotCopyGrant checked the name was free and then wrote, with nothing
between the two steps, so two concurrent creates of one name could both succeed
and the second would overwrite the first. create and delete are now synchronized,
as createCluster and modifyCluster already are. The new wire-level test holds two
threads on a latch and releases them into the same name: it fails on every run
without the keyword (3/3 locally) and passes with it, so it pins the lock rather
than describing it.

The tagging path threw SnapshotCopyGrantNotFoundFault with HTTP 404. Both halves
of that pairing cannot be right at once: botocore's Redshift model gives that
shape httpStatusCode 400, and an error shape's status is a property of the shape,
not of the calling action. But 404 is the correct status here, because
CreateTags/DeleteTags/DescribeTags do not list that fault at all -- they document
ResourceNotFoundFault, modelled at 404, for any missing resource. So the status
stays and the code changes. That also explains why the three sibling cases in the
same switch are already consistent: ClusterNotFound, ClusterSnapshotNotFound and
ClusterParameterGroupNotFound are each modelled at 404 themselves.

Describe and Delete still return SnapshotCopyGrantNotFoundFault at 400, which is
what those two actions document.

Docs gain a short section on the grant surface: the alias-ARN KmsKeyId default,
the unvalidated tag limits, and why a missing grant reports two different faults
depending on which action you reach it through.

* style(test): name the new snapshot copy grant tests without the testX prefix

AGENTS.md: "Name test methods either as a camelCase sentence or as
method_scenario_expectation. Both are established. testX names are common in
older tests and are not the pattern to copy." The 31 tests this PR adds to
src/test all used testX because the three Redshift files they landed in are
unusually full of it -- 7/7, 30/50 and 69/104 -- but that is the local exception,
not the repo convention, and the rule is explicit about not copying it.

Renames only; no test body changes. The two new tests in
compatibility-tests/sdk-test-java keep testX: that module has the opposite idiom
and AGENTS.md says to follow the module you are in, and all five methods in that
file, three of them pre-existing, are named that way.
2026-09-21 18:31:00 -04:00
Matheus André 2e038b5cfb test(codeartifact): pin ResourceNotFoundException on DeleteDomain of a missing domain (#4107)
AWS returns ResourceNotFoundException (404) when DeleteDomain targets a
domain that does not exist, even though the API reference leaves it out
of the operation's error list. Keep that behaviour, pin it with unit and
integration tests, and note it in the docs and next to requireDomain.

Closes #4000
2026-09-21 18:00:27 -04:00
Simone Primarosa b4f4b386da fix(eks): persist explicit version flag across restarts (#4101)
* fix(eks): persist explicit version flag across restarts

* fix(eks): omit explicit version flag from API responses
2026-09-21 16:29:54 -04:00
David 1542c641a6 feat(rds): stop, start and reboot DB instances and clusters (#4071)
* feat(rds): stop, start and reboot DB instances and clusters

Add StopDBInstance, StartDBInstance, StopDBCluster, StartDBCluster and
RebootDBCluster. A stop reports "stopping", takes the optional snapshot,
removes the container and proxy and settles the record to "stopped"
while its identifier, endpoint, groups and Docker volume stay; a start
reports "starting" and brings the container back on the kept volume and
port. Cluster stop, start and reboot carry the member instances along.

StopDBInstance refuses cluster members, read replicas and their sources,
and anything not available; ModifyDBInstance refuses a stopped instance;
a stopped resource stays stopped across an emulator restart.

Closes #4043

* feat(rds): refuse starting a stopped cluster's member alone, serialize cluster lifecycle calls

StartDBInstance now refuses a cluster member as StopDBInstance does, and
both answer InvalidDBClusterStateFault, the fault the model lists for a
member on either call; a member started alone would have got a
standalone container on its own volume while the cluster stayed stopped.
stopDbCluster, startDbCluster and rebootDbCluster are synchronized like
the instance calls, so two concurrent starts cannot both see STOPPED.
The five handler arms use the shared required-parameter helper and the
central AwsException handling.

* test(rds): import DbInstanceStatus instead of qualifying it inline

AGENTS.md asks for imports over inline fully-qualified names; the file
already imports DbInstanceStatus.
2026-09-21 16:12:54 -04:00
stodan c083aad12b fix(apigateway): verify AWS_IAM signatures against the custom-domain path (#4092)
* fix(apigateway): verify AWS_IAM signatures against the custom-domain path

The custom domain filter rewrites a request onto /execute-api/... before
dispatch but, unlike the execute-api host filter, never recorded the path
the caller actually signed. SigV4 verification then rebuilt the canonical
request from the rewritten path, so every AWS_IAM method invoked through a
custom domain was rejected with InvalidSignatureException.

Record the original raw path on ApiGatewayExecuteRouteContext, matching
ApiGatewayExecuteApiHostFilter, and give the filter an explicit
ApplicationScoped scope so the request-scoped context injects through a
client proxy. Covers both REST and HTTP API custom domains, since v2 API
mappings are stored as base path mappings and routed by the same filter.

* test(apigateway): cover AWS_IAM through an HTTP API custom domain

A v2 API mapping is stored as a base path mapping and routed by the same
custom domain filter as REST APIs, so the fix applies to HTTP APIs too. Prove
it rather than assert it: a signed request through the domain reaches the
integration, and unsigned, rewritten-path and other-path signatures are
rejected with v2's flat 403 Forbidden.
2026-09-21 16:11:06 -04:00
Abhigya 7b29fdcf83 feat(ecs): complete the operations outside the launch path (#4019)
The operations that are not part of launching a task were the ones ECS
answered least like AWS: a listing returned everything at once, a
describe dropped what it could not resolve, and several stored less than
the request carried.

Clusters. CreateCluster and UpdateCluster carry configuration and
serviceConnectDefaults, UpdateCluster replaces only the members the
request named, and DescribeClusters gates settings, tags, statistics,
attachments and configuration on include, reporting the eight documented
statistics split by launch type. DeleteCluster refuses a cluster that
still has services, container instances or running tasks, with the
exception AWS reports for each.

Pagination. Every listing pages with maxResults and nextToken behind one
shared helper: a hundred per page, ten for ListServices, ten for
ListAccountSettings. ListTaskDefinitions lists only ACTIVE revisions by
default and orders by family then numeric revision; ListTasks defaults to
the running tasks and filters by launch type, container instance and
startedBy, which has to be the only filter alongside the cluster scope.

Container instances. RegisterContainerInstance keeps what the agent sent,
deregistration leaves the instance describable as INACTIVE,
UpdateContainerInstancesState moves only between ACTIVE and DRAINING,
and DescribeContainerInstances gates tags and health on include.

Account settings and attributes. A setting is validated per name, carries
its principal and type, and falls back from the principal's own value to
the account default to the built-in default under effectiveSettings. An
attribute belongs to a cluster and must name a container instance it has.

Task sets. A task set needs an EXTERNAL or CODE_DEPLOY service, computes
its desired count from the service's, round-trips its networking and load
balancers, and needs force to delete before it is scaled to zero.
CodeDeploy's call site reports the CODE_DEPLOY startedBy ECS reports.

Service deployments and revisions. A deployment is recorded with the
revision it targets, the two point at each other, and the service reports
the deployment and revision it is currently on.

Verified against the AWS SDK for Java v2 and the AWS ECS API reference.
2026-09-21 16:09:00 -04:00
Simone Primarosa cebdc6f2bb fix(eks): store and return node group launchTemplate, taints, remoteAccess, nodeRepairConfig and warmPoolConfig (#4102)
CreateNodeGroupRequest modelled 14 of the 19 documented CreateNodegroup body
members. The other five were discarded by @JsonIgnoreProperties during
deserialization, so DescribeNodegroup omitted them and OpenTofu saw a node group
with no launch template where one was declared. Adding a launch template to a
node group that lacks one is ForceNew in the AWS provider schema, so every plan
destroyed and recreated the node group.

The five are added to the request as Object and copied onto the stored node
group, matching the generic JSON passthrough convention Nodegroup already
records for recursive sub-structures. warmPoolConfig was also missing from
Nodegroup itself and is added there too.

They are recorded as metadata only. Launch template user data is not executed.
2026-09-21 16:07:01 -04:00
Simone Primarosa 31a19df6f5 feat(eks): enable IMDS and link-local metadata access from pod network (#4039)
Pods running without hostNetwork: true run in isolated network namespaces
managed by the CNI plugin (e.g. flannel in k3s). When pods send requests
to link-local addresses such as IMDS (169.254.169.254:80), the packets reach
the host node network namespace where CNI portmap installed
-A PREROUTING -m addrtype --dst-type LOCAL -j CNI-HOSTPORT-DNAT.
Because 169.254.169.254 is assigned to lo, the kernel evaluates its addrtype
as LOCAL, causing non-host-network pods to misroute or drop link-local traffic
if an ingress controller binds the same port.

This introduces EksPodNetworkRouting and an opt-in configuration setting
floci.services.eks.imds-pod-network (defaulting to false to preserve default
pod network isolation). When enabled alongside floci.services.eks.imds,
DNAT iptables rules are programmed in a dedicated FLOCI-LINK-LOCAL chain
inserted at rule 1 of PREROUTING. Requests originating from the cluster pod CIDR
targeting configured link-local endpoints (such as IMDS at 169.254.169.254:80,
and extensible for Pod Identity at 169.254.170.23:80) are explicitly DNATed
to the node's loopback listener, preempting CNI-HOSTPORT-DNAT without
conflicting with CNI portmap or flannel routing.

LinkLocalEndpoint strictly validates IPv4 literal format to reject non-IPs
or malformed strings. Rules are idempotent and degrade gracefully if iptables
configuration fails, ensuring cluster startup is never aborted.
2026-09-21 16:04:20 -04:00
Aniket Shukla 76a0b865ca fix(sfn): validate Map numeric path fields (#3827)
* fix(sfn): validate Map numeric path fields

* fix(sfn): enforce ItemBatcher byte limit

* fix(sfn): import BigDecimal for map number validation
2026-09-21 15:21:01 -04:00
Niels Kootstra c0ed88d647 fix(scheduler): deliver the default event to targets without Input (#4018)
* fix(scheduler): deliver the default event to targets without Input

Templated targets without Input received "{}" instead of the default
"Scheduled Event" notification that EventBridge Scheduler delivers, so
consumers that switch on detail-type or source never matched. Only SQS
targets had a dead-letter body in the shape of the target service's API;
every other target's body was the raw payload. CreateSchedule and
UpdateSchedule also accepted a non-JSON Input for the templated Lambda,
Step Functions, and EventBridge targets that the API reference requires
to be well-formed JSON.

Deliver the default notification (version, id, detail-type, source,
account, time, region, resources, and detail as the string "{}") to
every templated target whose Input is absent, with an id that is stable
per occurrence so retries and the dead-letter body carry the same event.
Materialize dead-letter bodies with the request fields of Lambda Invoke,
SNS Publish, Step Functions StartExecution, EventBridge PutEvents, and
ECS RunTask, next to the existing SQS SendMessage shape. Reject a
non-JSON Input for Lambda, Step Functions, and EventBridge targets with
a ValidationException, while SQS, SNS, and universal targets keep
accepting any text.

The invoker now takes the schedule and the occurrence time, since the
default event needs the schedule ARN, account, region, and time. RoleArn
is still not consulted at delivery: no Floci delivery path evaluates a
role's permissions, so that is left for a platform-wide follow-up.

Refs #3951

* fix(scheduler): reject blank and trailing-token Input for JSON targets

CreateSchedule and UpdateSchedule checked Input with readTree, which
accepts text after the JSON value ("{} garbage") and returns a missing
node for a blank value, so both were stored for Lambda, Step Functions,
and EventBridge targets. Parse with FAIL_ON_TRAILING_TOKENS and reject a
blank Input, which the API reference gives a minimum length of 1.

Import the scheduler model's AwsVpcConfiguration in ScheduleInvoker
instead of qualifying it inline. The ECS model's type of the same name
stays qualified, with a comment naming the clash.
2026-09-21 15:14:53 -04:00
Aniket Shukla bb67a443ce fix(cloudwatchlogs): persist event batches once (#3767)
* fix(cloudwatchlogs): persist event batches once

* test(storage): cover AccountAware putAll prefixing
2026-09-21 14:53:09 -04:00
Simone Primarosa 6a3380d13a feat(eks): implement cluster addon management (#4038)
* feat(eks): implement cluster addon management

* fix(eks): address addon management review comments

* fix(eks): handle uncataloged k8s versions and association validation ordering
2026-09-21 14:18:07 -04:00
Simone Primarosa 49d28fb685 feat(eks): support native kubernetes versions and network cidrs (#4064)
Support standard AWS EKS Kubernetes versions (1.28 and above) with strict
1.xx validation format, mapped to stable k3s images when requested. Fall
back to default-image (with 1.29 cluster version metadata) when no version
is specified. Support service IPv4 CIDR validation (RFC 1918 containment,
/12 to /24 prefix, non-overlapping with VPC CIDR) with automatic fallback
to alternative CIDR, and preserve standard k3s pod CIDR to avoid collisions
with Docker networks.
2026-09-21 14:15:06 -04:00
Daniël van Ziel 4618d633e0 fix(textract): retain async results until expiry (#3965) 2026-09-21 14:11:16 -04:00
Daniël van Ziel 8ccc89df41 fix(cloudwatch): honor Unit filter in JSON GetMetricStatistics (#3932) 2026-09-21 13:47:22 -04:00
Abhigya ace99b34b0 feat(ecs): service members, service role and capacity provider management (#4037)
CreateService and UpdateService carry the members AWS documents on the Service
shape, rather than dropping them: deploymentConfiguration, serviceRegistries,
platformVersion and platformFamily, enableExecuteCommand, enableECSManagedTags,
propagateTags, healthCheckGracePeriodSeconds, the role, and anything else the
request sent, which round-trips verbatim. A client that reads back what it wrote
sees no drift.

UpdateService rolls a new deployment only for the members UpdateService
documents as starting new tasks, a changed network configuration, load balancers,
service registries or platformVersion, and applies the rest in place. An update
replaces only the members it names, so a service created with
placementConstraints and updated with placementStrategy alone keeps its
constraints; a member the update does name is replaced outright, which is how an
empty array clears one.

A service role is accepted only where AWS accepts one: with a load balancer, and
not with awsvpc networking.

Capacity provider management follows the documented rules. A name is at most 255
letters, numbers, underscores and hyphens and is never prefixed with aws, ecs or
fargate. A provider reports its ARN, its type and the autoScalingGroupProvider it
was created with. DescribeCapacityProviders gates tags behind include: ["TAGS"]
and reports an unresolvable name as a MISSING failure. DeleteCapacityProvider
refuses the reserved FARGATE and FARGATE_SPOT providers, one still attached to a
cluster and one still named in an active service's capacity provider strategy,
and reports the deleted one through updateStatus so the SDK is never handed an
unmappable CapacityProviderStatus.

Split out of the Fargate launch surface PR, which keeps the capacity provider
strategy distribution and the service task launch.
2026-09-21 11:58:55 -04:00
Vũ Thế Huy d227ef9195 feat(redshift): add ModifyClusterIamRoles, DescribeClusterVersions and DescribeOrderableClusterOptions (#3990)
ModifyClusterIamRoles adds and removes the IAM roles associated with a
cluster. The change is pushed to the running auth proxy, so COPY and
UNLOAD on new connections authorize against the updated role list.
Cluster IamRoles now report ApplyStatus in-sync.

DescribeClusterVersions and DescribeOrderableClusterOptions return static
data so IaC providers can validate node types before creating a cluster.
2026-09-21 11:32:09 -04:00
Chiara Forresi 992b80f8f7 fix(glue): make DeleteJob idempotent (#3866)
Match AWS DeleteJob behavior by tolerating deletion of a missing job definition and cover repeated deletion in the Glue service test.
2026-09-21 11:16:07 -04:00
Chiara Forresi 0108b9653a fix(cloudwatchlogs): add logGroupArn to DescribeLogGroups (#3868) 2026-09-21 11:13:15 -04:00
Hector Ventura 78c046b883 feat(cloudformation): apply AWS::IAM::AccessKey Status (#4060)
IamAccessKeyCfnProvisioner ignored the Status property, so an access key declared Inactive was created Active. Resolve Status and apply it: a new key is deactivated when the template asks for Inactive, and on an unchanged update the mutable Status is reconciled in place.

Status is validated up front (Active/Inactive), before any key is created, so a bad value cannot create a key and then fail (a user is capped at two keys). The update path reconciles Status only when the template declares it, so an unrelated update does not reactivate a key deactivated out of band, matching AWS's apply-only-declared-properties update semantics.

Refs #3933
2026-09-21 10:54:08 -04:00
Hector Ventura e1334cb512 fix(cloudformation): fail an EC2 instance whose LaunchTemplate cannot be resolved (#4058)
Ec2InstanceCfnProvisioner swallowed a failed resolveLaunchTemplateData at debug and then launched the instance with default config (t3.micro, no template AMI/KeyName). A LaunchTemplate a stack references but that does not resolve is a real error, as on AWS, so let the AwsException propagate and fail the resource. The unused LOG field is removed with the swallow.

The lookup only runs when the resolved LaunchTemplate is an object naming a template: an Fn::If that selects AWS::NoValue resolves to an empty node (CloudFormationTemplateEngine maps AWS::NoValue to ""), which on AWS means the property is absent, so it must launch without a template rather than raise InvalidLaunchTemplateId.NotFound.

Refs #3810
2026-09-21 09:58:28 -04:00
XuJian 12cad79616 feat(rds): support instance snapshot lifecycle operations (#4066) 2026-09-21 09:48:57 -04:00
Priamo Germosen 847ad256f2 fix(lambda): resolve hot-reload paths before checking the allow-list (#4053)
Normalize the hot-reload S3Key and compare it against the allow-list by directory instead of by string prefix, so dot-dot segments and sibling directories no longer pass. Store the normalized path, reject a colon in it, and warn at startup when hot-reload runs without an allow-list.
2026-09-21 07:53:07 -05:00
TATSUNO “Taz” Yasuhiro 138f3c2650 fix(dynamodb): apply the ProjectionExpression of a TransactGetItems Get (#4061)
The projection was validated and then ignored, so every Get returned the whole
item. A projection selecting no attribute leaves the entry without an Item,
where GetItem and BatchGetItem both keep an empty one.
2026-09-21 08:43:35 -04:00
lex00 c62db2de1e fix(s3): keep a virtual-hosted key whole when it contains the bucket name (#3944)
* fix(s3): keep a virtual-hosted key whole when it contains the bucket name

extractObjectKey searched the raw request path for "/<bucket>/". For a
virtual-hosted request the raw path is the key alone, so that string is
there only when the key happens to contain the bucket's name as a
segment, and everything up to and including that segment was dropped:
"tofu-records/b/.store-sentinel" in bucket "b" was stored as
".store-sentinel". A list under the real prefix then came back empty.

The raw path is treated as the whole key when the rewritten request URI
is exactly "/<bucket>" + rawPath, which is what S3VirtualHostFilter
produces and a path-style request never is. Path-style is unchanged.

Closes #208

(cherry picked from commit e0dccb85f514d59f4f3c24d59d54ccc035821097)

* test(s3): describe the scenario rather than naming a downstream project

Review feedback on #3944. The comment named a specific project and its key
layout, which goes stale and tells the next reader nothing they need. It now
describes the shape that matters, a key carrying the bucket's own name as a
segment, and keeps the two sentences that explain why a virtual-hosted raw
path makes that key data rather than a bucket prefix.
2026-09-21 08:33:51 -04:00
vamsiakandVamsi Akavarapu 25a74be198 fix(stepfunctions): preserve Scheduler task timestamps (#4056)
Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-09-21 08:30:44 -04:00
Hector Ventura e4c75e4f17 refactor(cloudformation): share managed-policy delete helpers (#4052)
IamManagedPolicyCfnProvisioner and IamPolicyCfnProvisioner's legacy path each carried a near-identical managedPolicyRoleTargets resolver and detach-then-delete loop for a stack-owned managed policy. Extract them into IamManagedPolicyDeletes (roleTargets, detachRolesAndDeletePolicy, deletePolicyTolerating), mirroring CfnDeletes, and delegate from both. The legacy migration keeps its own rollback-tracking detach loop, reusing only the shared target resolution and tolerant delete.

Behavior-preserving: the copies were equivalent (recorded-targets-or-discover, then detach tolerating NoSuchEntity, then delete tolerating NoSuchEntity).

Refs #3972

Follow-up now unblocked because both IAM policy PRs (#3971, #3972) have merged.
2026-09-21 08:05:20 -04:00
Hector Ventura e7fe03b69b refactor(cloudformation): share EC2 tag reconciliation (#4057)
Ec2InstanceCfnProvisioner and Ec2SecurityGroupCfnProvisioner carried an identical tag-reconcile loop (describeTags, staleTagKeys, deleteTags, createTags); the instance one also hand-rolled tag resolution instead of using ProvisionContext.resolveTags. Extract the loop into Ec2Tags.reconcile(ec2Service, region, resourceId, desired) and drive both from ctx.resolveTags.

Behavior-preserving: the loops were identical, and ctx.resolveTags matches the instance's hand-rolled parse (skipping blank keys, defaulting a null value to empty).

Refs #3884
2026-09-21 07:04:45 -04:00
Hector Ventura eb247a50aa fix(cloudformation): reject a non-numeric AuthorizerResultTtlInSeconds (#4055)
ApiGatewayV2CfnProvisioner parsed AuthorizerResultTtlInSeconds with Integer.parseInt and let a non-numeric value throw a raw NumberFormatException (carried over as-is during the monolith extraction). Guard it and throw a CloudFormation ValidationError instead, matching how LambdaCfnProvisioner handles ReservedConcurrentExecutions.

Refs #4021
2026-09-21 07:00:19 -04:00
TATSUNO “Taz” Yasuhiro 60fd65b5b6 fix(dynamodb): recompute UpdateTable AttributeDefinitions (#4046)
* fix(dynamodb): recompute UpdateTable AttributeDefinitions

UpdateTable keeps only the definitions a key schema still uses. A definition
sent with the request but used by no key is dropped in the same response, and
deleting a GSI drops the definitions only that index used.

A new index's key attributes must also appear in the request's own
AttributeDefinitions. The stored definitions no longer satisfy the check.

* test(dynamodb): cover an LSI key attribute surviving a GSI delete
2026-09-21 00:14:45 -04:00
Hector Ventura 186a5380d5 fix(cloudformation): validate required fields on AWS::IAM::Policy (#4050)
IamPolicyCfnProvisioner accepted a Policy that AWS rejects: it generated a PolicyName when the property was absent, and it silently created nothing when no principal was named. Now a genuine create missing PolicyName is rejected with ValidationError (the registry required set lists PolicyName, and PutRolePolicy demands it), and a Policy naming none of Roles/Users/Groups is rejected too (AWS requires at least one, mirrored by Terraform's AtLeastOneOf on the attachment).

Updates keep their behavior: a normal update reuses the recorded name, and the legacy managed-policy migration still generates a fresh inline name because its prior id is an ARN, not a usable policy name.

Refs #3971
2026-09-21 00:02:03 -04:00
Hector Ventura f9d1b8101c refactor(cloudformation): hoist resolveOrDefault onto ProvisionContext (#4049)
Seven per-service provisioners (Lambda, StepFunctions, ElbV2, Events, ApiGatewayRestApi, ApiGatewayV2, Cognito) each carried an identical private resolveOrDefault helper, differing only in argument order. Move it to ProvisionContext as an instance method next to resolveOptional and rewrite the 15 call sites to ctx.resolveOrDefault(props, name, default), removing the copies. Behavior is unchanged: the bodies were byte-identical (resolveOptional plus a non-blank fallback).

The monolith's own resolveOrDefault(props, name, engine, default) is left alone: it takes a raw engine rather than a ProvisionContext, is already dead (no callers), and belongs to the later dispatcher-retirement cleanup.

Refs #3885
2026-09-20 23:29:08 -04:00
Hector Ventura 3976f2bd05 fix(cloudformation): tolerate an already-gone REST API on delete (#4047)
ApiGatewayRestApiCfnProvisioner.delete called apiGatewayService.deleteRestApi directly, so a DeleteStack failed if the REST API had already been removed out of band. Route it through CfnDeletes.safeDelete tolerating NotFoundException, matching every other provisioner's delete path. deleteRestApi resolves the id first and raises NotFoundException when the API is gone, and the AWS model declares that error for DeleteRestApi. A real failure (any other code) still propagates so the stack reports DELETE_FAILED.

Refs #3885
2026-09-20 23:22:19 -04:00
Abhigya bf1152e144 feat(ecs): complete the fargate launch surface (#4017)
Floci accepted a Fargate task definition and ran it, but most of the
launch surface was dropped on the way through: members that AWS echoes
back went missing from responses, launch type resolution never validated
what it resolved, and the runtime ignored the sizing the task asked for.

Task definitions. A definition round-trips whole. Members that change
behaviour are typed (ephemeralStorage, dependsOn, environmentFiles, port
mapping name / appProtocol / containerPortRange, pidMode, ipcMode and the
container-level members the parser used to drop); members Floci does not
act on go through EcsJsonPassthrough, so an unimplemented volume
configuration comes back as it was sent rather than vanishing.
compatibilities is derived from the definition rather than echoed from
requiresCompatibilities, requiresAttributes names the capabilities the
definition needs, and a revision carries its registeredAt,
deregisteredAt and deleteRequestedAt through the ACTIVE / INACTIVE /
DELETE_IN_PROGRESS lifecycle.

Validation. Fargate task sizes are validated per CPU architecture and
operating system family, ephemeral storage against its 21-200 GiB range,
container dependencies for unknown names and cycles, and the parameters
Fargate does not support are rejected at registration with the exception
type AWS documents for them, ClientException; the message text is Floci's,
since AWS does not document the wording. Enum-typed members are validated
at parse time and raise InvalidParameterException instead of being
treated as absent, and
tag cardinality and character limits are enforced across the operations
that take tags.

Launch. capacityProviderStrategy is distributed across its providers the
way ECS distributes it, base first and the remainder by weight, with the
cluster's default strategy applying when a request carries neither it nor
a launch type. The strategy is validated against the bounds the ECS model
gives it: at most 20 providers, weight 0 to 1,000, base 0 to 100,000, one
base per strategy, and at least one provider of non-zero weight when a
strategy names more than one, since a provider of weight 0 places nothing
beyond its base. A task's CPU and memory reach the container, an awsvpc
task gets an ENI per task and releases it when it stops, container
dependencies are ordered with cycle detection, and mock mode reports
per-container detail so a client running without Docker sees the same
shape. The ENI allocation reaches into EC2, whose InvalidSubnetID.NotFound
and InvalidGroup.NotFound are not in RunTask's error list, so an unknown
subnet or security group is reported as the InvalidParameterException AWS
returns.

Verified against the AWS SDK for Java v2 and the AWS ECS API reference.
Adds EcsFargateTaskIntegrationTest, EcsFargateTaskDefinitionIntegrationTest
and EcsFargateEdgeCaseIntegrationTest, plus an SDK-based EcsFargateTest in
the compatibility suite.
2026-09-20 22:38:32 -04:00
Hector Ventura 4906b7deed refactor(cloudformation): move CustomResource into CustomResourceCfnProvisioner (#4044)
Extracts AWS::CloudFormation::CustomResource and every Custom::* type out of the CloudFormationResourceProvisioner monolith into a dedicated CustomResourceCfnProvisioner, completing the per-service provisioner migration: every CloudFormation resource type now lives in a provisioner reached through the registry, and the monolith is a thin dispatcher (registry lookup plus the unsupported-type stub).

CloudFormationResourceRegistry.forType routes any otherwise-unmatched Custom:: type to the CustomResource provisioner, with an exact registry entry still winning so Custom::DynamoDBReplica stays on DynamoDbCfnProvisioner. With that, the monolith's provision switch serves no type, and its LEGACY_SWITCH_TYPES and DELETE_NEEDS_STACK_RESOURCE sets are now empty, kept as the guards their tests check. The now-dead lambdaService, iamService, customResourceResponseStore, and reachableEndpoint dependencies are dropped.

The readOnly Id attribute is recorded as a gap: it is the primary identifier returned by Ref (the physical resource id), not a separate Fn::GetAtt value Floci publishes.
2026-09-20 22:34:16 -04:00
Vũ Thế Huy 44fa114483 refactor(cloudcontrol): move library usages to imports (#3902)
* refactor(cloudcontrol): move library usages to imports

* refactor(cloudcontrol): eliminate var declarations and add explicit type imports
2026-09-20 21:16:51 -05:00
Simone Primarosa 7777a97de9 fix(ecr): serve the registry data plane over TLS (#4040)
- Update ECR host routing regex to support <account>.dkr.ecr.<region>.localhost.floci.io
- Populate regional wildcard SANs (*.dkr.ecr.<region>.localhost.floci.io) for all advertised AWS regions
- Add unit tests for hostname matching, malformed host rejection, immutable tag mutability over TLS, and certificate SAN enumeration
- Add Docker integration test verifying end-to-end TLS image push/pull with root CA verification and plain HTTP regression
- Update ECR and TLS user documentation
2026-09-20 22:11:46 -04:00
Priamo Germosen 9dab36197a fix(elbv2): block link-local and metadata targets (#4031)
Reject link-local and cloud instance-metadata addresses in RegisterTargets with InvalidTarget, and resolve target hosts once in the data plane and health checker, connecting to the checked address. Loopback and private ranges stay reachable so a load balancer can front a neighbouring container.
2026-09-20 21:11:27 -05:00
Priamo Germosen a12bf8c96c feat(cognito): enforce app client ExplicitAuthFlows in InitiateAuth and AdminInitiateAuth (#3974)
ExplicitAuthFlows was stored but never checked, so a client that only allowed SRP still accepted USER_PASSWORD_AUTH. When a client lists flows, reject any flow it does not enable with InvalidParameterException. Legacy values (USER_PASSWORD_AUTH, ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY) are honored, and clients created without a list stay ungated.

The Java compatibility test signed in with ADMIN_USER_PASSWORD_AUTH on a client that never enabled it; add ALLOW_ADMIN_USER_PASSWORD_AUTH to that client.
2026-09-20 21:04:55 -05:00
Austin W e14221fe62 feat(sagemaker): support GPU-backed training jobs (#4015)
* feat(sagemaker): support GPU-backed training jobs

ResourceConfig.InstanceType had no effect on the container Floci launched, so
a training job asking for ml.g5.xlarge ran on CPU. This maps the accelerator
half of an instance type onto a real device request, using the container GPU
primitive added in #3789.

On AWS the instance type *is* the hardware, so nothing is configurable. Floci
has one host with fixed cards, so serving a GPU instance type means
substituting a local device, and which devices may be lent out is a local
decision. The two halves are split accordingly:

- How many accelerators an ml.* type carries is a property of AWS, so it ships
  as data in sagemaker/instance-type-catalog.yaml, mirroring how
  Ec2InstanceTypeCatalog already carries vcpu and memory for EC2 types. It is
  kept separate from that catalog because ml.* is its own namespace and must
  never appear in DescribeInstanceTypes.
- Which of this machine's devices may be used is configuration, under
  floci.services.sagemaker.gpu: enabled, mode and devices.

Nothing changes unless enabled is set. It defaults to false, so existing
deployments keep launching CPU-only containers, including for GPU instance
types.

mode exists because daemons disagree on the wire form. It defaults to cdi:
Podman resolves only CDI and accepts a count request while attaching no device
(containers/podman#22645), so preferring CDI turns a misconfiguration into a
refused start rather than a job that quietly trains on CPU. That principle
drives the failure cases too: an unlisted GPU-family type, too few allowed
devices, an explicit mode with no devices, and InstanceCount above one all
fail with a FailureReason instead of falling back to CPU. A job that reports
Completed after training on the wrong hardware leaves an artifact that looks
legitimate, which is worse than an error.

Only the accelerator is substituted. An instance type also implies vCPU and
memory, which this does not emulate, consistent with the rest of the codebase:
EC2 instance types are metadata for DescribeInstanceTypes and never size a
container, RDS records DBInstanceClass without acting on it, and Lambda, ECS
and Batch apply limits only where an API supplies an explicit number.

Endpoint hosting is unchanged and still CPU-only; the resolver is a separate
bean so it can be reused there in a follow-up.

* test(sagemaker): cover the GPU refusal paths and the hardware path

The GPU feature shipped with unit coverage on the resolver only, so nothing
exercised it through CreateTrainingJob. These add both halves.

SageMakerGpuIntegrationTest runs everywhere. Every path that refuses a request
raises inside SageMakerGpuResolver, before the runner asks the daemon for
anything, and the removeIfExists above it already swallows a missing daemon, so
an unlisted GPU family, InstanceCount above one, and cdi mode with no configured
devices all reach their verdict on a plain runner. A fourth case pins the
contract that enabling the feature leaves CPU instance types alone.

SageMakerGpuDockerIntegrationTest is opt-in behind -Dgpu.integration.enabled,
matching ContainerGpuDockerIntegrationTest, because it needs hardware no CI
runner has. Verified against an RTX 5060 Ti through Podman 5.8.2: the container
saw exactly the device named in gpu.devices and not the host's other card.

The assertion is the container's exit code. nvidia-smi output is redirected
rather than piped: a pipeline exits with the status of its last command, so
'nvidia-smi -L | tee' reports success even when nvidia-smi cannot reach the
driver, which would be this test passing on a CPU container.

* fix(sagemaker): package the instance type catalog in the native image

SageMakerInstanceTypeCatalog reads sagemaker/instance-type-catalog.yaml through
a constant, which Quarkus's static resource analysis cannot follow, and no glob
under quarkus.native.resources.includes matched it. The file was therefore left
out of the native image, so enabling floci.services.sagemaker.gpu.enabled there
would have failed every training job at catalog load with 'Missing catalog
resource sagemaker/instance-type-catalog.yaml'. Ec2InstanceTypeCatalog reads its
own catalog the same way and ec2/*.yaml was already listed for exactly this
reason.

Nothing caught it: JVM tests resolve the file from src/main/resources, and the
hardware verification ran a JVM-mode image, so the gap existed only in the
artifact neither exercised.

NativeImageResourceIncludesTest closes that gap the way
NativeImageRuntimeInitializationTest closes the Random-in-the-image-heap one, by
moving a native-only failure into ordinary CI. It pairs each resource-path
constant passed to getResourceAsStream with the includes globs and fails when
none matches, skipping the IAM catalog that application.yml already documents as
build-time only.

* refactor(sagemaker): match EC2's case handling for instance types

isAcceleratorFamily folded case while gpuCount did not, so ML.G5.XLARGE was
answered as a GPU family and then reported as missing from the catalog, pointing
the caller at the wrong fix.

Ec2InstanceTypeCatalog is the precedent and normalizes in neither position:
find() looks the type up exactly and familyOf() splits on the first dot without
folding. AWS instance types are exact tokens. The repo folds case where AWS
defines a value as case-insensitive, such as ACM domain names, regions and
content types, which an instance type is not.

Dropping the fold rather than adding one to gpuCount keeps both halves agreeing
and keeps the pair behaving like EC2's.

Also drops the @DisplayName from SageMakerGpuResolverTest. The suite does not
use them anywhere else; the method name carries the intent.

* docs(sagemaker): clarify GPU training device reuse
2026-09-20 17:56:43 -04:00
Simone Primarosa 5a8ffd0272 feat(eks): implement pod identity association management (#4012)
* feat(eks): implement pod identity association management

* fix(eks): use instance SecureRandom for native image compatibility
2026-09-20 17:54:41 -04:00
Hector Ventura 648ea26cc9 refactor(cloudformation): move Lambda types into LambdaCfnProvisioner (#4032)
Extracts AWS::Lambda::Function and AWS::Lambda::LayerVersion out of the CloudFormationResourceProvisioner monolith into a dedicated LambdaCfnProvisioner, continuing the per-service provisioner migration. Behavior is preserved: create, in-place configuration and code update, replacement on a FunctionName or PackageType change, reserved concurrency, layer publication, and the legacy name-mode inference all move unchanged.

Moving AWS::Lambda::Function into the registry subjects it to the schema-coverage gate: its readOnly Arn is set as before, and SnapStartResponse is recorded as a gap since Floci does not emulate Lambda SnapStart. InlineZipPackager is made public so the extracted provisioner can reach it. The monolith's now-dead s3Service and lambdaLayerService dependencies are dropped; lambdaService stays for the custom-resource handler.
2026-09-20 17:51:33 -04:00
Abhigya a0089b3548 fix(elbv2): stop mutating immutable fallbacks on the delete paths (#4030)
DeleteListener and DeleteLoadBalancer took their region map with
getOrDefault(region, Map.of()) and then removed from it. For a region
that has no map yet, that removes from the immutable Map.of() sentinel
and throws UnsupportedOperationException, which the Query path reports
as InternalFailure with a null message. The Terraform AWS provider
treats InternalFailure as retryable, so a teardown against an untouched
region polls "Still destroying..." instead of failing.

Both methods now look the region map up and return when it is absent,
which is the same no-op AWS performs for a resource that is not there.
The listener and rule maps that the cascade writes back use
computeIfAbsent, matching the create paths: getOrDefault would have
stored the immutable sentinel as the region's value, so every later
call for that region would fail the same way, including CreateListener.

The two ARN indexes had the same defect with List.of(), so the removal
goes through a helper that looks the list up instead.
2026-09-20 17:38:36 -04:00
David 628952ecf0 feat(glue): catalog resource policy and Data Catalog encryption settings (#4027)
* feat(glue): catalog resource policy and Data Catalog encryption settings

Add PutResourcePolicy, GetResourcePolicy, GetResourcePolicies and
DeleteResourcePolicy with the PolicyExistsCondition and
PolicyHashCondition checks Terraform relies on, and Get/Put
DataCatalogEncryptionSettings with the documented defaults.

ConnectionPasswordEncryption is applied rather than stored: while it is
on, CreateConnection and UpdateConnection encrypt PASSWORD and the four
Kafka passwords with the configured KMS key and keep them under their
documented ENCRYPTED_* names, so reads return the ciphertext and a
missing key is GlueEncryptionException.

Closes #4023

* docs(glue): cite the source for connection password encryption timing and drop an unsourced claim

The developer guide states that whether a password is encrypted was
decided when the connection was created or updated, which is the
source for connections keeping their plaintext; the missing-key error
is described as the error CreateConnection and UpdateConnection list
rather than as AWS behaviour. Also replaces a var in the compat test
with the explicit type.
2026-09-20 17:32:36 -04:00
Priamo Germosen 2d56d85e9e fix(cognito): accept USER_SRP_AUTH in AdminInitiateAuth (#3973)
AdminInitiateAuth documents USER_SRP_AUTH as a valid AuthFlow, but only the ADMIN_USER_SRP_AUTH spelling, which is not an AuthFlowType value, was mapped. Accept the SDK spelling alongside it.
2026-09-20 16:56:58 -04:00
Matheus André db2e0ab8d7 fix(cognito): omit AvailableChallenges from RespondToAuthChallenge responses (#4025)
AvailableChallenges is declared on InitiateAuthResponse and
AdminInitiateAuthResponse only, but the SELECT_CHALLENGE path copied it
onto the RespondToAuthChallenge and AdminRespondToAuthChallenge
responses as well. Keep it on the InitiateAuth responses and drop it
from the challenge responses issued when answering SELECT_CHALLENGE.

Closes #4003
2026-09-20 16:46:07 -04:00
Matheus André 173854cdeb fix(lifecycle): run afterReset on every Resettable when a beforeReset throws (#4024)
performReset stops every managed container first, then walks the
Resettable list and adds each service to `prepared` right before calling
its beforeReset(). When one beforeReset() threw, the loop stopped and
every later service was never added, so the finally block skipped their
afterReset(). Their teardown had already run, though: the SageMaker
training runner and endpoint manager had shut their worker pools down
and EcsService had stopped its reconciler, and those are only restored
in afterReset() (#3937). After such a reset every CreateTrainingJob,
CreateEndpoint and UpdateEndpoint returned 500 with
RejectedExecutionException and ECS services were never reconciled again
until the process restarted.

The finally block now runs afterReset() over the full service list in
reverse order, dropping the `prepared` list. afterReset() already had to
tolerate a reset that failed before clear(); tolerating one that failed
before beforeReset() is the same contract, and the Resettable Javadoc
now says so. A controller test registers a Resettable whose
beforeReset() throws between two others and asserts that the error is
rethrown, the wipe and clear() are skipped, and afterReset() still runs
on all three, including the one whose beforeReset() never ran.

Closes #3952
Closes #3796
2026-09-20 16:41:37 -04:00
vamsiakandVamsi Akavarapu 4c64f2e397 fix(stepfunctions): preserve object details in PutEvents (#4022)
Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-09-20 16:39:03 -04:00
XuJian eb18b4ab1f fix(cloudfront): preserve policy configurations (#4009)
* fix(cloudfront): preserve policy configurations

* fix(cloudfront): align policy config edge cases
2026-09-20 16:33:18 -04:00
XuJian b791e04566 fix(transfer): preserve server detail structures (#3928)
* fix(transfer): preserve server detail structures

* fix(transfer): preserve endpoint detail value types
2026-09-20 16:29:58 -04:00