Commit Graph
666 Commits
Author SHA1 Message Date
TATSUNO “Taz” Yasuhiro 9b59b8997e feat(dynamodb): add on-demand backups (#6052)
* feat(dynamodb): add on-demand backups

Add CreateBackup, DescribeBackup, ListBackups, DeleteBackup and
RestoreTableFromBackup. A backup keeps a copy of the table settings and
items from the time of the call, and it outlives the table.

The restored table keeps the keys, indexes, billing mode, throughput and
encryption. It drops the stream, TTL, point-in-time recovery, tags,
deletion protection and table class, as on AWS. A GSI or LSI override
must match a source index by key schema and projection, and a vector
index override must match one by name. Error wording and check order
follow AWS.

A restore finishes before the response is sent. The response still says
CREATING with RestoreInProgress true, as on AWS.

Part of #4521.

* feat(dynamodb): check the throughput members of a restore override

* test(dynamodb): tolerate only missing resources in the backup test cleanup

* feat(dynamodb): follow the AWS rules for on-demand restore overrides
2026-10-20 07:18:23 -04:00
Jackson Price 9f99c7c2c2 fix(ec2): report image creation provenance and its three filters (#6059)
* fix(ec2): report image creation provenance and its three filters

DescribeImages never returned SourceImageId, SourceImageRegion or
SourceInstanceId, and the source-image-id, source-image-region and
source-instance-id filters matched every image.

- A CreateImage AMI reports the instance it captured, and the AMI that
  instance was launched from with its region.
- A CopyImage AMI reports the AMI it copied and its SourceRegion, and no
  instance.
- Both name the source by its AMI id, also when the request used a
  catalog alias, and keep naming it after the source is deregistered.
- Registered and catalog AMIs report none. The filters match only
  images that carry the field, so the image DescribeImages makes up for
  a CDK lookup or an unknown launchable id no longer passes them.

The fields are stored apart from the flattened ancestor Floci launches
from, so a copy of a copy names its immediate source and still boots
the right base image. Images saved before this change load without
provenance.

Split out of #5663 at review.

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

* fix(ec2): accept a catalog alias in the source-image-id filter

An instance launched by a catalog alias such as ami-amazonlinux2 keeps
the alias as its ImageId, while the AMI captured from it records the
AMI id the alias names. Filtering on the instance's ImageId therefore
found nothing, where on AWS the two are always the same id.
source-image-id now matches the recorded id or any alias of it, as
image-id already does for catalog images.

Review follow-ups in the same area:
- a test pins the catalog branch of source-image-region, and the
  restart test names the flattened ancestor it expects;
- the detached-storage test double copies the provenance fields;
- the provenance test cleans up each resource independently, and the
  compatibility test deletes the copy's snapshot;
- the AMI docs list CopyImage and DeregisterImage and say the filter
  takes an alias.

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

* test(ec2): pin wildcard alias matching in source-image-id

The provenance test now checks that a wildcard on a catalog alias finds
a capture, as it does for image-id, and reads the source-image-region
result once. The DeregisterImage row in the AMI docs says a snapshot
another AMI still uses is kept even with DeleteAssociatedSnapshots.

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

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-20 07:12:21 -04:00
Andre Kurait be2cb677d0 feat(resourcegroups): support EC2 capacity reservation pools (#6011)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-20 00:04:50 -04:00
David Phillips 0da0c80824 feat(elbv2): terminate HTTPS with ACM and IAM certificates (#5959)
* feat(elbv2): serve HTTPS listeners with ACM and IAM certificates

Route HTTPS traffic with SNI and refresh certificates when they change.

* fix(elbv2): preserve attached ACM certificates

Refuse revocation while a listener uses the certificate and keep
certificate listings responsive when many listeners are configured.
2026-10-19 23:40:17 -04:00
Allen Sanborn 2f6f3a8f86 feat(route53resolver): add TagResource, UntagResource and ListTagsForResource (#6035)
* feat(route53resolver): add TagResource, UntagResource and ListTagsForResource

The Terraform provider lists tags after creating any aws_route53_resolver_*
resource, and Route 53 Resolver had no tagging operations, so the apply failed
right after the create succeeded.

Tags are kept per ARN in their own store, because none of the modelled
resource shapes carries a Tags member. Resolver endpoints, resolver rules and
custom firewall domain lists are taggable; tags passed to their Create calls
are stored, and validated before anything is allocated. Lookup resolves the id
in the caller's account and requires the stored ARN to match exactly, so an
ARN naming another account, region or partition is ResourceNotFoundException.
ListTagsForResource pages with MaxResults (1-100, default 100) and NextToken.

* fix(route53resolver): scope tagging lookups to the caller and type-check tag input

TagResource, UntagResource and ListTagsForResource now require the ARN to
name the caller's own partition, region and account before reading any
store, and fetch the resource with getForAccountMigratingLegacy, so an
unprefixed pre-multi-account entry is migrated only into the account its
stored ARN names. Before, a plain get() moved such an entry into whichever
account looked it up first, and that account could then tag it by naming
its original ARN.

Tag Key and Value, and each UntagResource TagKeys entry, must be JSON
strings (TagKey/TagValue are string shapes) instead of being coerced with
asText(). MaxResults must be an integral number before its 1-100 range is
checked, so 1.5 or true is InvalidParameterException rather than 1.

ListTagsForResource copies the stored tag node under the monitor that
TagResource and UntagResource mutate it under, so a concurrent tag change
can no longer break the iteration or show a half-applied page.

* fix(route53resolver): page tags through Pagination and cap tag lists at 200

ListTagsForResource now pages through the shared Pagination.paginate with
an opaque, namespaced cursor on the tag key instead of a raw offset, so a
forged or stale offset token is InvalidNextTokenException. MaxResults stays
type-checked against the JSON value (integer 1-100, InvalidParameterException).

TagResource Tags, UntagResource TagKeys and the Tags on CreateResolverEndpoint,
CreateResolverRule and CreateFirewallDomainList are capped at the modelled 200
entries per request (TagList/TagKeyList max 200). Over the cap is the
operation's parameter error: InvalidParameterException, or ValidationException
on CreateFirewallDomainList. No per-resource total is enforced; the model does
not state one.
2026-10-19 22:45:48 -04:00
Alessandro Lattao e38ec02d44 fix(cloudformation): register an ECS task definition's containers with their LinuxParameters (#6027)
* fix(cloudformation): register an ECS task definition's containers with their LinuxParameters

An AWS::ECS::TaskDefinition dropped its containers' LinuxParameters, so
a container CloudFormation registered ran without the init process,
capabilities, devices, shared memory, swap or tmpfs mounts the template
asked for, and the Fargate rules on them never applied.

They are now read from the task definition as the ECS handler converts
it and kept where RegisterTaskDefinition keeps them, among the
container's unparsed members under linuxParameters, so
DescribeTaskDefinition returns them in the API's shape and the same
validation, normalisation and Fargate checks apply as for a definition
registered through the API. As CloudFormation's handler does
(measured), the devices and tmpfs lists are sent empty when the
template has none.

* test(compat): wait for the LinuxParameters stacks through TestFixtures

Review of #6027: the test's private waitForTerminal and waitForDeleted
repeated TestFixtures.awaitStackTerminal. It now waits through that, and
deletes its two stacks with a plain DeleteStack after the class, as
CloudFormationEcsTaskDefinitionModelTest does.

* test(compat): give the ECS CloudFormation stacks Floci's and AWS's own timeouts

Review of #6027: DEPLOY_TIMEOUT was 30 seconds against both targets.
These stacks finish in milliseconds on Floci, so it is now 10 seconds
there and 10 minutes on real AWS, as CloudFormationEventsRuleTargetTest
splits it. CloudFormationEcsTaskDefinitionModelTest, from #6018, had the
same single 60 seconds and splits the same way.
2026-10-19 22:32:16 -04:00
Jackson Price e520166170 fix(ec2): protect subnets and VPCs that load balancers use (#5663)
* fix(elbv2): protect subnets and VPCs that load balancers use

DeleteSubnet and DeleteVpc returned success while an Application or
Network Load Balancer still used the subnet, and DescribeLoadBalancers
went on listing a subnet that no longer existed. EC2 now asks each
VpcDependencyProvider, implemented by ELBv2, before deleting a subnet or
VPC, under the lock CreateLoadBalancer and SetSubnets hold while they
record their subnets, and refuses with DependencyViolation. Covered end to
end through CloudFormation, including updates, rollbacks and stack
deletes that move or delete load balancers, subnets and VPCs.

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

* fix(cloudformation): record the subnets a load balancer is on

A load balancer's attributes named none of its subnets, so once a
template stopped naming it, the stack walks had nothing to order it by
and deleted it after them, which EC2 now refuses. The provisioner keeps
one hidden uses attribute per subnet, refreshed when an update moves the
balancer and when a rollback moves it back.

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

* fix(cloudformation): delete removed resources dependents first

The update cleanup deleted removed and condition-disabled resources in
reverse map order, before the replacement cleanup. A subnet an earlier
update added sits after the load balancer it moved onto it, so removing
both deleted the subnet first, and a renamed balancer's old entity still
used a subnet the same update dropped. Both now end DELETE_FAILED, since
EC2 refuses to delete a subnet a load balancer uses.

The removed resources are now walked in dependency order, and a failed
delete is tried once more after the replacement cleanup before it is
reported.

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

* docs(ec2): name every ELBv2 load balancer type as a subnet dependency

The DeleteSubnet and DeleteVpc rows named only Application and Network
Load Balancers, while the check counts every ELBv2 type. The SDK
lifecycle test now deletes its subnets and VPC even when an assertion
fails.

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

* test(cloudformation): pin the order of the removed-resource deletes

The removal test passed through the retry alone, so it now checks that
the load balancer is deleted before its subnet is tried, and that the
replaced balancer's old entity goes before the dropped subnet. The
provisioner attribute test reads only what Fn::GetAtt can see, with the
balancer on subnets.

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

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-19 21:13:00 -04:00
David Phillips 0f4f59bbbb fix(elbv2): require an HTTPS default certificate (#5989)
* fix(elbv2): require an HTTPS default certificate

Refuse HTTPS listener changes until a default certificate is supplied.

* docs(elbv2): keep certificate checks documented correctly
2026-10-19 21:12:16 -04:00
Mario Toffia 34d904fde5 feat(iot): search fleet things by connectivity status (#6025)
* feat(iot): search fleet things by connectivity status

SearchIndex refused every connectivity field and its documents carried
no connectivity, so an application that finds its things by connection
state got InvalidQueryException.

With connectivity indexing on, a thing now reports the MQTT broker
session whose client id is its name, and connectivity.connected,
connectivity.clientId and connectivity.disconnectReason can be
searched. The other connectivity fields are still refused with
InvalidQueryException. A thing whose client id never connected reports
connected false and timestamp 0, as on AWS.

The broker now records the account, region, connect time, keep alive
and clean session of each session, and keeps in memory how the last
one of each client id ended in each account and region, until a state
reset. The reason is the one the session's disconnected lifecycle
event carries, recorded by the same single endSession under the
session lock, so the late end of a displaced session cannot overwrite
its successor's. A plaintext session counts in the default account and
region, a TLS session in its certificate's.

Closes #4912

* fix(iot): serialize connectivity reads and resets with session ends

A connectivity lookup read the live session without the session lock,
so a search racing DeleteConnection could see the session connected
after its disconnect was recorded. A state reset cleared the history
without the lock too. Both now run under the session lock; the lookup
tests the session's ended flag instead of the endpoint, as the lock is
never held across endpoint calls.

Tests cover the reset contract, a lookup and a reset racing a held
DeleteConnection, and a TLS session counting in its certificate's
account and region.
2026-10-19 19:45:53 -04:00
Hector Ventura 1eb402d623 fix(ec2): keep tags in the region of the resource they label (#5973)
* fix(ec2): keep tags in the region of the resource they label

DescribeTags listed every region's tags because the tag store was keyed by
the bare resource id. Tags are now stored per region, so DescribeTags,
DeleteTags, CreateTags and the aws:ResourceTag IAM condition only see the
request region's tags. Each side of a cross-region transit gateway or VPC
peering connection keeps its own tags in its own region.

Tags stored by bare id are moved under their resource's region at startup,
for every account; a tag whose resource no region holds is dropped.

DescribeTags now reports image, volume, snapshot, network-acl,
vpc-peering-connection and spot-instances-request instead of "unknown".
Tags given when a volume or peering connection is created reach the store,
and DescribeVolumes, DescribeSnapshots and DescribeSpotInstanceRequests show
later CreateTags and DeleteTags changes.

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

* fix(ec2): remove tags with their resource and keep node and catalog AMI tags on upgrade

Deleting a volume (directly or as a delete-on-termination volume of a
terminated instance), a snapshot with its image or a VPC peering connection,
and pruning a terminated instance, now removes the resource's tags, both
peering sides included.

The startup migration no longer drops tags it cannot place in a store: a
catalog AMI's tags move to the default region, and an instance's are kept
until its EKS node is found in a region, which then claims them.

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

* fix(ec2): file a cluster node's legacy tags under its own region

A region-less findInstanceById reaches the EKS provider, which answers from any region, so the claim moved the node's legacy tags under a null region where DescribeTags never finds them. The claim now uses the instance's own region, and with no region known it reads the legacy tags in place for a regional lookup to claim.

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

* fix(ec2): pass the region in the query GET resource-tag stub

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

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-19 19:13:38 -04:00
andrehoong-px 5774e7db8d feat(cloudformation): support S3 Vectors resources (#5853)
* feat(cloudformation): support S3 Vectors resources

* fix(cloudformation): validate S3 Vectors encryption settings

* fix(cloudformation): align S3 Vectors provisioning contracts

* fix(cloudformation): restore S3 Vectors properties on rollback
2026-10-19 18:16:10 -04:00
Allen Sanborn fb390968d5 feat(guardduty): support publishing destinations (#6016)
* feat(guardduty): support publishing destinations

Add CreatePublishingDestination, DescribePublishingDestination,
UpdatePublishingDestination, DeletePublishingDestination and
ListPublishingDestinations under /detector/{detectorId}/publishingDestination.
Previously these returned UnknownOperationException, which broke
Terraform's aws_guardduty_publishing_destination.

Destinations are stored per detector through StorageFactory, so they follow
the detector's account and region scoping, survive a persistent-storage
reload, and report PUBLISHING on create (the state Terraform's create waiter
targets). A missing destination returns BadRequestException with the message
the Terraform provider matches for not-found. Deleting a detector removes its
destinations.

clientToken makes create idempotent and is capped at the model's 64
characters, measured in code points as the model's length constraint is.
destinationArn stays optional on create: the GuardDuty model marks
DestinationProperties.DestinationArn and KmsKeyArn as not required
(botocore guardduty/2017-11-28 service-2.json).

The service gains a five-store constructor; the existing three- and
four-store (malware protection plan) constructors delegate to it.

Closes #4983

* docs(guardduty): update the service matrix operation count

* test(guardduty): cover the publishing destination lifecycle through the SDK

Create, describe, update, list and delete an S3 publishing destination
with the AWS SDK v2 GuardDuty client, asserting the shapes as the SDK
reads them, including the required publishingFailureStartTimestamp.
2026-10-19 16:45:15 -04:00
Alessandro Lattao 28799ed352 fix(apigatewayv2): answer an HTTP API's Lambda proxy body it cannot read with 500 (#6012)
* fix(apigatewayv2): answer an HTTP API's Lambda proxy body it cannot read with 500

Review of #5985: the catch at the end of buildProxyResponse still
answered an HTTP API with 502 and the function's output, for example
when isBase64Encoded is set on a body that is not base64.

Measured on HTTP APIs (eu-west-1), with payload formats 1.0 and 2.0:
API Gateway answers 500 with {"message":"Internal Server Error"} a body
that is an object or a list, an isBase64Encoded it cannot read as a
boolean, and a body said to be base64 that does not decode. It reads
isBase64Encoded's text as Go's strconv.ParseBool does: "True", "TRUE",
"t" and 1 are true, "F" and 0 false, and "tRuE", "yes", 2 and 1.5 are
not read. Floci read true, the text "true" and any integer but 0 as
true, so it relayed "True" and "t" bodies undecoded, "yes" ones as
plain text, decoded a body under 2, and answered an object body 200
with an empty body. A number or a boolean body is still its text.

The catch now answers an HTTP API with the same 500 for a result Floci
cannot parse at all; a REST API keeps its 502.

* refactor(apigatewayv2): decode an HTTP API's base64 body once

Review of #6012: the readability check decoded a base64 body that the
response then decoded again, a second decode and array for every
encoded reply. The catch at the end of buildProxyResponse already
answers an HTTP API with 500 and the generic message, so the check now
looks only at the body's shape, and a body said to be base64 that does
not decode fails where it is decoded and reaches that catch.
2026-10-19 16:40:26 -04:00
Allen Sanborn 65e35adf54 feat(backup): add CreateLogicallyAirGappedBackupVault (#6015)
* feat(backup): add CreateLogicallyAirGappedBackupVault

Route PUT /logically-air-gapped-backup-vaults/{name}. The vault shares the
standard vault namespace and ARN shape; DescribeBackupVault reports VaultType
LOGICALLY_AIR_GAPPED_BACKUP_VAULT, VaultState and the retention days. Both
retention values are required, MinRetentionDays >= 7, MaxRetentionDays >= Min.

The vault is locked at creation so the existing retention enforcement applies,
vault-lock put/delete are rejected on it, and ListBackupVaults honours the
vaultType filter.

Closes #4986

* docs(backup): correct the service matrix operation count

* fix(backup): fail a job whose vault was replaced before it completed

A backup job resolved its vault by name at completion. Deleting a
logically air-gapped (or locked) vault while a job was in flight is
allowed, since it holds no recovery point yet; recreating the name as a
standard vault then received the old job's recovery point, which the
unlocked replacement let be deleted inside the original vault's minimum
retention.

Completion now checks, under the vault-name monitor, that the vault
holding the name is the incarnation the job started in. If not, the job
ends FAILED with no recovery point, as it cannot land in a vault that no
longer exists.

* fix(backup): air-gapped vault LockDate at creation; standard vault VaultType BACKUP_VAULT

CreateLogicallyAirGappedBackupVault now sets LockDate to the creation
date, so the vault's lock reads as compliance mode (immutable) rather
than a governance lock with no LockDate. DescribeBackupVault and
ListBackupVaults report VaultType BACKUP_VAULT for standard vaults,
filled at read time so vaults stored with no VaultType are covered.
2026-10-19 16:24:05 -04:00
Mario Toffia 87aa6f38a1 feat(iot): publish connection lifecycle events (#5277)
* feat(iot): publish connection lifecycle events

The MQTT broker publishes $aws/events/presence/connected and disconnected
for every session, with its session identifier, certificate principal,
version number and disconnect reason, through topic rules and to
subscribers. Topic filters starting with a wildcard no longer match $ topics,
as on AWS.

Closes #5275

* fix(iot): keep lifecycle events within the reset guard

A lifecycle event admits its topic rules under the rule state at the time
of the event, so one queued before an emulator reset skips them. A
DeleteConnection that wins the session tolerates an endpoint the client's
DISCONNECT already closed.

* fix(iot): serialize session transitions and report keep-alive timeouts

Admission, takeover, DeleteConnection and session end now allocate the
versionNumber and change the session map under one lock, with endpoint
I/O kept outside it. A takeover of an endpoint that is already closed
still accepts the new connection.

A close after a full keep-alive period without a packet from the client
is reported as MQTT_KEEP_ALIVE_TIMEOUT, as AWS IoT does. The WebSocket
upgrade carries the client's port, and the wildcard-first exclusion is
limited to the lifecycle topics, which AWS does not deliver to such
filters while it does deliver shadow topics.

* fix(iot): keep ended sessions out of subscriptions and time keep-alive from CONNECT

* test(iot): drive keep-alive tests from an injected nano-time source

The broker takes a LongSupplier nano-time source, as ReloadingKeyManager
does, so the keep-alive unit tests move a fake clock forward instead of
sleeping. The race test uses ThreadStates.awaitBlockedOrDone.
2026-10-19 16:18:54 -04:00
Alessandro Lattao fcb41966a8 fix(cloudformation): read an ECS task definition's properties as the ECS handler does (#6018)
Measured on CloudFormation (eu-west-1): an AWS::ECS::TaskDefinition gets
no template validation. CloudFormation hands the ECS handler every
scalar as text, and the handler converts each to the type the resource
schema declares: an integer is a sign and digits once trimmed, within
32 bits ("+128", " 128", "0128"), and a boolean is true or false in
lower, upper or title case once trimmed. A value it cannot convert
("abc", 4.5 or true for an integer, "yes", "tRuE" or "1" for a
boolean), and an object, a list and a scalar standing for one another,
fail the resource with every violation of the unconverted model, where
every scalar is a String, so a Memory of 128 is listed beside the value
that failed. At each object its missing required members come first,
then its members in the schema's order. When every value converts, the
required members the model lacks fail it alone, grouped where their
paths meet as the schema validator groups them.

Floci read the properties as plain JSON: a Memory of "abc" and a
container without an image were registered, and an Essential of
"False" registered an essential container.

AWS::ECS::TaskDefinition joins the generated cfn-property-types.json,
whose structures now carry the members the schema requires, read into
RequestShapeModel's shapes. CfnPropertyTypes' walk over the shapes is
shared by the template validation Reader and the new HandlerReader,
which differ in how a scalar converts and in what a mismatch does.
2026-10-19 16:15:05 -04:00
Alessandro Lattao e5a206554f refactor(cloudformation): read property types from the vendored resource schemas (#5988)
* refactor(cloudformation): read property types from the vendored resource schemas

Follow-up asked on #5958: the types EventsCfnProvisioner checked a rule
target's members against were written by hand from describe-type, and
LambdaCfnProvisioner named the JSON type of each property it reads. They
now come from src/main/resources/aws/cfn-property-types.json, which
tools/aws/regen_cfn_property_types.py generates from the resource
schemas AWS publishes for us-east-1, in the request shapes' layout so
RequestShapeModel reads it: a structure, list, map or scalar per shape,
and "json" for what a schema leaves free.

The schemas come from AWS's live archive rather than a pinned package.
cfn-lint ships copies, but widens some types: a Lambda environment
variable's value takes any JSON type there and a string in the published
schema, where CloudFormation refuses an object or a list with "Property
[AB] expected type: String, found: JSONObject" (measured). The archive
keeps no older copy, so the generator follows the IAM data's split:
--check is offline and structural and runs on every pull request,
--verify compares a fresh generation with the vendored file and runs in
cfn-schema-drift.yml, weekly and on changes to the file or its generator.

CfnPropertyTypes.Reader walks the vendored shapes instead of type trees,
maps included: a map's values are read as its value shape, and a
mismatch names the key, as CloudFormation does ("Property [h] expected
type: String, found: JSONObject", measured). Every member of a rule
target is now read against its schema type, not only the four #5958
typed, and Lambda reads the properties it already typed through the same
reader, nested members included (VpcConfig.SubnetIds, EphemeralStorage.
Size, ImageConfig.Command, TracingConfig.Mode, Environment.Variables).
The messages for the newly checked members were measured on
CloudFormation (eu-west-1) and are in the tests.

* fix(cloudformation): keep a literal list's blank entries where the template put them

Review of #5988: the reader read every list of strings through the
engine's resolveStringList, which drops blank entries, so a rule
target's HttpParameters.PathParameterValues ["", "b"] became ["b"]
and moved "b" into the first wildcard. CloudFormation passes a literal
list on as written (measured: SecurityGroups ["", "sg-..."] reaches the
target as both). A literal list is now read through the engine's new
resolveLiteralList, which keeps blanks and still expands a list-valued
intrinsic in place; a list an intrinsic yields keeps the engine's
reading. Lambda's literal lists, read through the same reader, keep their
blanks too, for Lambda to judge as on AWS.

resolveLiteralList delegates to the private resolveListElements rather
than opening it: tests that mock the engine and call resolveStringList's
real code would otherwise get the mock's empty list from it, as
IamUserCfnProvisionerTest did.

* refactor(cloudformation): read a launch configuration's MetadataOptions by its schema shape

Review of #5988: #5964, merged after this branch opened, read
AWS::AutoScaling::LaunchConfiguration's MetadataOptions through the type
trees this PR removes. The generator now vendors that resource type too,
and AutoScalingGroupCfnProvisioner reads the block by the shape its
published schema declares (HttpTokens and HttpEndpoint strings,
HttpPutResponseHopLimit an integer, the same types #5964 wrote by hand),
so its tests pass unchanged. The hop limit's type is an anchor of the
generator's offline check.
2026-10-19 12:40:17 -04:00
TATSUNO “Taz” Yasuhiro 2bb69a030b fix(s3): keep a percent sign in a virtual-hosted object key (#6000)
* fix(s3): keep a percent sign in a virtual-hosted object key

A virtual-hosted request for a key such as a%/b failed with 400 or 500.
The same request in path style worked. S3 stores the key as sent in
both styles.

RESTEasy keeps the decoded path of a rewritten request URI and later
decodes it again. S3VirtualHostFilter now escapes the raw path once more,
so routing sees the same path as a path-style request. The request URI
then decodes to /<bucket> plus the raw path, so the virtual-hosted key
check compares against the decoded path.

Fixes #5997

* test(s3): keep only the percent-key cases that guard the fix
2026-10-19 10:57:03 -04:00
Mario Toffia c145fa104c fix(ssm): normalize parameter resource ARNs (#5261)
* fix(ssm): normalize parameter resource ARNs

A parameter's ARN is now arn:<partition>:ssm:<region>:<account>:parameter/<name
without leading slash> for both top-level names and paths, matching AWS. Before,
a top-level name such as foo got parameterfoo.

SsmService.parameterResource(name) is the single formula, used by PutParameter
and by the AWS::SSM::Parameter provisioner, so the CloudFormation Arn attribute
equals the GetParameter ARN.

Tag operations and the internal getParameter(nameOrArn, region) read resolve an
ARN to the stored name and, for parameter/x when only x is stored, fall back to x,
so a top-level parameter is found by its ARN, also with a :version or :label
selector. ECS task secrets pass valueFrom to
that read whole instead of stripping only ":parameter". Legacy parameterfoo ARNs
still resolve.

* test(cloudformation): share the CloudFormation Query request builder

Six CloudFormation integration tests each carried a private copy of the
same Query request builder, as cfn or request. CfnRequests.cfn in testing
replaces them, as RdsRequests.rds does for RDS. A null stack name leaves
StackName out, which the ContinueUpdateRollback validation test needs.
2026-10-19 09:46:50 -04:00
Jackson Price e75b15809f fix(autoscaling): honor launch configuration metadata options (#5964)
* fix(autoscaling): honor launch configuration metadata options

CreateLaunchConfiguration ignored MetadataOptions, so
DescribeLaunchConfigurations never returned them and every instance
launched from the configuration got EC2's defaults, HttpTokens=optional
included.

- The Query handler and the AWS::AutoScaling::LaunchConfiguration
  provisioner read the structure, validate it as EC2 does
  (ValidationError for a value outside the allowed set or range) and
  store it. CloudFormation resolves Fn::If and AWS::NoValue inside it.
- DescribeLaunchConfigurations returns the structure with defaults for
  the members left out, and omits it when it was never given.
- The reconciler passes it to every launch, instance refresh
  replacements included.
- Auto Scaling launches from a launch template, directly or through a
  mixed instances policy, and CreateFleet forward the template's
  metadata options, which they dropped before.

Split out of #5671 at review.

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

* test(autoscaling): clean up after the launch configuration metadata tests

The metadata tests now delete the groups, launch configurations and
stacks they create, so later reconcileAll calls in the shared test
application stop reconciling leaked groups. They build their
Authorization headers with EnforcementFixtures.auth, and the case that
expects no MetadataOptions first checks that the launch configuration
was found.

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

* fix(autoscaling): word metadata option errors as Auto Scaling does

CreateLaunchConfiguration refused bad MetadataOptions with EC2's
InvalidParameterValue text under a ValidationError code. It now answers
with Auto Scaling's model-validation text, for example "1 validation
error detected: Value '65' at 'metadataOptions.httpPutResponseHopLimit'
failed to satisfy constraint: Member must have value less than or equal
to 64", and reports every invalid member of the structure in one
error, "N validation errors detected: ...; ...". EC2's validator is no
longer shared.

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

* fix(cloudformation): refuse list or object launch configuration metadata members

A MetadataOptions member given as a list or an object, such as
HttpTokens: [required], read as an empty string and so as absent: the
launch configuration was created with that member at its default,
HttpTokens=optional included. Such a member now fails the resource with
ValidationError, as the whole structure already does when it is not an
object.

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

* test(autoscaling): cover every metadata member in the combined error

The test that sends several invalid MetadataOptions members now makes
all three invalid, so the position of HttpEndpoint in the combined
ValidationError is checked, and confirms that no launch configuration
was created.

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

* fix(cloudformation): report metadata type errors as CloudFormation does

A launch configuration MetadataOptions block or member of the wrong
JSON type failed with wording Floci made up, such as "HttpTokens must
be a string.". It now fails with CloudFormation's schema type error, as
the S3 and DynamoDB provisioners already report it, for example "Model
validation failed (#/MetadataOptions/HttpTokens: expected type: String,
found: JSONArray)". A value of the right type that Auto Scaling rejects
keeps Auto Scaling's ValidationError.

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

* fix(cloudformation): report an oversized metadata hop limit as out of range

A whole-number HttpPutResponseHopLimit too large for an int, such as
2147483648, failed with the contradictory "expected type: Integer,
found: Integer". It is an integer outside 1 to 64, so it now fails with
the same Auto Scaling ValidationError text as 65 or 0, with the value
as written.

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

* fix(cloudformation): count an oversized hop limit with the other metadata errors

An oversized CloudFormation HttpPutResponseHopLimit was refused before
the other MetadataOptions members were checked, so an invalid
HttpTokens beside it went unreported, and the value was echoed as
written, "+002147483648" included. Auto Scaling now builds the whole
error from the options and the hop limit as a BigInteger, so the
oversized value is counted with every other violation and printed as
a plain number.

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

* refactor(autoscaling): build metadata option errors through SmithyValidationErrors

The launch configuration MetadataOptions validator assembled its "N
validation errors detected" message by hand. It now uses
SmithyValidationErrors, which main adopted for Auto Scaling's other
checks. The error code and text are unchanged.

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

* fix(cloudformation): read launch configuration metadata through CfnPropertyTypes

The MetadataOptions reader had its own type check and answered every
wrongly typed value with the handler's "Model validation failed"
message. It now reads the block through CfnPropertyTypes, as the Events
and Lambda provisioners do:

- a value of the wrong type fails template validation first, for
  example "Property [HttpTokens] expected type: String, found:
  JSONArray", and a hop limit of 4.5 is "found: Float";
- a hop limit beyond 32 bits fails the handler's model validation,
  before Auto Scaling's own check runs;
- a number or a boolean given for a string member arrives at Auto
  Scaling as its text, as CloudFormation converts it, and fails its
  enum check there.

The hand-written type helpers go away.

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

* refactor(autoscaling): fold the metadata options error back into its validator

The public metadataOptionsError took the hop limit as a BigInteger so
that CloudFormation could report a value beyond 32 bits through it.
CloudFormation now refuses such a value in model validation, before
Auto Scaling, so the helper goes back to a private validator over the
Integer field. The error code and text are unchanged.

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

* test(ec2): delete the launch template the metadata test creates

Ec2LaunchTemplateMetadataOptionsIntegrationTest never deleted its
launch template, and its cleanup began only after the fleet or group
had launched, so an earlier failure left everything behind. Everything
after the template is created now runs in the try block, and the
finally block removes the group or the instance and then the template,
ignoring the status so a test's own failure is kept.

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

* fix(ec2): check template metadata options before a CreateFleet dry run

A launch template stores its metadata options unchecked, as AWS does,
so they fail at launch. CreateFleet forwards them to the launch since
this branch, but a dry run returned DryRunOperation before any launch
ran, saying a fleet would succeed that then fails with
InvalidParameterValue. CreateFleet now checks every launch's metadata
options with the rest of its pre-launch checks, as RunInstances does
before honoring DryRun.

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

* test(autoscaling): pin the Query answer for a hop limit beyond 32 bits

CreateLaunchConfiguration with MetadataOptions.HttpPutResponseHopLimit=
2147483648 answers MalformedInput, as for any value that is not a
32-bit integer: the awsQuery protocol binds the member before model
validation runs. A row now covers it beside the non-numeric case.

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

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-19 09:42:58 -04:00
Huan Jiang 3a913ca8d6 fix(s3): ignore hoisted upload checksum query parameters (#5977)
* fix(s3): ignore hoisted upload checksum query parameters

* fix(s3): ignore hoisted multipart checksum types
2026-10-19 09:30:12 -04:00
Alessandro Lattao 49d2d74f3f fix(apigatewayv2): answer the Lambda proxy results an HTTP API cannot read with 500 (#5985)
* fix(apigatewayv2): answer the Lambda proxy results an HTTP API cannot read with 500

Measured on HTTP APIs (eu-west-1), with payload formats 1.0 and 2.0:
a function that raises is answered 500 with {"message":"Internal Server
Error"}, not the 502 Floci sent. The same 500 answers what API Gateway
cannot read as a response: in format 1.0 a result that is not an object
with a statusCode (a result without one, a string, a number, null), and
in either format a statusCode that is not a whole number from 100 to 599
(99, 600, 201.5, "abc"); a statusCode given as text that spells one,
"201", is taken, and headers that are not an object are left out.
Format 2.0 keeps inferring a 200 for a result without a statusCode.

Floci answered a format 1.0 result without a statusCode with 200 and
its headers and body, as HttpApiLambdaProxyResponseInferenceIntegrationTest
pinned since #5153; AWS answers 500, and that test and the unit tests
that pinned 502 now expect what AWS answers. A REST API's Lambda proxy
keeps its own 502, untouched.

The HTTP API's generic error responses come from one helper, which the
invocation failures from #5935 (500, or 503 when Lambda throttles) use
too.

* test(compat): skip the HTTP API proxy cases unless the API reaches Lambda

Review of #5985: the test checked only that Lambda can be invoked, not
that API Gateway dispatches to it. It now sends a readable result through
the API first, as ApiGatewayV2ExecuteTest does, and skips the cases when
that does not come back.
2026-10-19 09:18:20 -04:00
David Phillips 84dfb77f99 fix(acm): reject mismatched certificate private keys (#5987)
Preserve existing certificates when an import supplies the wrong key.
2026-10-19 09:00:35 -04:00
Alessandro Lattao 98b2429e58 fix(ecs): launch a container with its linuxParameters, checked as RegisterTaskDefinition does (#5951)
* fix(ecs): launch a container with its linuxParameters, checked as RegisterTaskDefinition does

RegisterTaskDefinition kept a container's linuxParameters and
DescribeTaskDefinition returned them, but the container was launched
without any of them. A worker that set initProcessEnabled so its orphaned
browser processes would be reaped ran with its own command as PID 1, and
they stayed zombies until the container ended; capabilities, devices,
/dev/shm size, tmpfs mounts and swap limits were ignored the same way.

ECS documents each member as a docker run option, and the container is
now created with them: initProcessEnabled is --init (through
ContainerSpec.init, the flag main already has for it), capabilities are
--cap-add and --cap-drop, devices are --device (read, write and mknod when
no permissions are given, at the host path when no container path is),
sharedMemorySize is --shm-size in MiB, each tmpfs entry is a --tmpfs of
its size in MiB with its mount options, maxSwap is --memory-swap as the
container's hard limit plus that many MiB, and swappiness is
--memory-swappiness. ContainerSpec gains LinuxOptions for the rest,
applied in ContainerLifecycleManager's HostConfig; a constructor with the
former signature keeps every other caller unchanged.

A container behind a security group already had NET_ADMIN and NET_RAW
dropped, because the group is enforced by nftables in the namespace the
task's containers share. Docker applies a named --cap-add over a
--cap-drop, so those two are now also removed from what the container
asks to add; ALL can stay, since Docker grants every capability but the
dropped ones then (measured: docker run --cap-add ALL --cap-drop NET_ADMIN
--cap-drop NET_RAW reports CapEff 000001ffffffcfff, bits 12 and 13 clear).

Measured on RegisterTaskDefinition (eu-west-1, 2026-10-03 and 2026-10-16),
with the SDK's own validation off, and now checked the same way before
anything is stored:
- every capability must be one the KernelCapabilities reference lists, in
  any case and without a CAP_ prefix ("Unrecognized Linux capabilities in
  add: [CAP_NET_ADMIN]", likewise for drop);
- a device needs a hostPath ("Device cannot have empty hostPath") and only
  read, write and mknod as permissions, as written ("Invalid permission:
  READ for device /dev/null");
- a tmpfs mount needs a containerPath, a size above zero and options the
  Tmpfs reference lists, as written ("The NOEXEC tmpfs mount option
  specified is invalid.");
- sharedMemorySize must be above zero, maxSwap zero or more and needs a
  swappiness ("When a container has a swap memory, it must also specify a
  swappiness value."), from 0 to 100;
- the checks run capabilities, devices, tmpfs, then swap, all before the
  Fargate rules;
- on Fargate a non-empty devices list, sharedMemorySize, maxSwap and
  swappiness are refused in that order ("Fargate compatible task
  definitions do not support devices", with no trailing period, unlike
  AWS's other Fargate refusals), and any capability added but SYS_PTRACE
  as written ("NET_ADMIN is not allowed on Fargate.");
- a swappiness without maxSwap is accepted and dropped, and capabilities
  are stored with both an add and a drop list.

EcsLinuxParameters holds all of it, validation, the stored form and the
launch, and reads the members through one set of helpers, so EcsService
only calls it.

Not done: swap is not limited for a container with no hard memory limit,
since Docker cannot limit swap without one, and a daemon on cgroup v2
discards swappiness, as Amazon Linux 2023 does on ECS.

Tests: EcsLinuxParametersTest and ContainerLifecycleManagerLinuxOptionsTest
for what reaches Docker, EcsLinuxParametersDockerIntegrationTest for a
real container (PID 1, capabilities, device, /dev/shm, tmpfs),
EcsFargateEdgeCaseIntegrationTest for the measured refusals and the stored
form, and EcsLinuxParametersRegistrationTest in sdk-test-java for the
same through the SDK.

* fix(ecs): read linuxParameters as RegisterTaskDefinition does, and guard devices like host volumes

Review of #5951 (Qodo).

A device hands the container the host's hardware, and reached Docker with
no check, where a host volume at the same path is refused by default.
HostVolumePolicy now covers each device's hostPath too, naming the field
it checks: refused unless floci.services.ecs.host-volume-roots holds it or
allow-unsafe-host-volumes is set, at RegisterTaskDefinition after AWS's
own checks (so their messages still come first) and again at launch,
through EcsContainerManager.checkDeviceHostPaths. The registration check
sits in EcsService rather than beside the host volume one in
EcsJsonHandler, so a template's definition gets it too.

Measured with raw requests on RegisterTaskDefinition (eu-west-1,
2026-10-18):
- a member of the wrong JSON type is refused with an
  InvalidParameterException from the deserializer, before any rule on the
  values: "Unexpected field type" for a scalar where an object or a list
  is expected, "Unexpected value type in payload" for a device or a tmpfs
  mount that is not an object, "Start of structure or map found where not
  expected" for an object where a list or a scalar is expected,
  "NUMBER_VALUE cannot be converted to String", "STRING_VALUE cannot be
  converted to Integer", "TRUE_VALUE ...", "NUMBER_VALUE cannot be
  converted to Boolean", "Unexpected token received from parser" for text
  that is not true or false, and no message at all for a list where none
  is expected;
- numbers are read as integers, the fraction dropped (sharedMemorySize
  1.9 is stored as 1, 0.5 as 0 and refused) and the range capped
  (3000000000 is 2147483647); a boolean may come as text in any case; a
  null member or list entry is absent, and a null device is an empty one.

Floci kept such values as written and silently skipped what it could not
read, so a definition stored one size and launched another. The stored
form now holds what AWS stores.

Tests: EcsFargateEdgeCaseIntegrationTest for every measured shape, the
stored numbers, booleans and nulls, and a device refused by default; the
Docker test allows /dev/null through host-volume-roots. All fail on the
previous head.

* refactor(ecs): check linuxParameters' JSON types against the vendored ECS model

Review of #5951. EcsLinuxParameters hand-wrote the deserializer's type
check member by member, where Floci already drives that check from
botocore for DynamoDB and SES v2 (RequestShapeModel, with the shapes
vendored by tools/aws/request_shapes.py).

tools/aws/regen_ecs_shapes.py vendors botocore's ECS model as
src/main/resources/aws/ecs-request-shapes.json (botocore 1.43.113, the
release requirements.txt pins), registered in make aws-data-sync and
aws-data-check and in the shared generator's tests. EcsRequestShapes
walks a container's linuxParameters against the LinuxParameters shape
with ECS's InvalidParameterException messages, the ones measured on
RegisterTaskDefinition; EcsLinuxParameters' own member list is gone.
The messages and their order are unchanged.

The device change named host volumes only in two more descriptions of
floci.services.ecs.host-volume-roots: docs/configuration/
environment-variables.md and the configuration table in
docs/services/ecs.md now name devices too, as does the host volume
section and the allow-unsafe-host-volumes Javadoc.

Tests: EcsRequestShapesTest for every measured message against the
vendored model; EcsFargateEdgeCaseIntegrationTest passes unchanged.

* refactor(core): walk request shapes once, with each service's messages

Review of #5951: EcsRequestShapes walked the vendored model the same way
DynamoDbRequestShapes and SesV2RequestShapes do (a null is absent, an
unknown member is skipped, a structure's values are read as members and a
list's or a map's as elements, a boolean reads from "true" or "false" in
any case, a scalar of the wrong kind is named by its JSON token), with only
the error code and a few messages apart. That walk is now
RequestShapeCheck, next to RequestShapeModel in core.common, and each
service hands it its deserializer's wording as RequestShapeCheck.Messages:
DynamoDB's SerializationException with DECIMAL_VALUE and the base-64
message for a blob, SES v2's SerializationException with its "can not be
converted to a" wording and only strings and blobs checked, as probed, and
ECS's InvalidParameterException with no message for a list where none is
expected.

The three services' tests pass unchanged. SES v2's wording becomes
constants in SesV2Json, which its member helpers and the walk share.
2026-10-18 22:21:54 -04:00
Alessandro Lattao d60c973865 fix(cloudformation): keep a rule target's dead-letter queue, retry policy, role and ECS parameters (#5958)
* fix(cloudformation): keep a rule target's dead-letter queue, retry policy, role and ECS parameters

EventsCfnProvisioner built each AWS::Events::Rule target from Id, Arn, the
inputs, HttpParameters, SqsParameters and BatchParameters only. A target's
DeadLetterConfig and RetryPolicy were dropped, so ListTargetsByRule showed
neither, delivery ran on the defaults (185 attempts over 24 hours) and an
event the target could not take was logged and lost instead of reaching the
queue the stack declared. RoleArn and EcsParameters, which PutTargets keeps,
were dropped as well.

Targets set through PutTargets already get the delivery semantics from
TargetDispatcher, so the provisioner now passes the four members through,
validated by putTargets as the API validates them. EcsParameters is converted
to the API's shape: the resource schema spells AwsVpcConfiguration,
PlacementStrategies, TagList and the placement and capacity provider items
differently from the EventBridge API, which spells them awsvpcConfiguration,
PlacementStrategy, Tags and in camel case; ListTargetsByRule on AWS returns
the converted shape (measured). RoleArn is stored, not used for delivery, as
Floci does not invoke targets under the role.

Targets is resolved once, with the engine's resolveNodeOmittingNoValue, so an
Fn::If choosing the whole list works, and a member, a list item or an Fn::If
branch that is AWS::NoValue is left out of the call while a literal "" stays.
An earlier version marked AWS::NoValue itself before resolving, with a
sentinel; the engine's rule does the same without one.

The four members are read against the types AWS::Events::Rule's resource
schema gives them, before the rule exists, with the messages measured on
CloudFormation (eu-west-1): template validation's "Property
[MaximumRetryAttempts] expected type: Integer, found: Float", and the
handler's "Model validation failed (#/Targets/0/EcsParameters/
EnableECSManagedTags: expected type: Boolean, found: String)" for what only
the handler refuses, which waits until every target has passed template
validation, as on AWS. What CloudFormation converts is converted the same
way: "4" is 4, "TRUE" is true, 5 in a list of strings is "5". Reading them
with convertValue alone truncated 4.5 to 4, ignored a RetryPolicy given as a
string and failed on "abc" with Jackson's message.

A list of strings (Subnets, SecurityGroups) takes every form that yields a
list on AWS, as Lambda's list properties do since #5923 and #5949: a Ref to a
CommaDelimitedList, Fn::Split and an Fn::If choosing either, also inside an
EcsParameters an Fn::If chooses; a Ref to a String is refused (measured).
That is why the reader walks the template as written, with the engine's
omitNoValue, now public, and resolves each call it meets, instead of
checking the resolved tree, where a CommaDelimitedList is already text.

The check is the new CfnPropertyTypes, which also takes over
LambdaCfnProvisioner's requireType and its list-of-strings reading, so
template validation has one implementation for both provisioners.

* test(cloudformation): read the rule's only target without List.getFirst

The SDK compatibility tests compile for Java 17, which has no
List.getFirst; the image build of sdk-test-java and ec2-containers failed
on it. A local JDK 25 with source 17 does not check the API, so the class
was compiled again with --release 17.

* test(compat): wait for a stack 50 ms at a time against Floci

Review of #5958: TestFixtures.awaitStackTerminal slept 500 ms between
checks, so each stack, which Floci finishes in milliseconds, cost at least
half a second. It now checks every 50 ms against Floci, as the integration
tests' CfnStackWaits does, and keeps 500 ms against real AWS. The rule
target test waits 10 seconds for a stack against Floci instead of 60, and
10 minutes against AWS, where the queues take minutes.
2026-10-18 22:05:03 -04:00
David Phillips 678c5b82a6 fix(rds): require database role grants for PostgreSQL IAM login (#5945)
* fix(rds): require database role grants for PostgreSQL IAM login

* fix(rds): preserve standard proxy IAM authentication

* fix(rds): report PAM refusal for IAM member passwords
2026-10-18 20:44:10 -04:00
David 7dc514b52f feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes (#5748)
* feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes

None was served, so Terraform's aws_emr_release_labels and
aws_emr_supported_instance_types data sources failed against Floci.

A curated catalogue of EMR releases (emr-7.5.0, Floci's default, and
emr-7.4.0, emr-6.15.0, emr-6.14.0 and emr-5.36.2) carries each
release's applications and versions from the EMR Release Guide and its
recent Amazon Linux releases, with common instance types and their EC2
sizes. The three actions filter and page it as the API documents, and
answer InvalidRequestException for an unknown release, a bad token or
an out-of-range MaxResults. A configured default release outside the
catalogue is still listed.

Closes #5734

* fix(emr): report EMR architecture values and match application versions without regard to case

ListSupportedInstanceTypes returned the EC2 spellings x86_64 and arm64; the EMR model gives X86_64 and AARCH64 for Architecture. The ListReleaseLabels application filter matched the name without regard to case but not the version, so phoenix@4.14.3-hbase-1.4 missed emr-5.36.2.

* refactor(emr): page the release catalogue with the shared Pagination

ListReleaseLabels and ListSupportedInstanceTypes now page through
core.common.Pagination, with the filters in the token namespace so a token
replayed with other filters, or altered, is refused. DescribeReleaseLabel
answers every application, as AWS reserves its MaxResults and NextToken.
The EMR integration tests share one request helper.
2026-10-18 15:11:42 -04:00
Alessandro Lattao 1f4a46804c fix(cloudformation): refuse a list property that a parameter or an intrinsic makes a string (#5949)
* fix(cloudformation): refuse a list property that a parameter or an intrinsic makes a string

The follow-up asked on #5923. The engine kept parameter values but not
their types, so the Lambda provisioner's list readers could not tell a
Ref to a CommaDelimitedList parameter, which the engine resolves to the
comma-joined text, from a Ref to a String parameter: both read as lists,
where CloudFormation refuses the second.

Measured on CloudFormation (eu-west-1, 2026-10-18), Layers and
Architectures of AWS::Lambda::Function:
- a Ref to a CommaDelimitedList, AWS::SSM::Parameter::Value<List<String>>
  or AWS::SSM::Parameter::Value<CommaDelimitedList> parameter, Fn::Split,
  an Fn::If choosing a Ref to a list, and Ref AWS::NotificationARNs are
  lists;
- a Ref to a String or Number parameter, Ref AWS::Region, Fn::Select,
  Fn::Join, Fn::Sub and an Fn::If choosing a literal string fail the
  template's validation with "Property [Architectures] expected type:
  JSONArray, found: String";
- a resource's Ref and Fn::GetAtt fail only when the resource is
  provisioned, with "Properties validation failed for resource Fn with
  message: #/Architectures: expected type: JSONArray, found: String".

CloudFormationTemplateEngine now takes the declared parameter types, which
executeTemplate reads from the template (stacks, change sets, stack sets
and nested stacks all deploy through it), and yieldsString tells the
forms of the second group. The list readers refuse such an intrinsic
with the validation message, as they refuse a literal of the wrong type.
The third group is left as it was: the engine cannot tell a list-valued
attribute from a string one before provisioning, and a resource's own
message format is not modelled.

parameterType gives a declaration's Type, String when it is left out, for
the new reader and for GetTemplateSummary, which had its own copy.

Tests: CloudFormationTemplateEngineTest for yieldsString over every
measured form; CloudFormationLambdaObjectPropertyIntegrationTest for each
refused form, an Fn::If choosing a list, and a nested stack whose own
parameter types decide; CloudFormationLambdaObjectPropertyTest in
sdk-test-java for a String parameter through the SDK. The integration and
SDK tests fail on main.

* fix(cloudformation): take Fn::Base64 as a string where a list is expected

Review of #5949 (Qodo). Measured on CloudFormation (eu-west-1,
2026-10-18): Architectures: {"Fn::Base64": "x86_64"} fails validation with
"Property [Architectures] expected type: JSONArray, found: String", like
Fn::Sub. yieldsString left it out, so the Lambda reader split the encoded
text into a list and the function got an invalid architecture instead.

Tests: CloudFormationTemplateEngineTest and
CloudFormationLambdaObjectPropertyIntegrationTest gain the case; both fail
on the previous head.
2026-10-18 14:32:04 -04:00
David Phillips 7ce4b6bd23 feat(autoscaling): describe suspended process reasons (#5941)
* feat(autoscaling): describe suspended process reasons

* fix(autoscaling): record suspended process dates
2026-10-18 14:24:58 -04:00
Alessandro Lattao dd832b45dc fix(apigatewayv2): apply an HTTP API's CORS configuration to its actual responses (#5935)
* fix(apigatewayv2): apply an HTTP API's CORS configuration to its actual responses

An HTTP API with a CorsConfiguration answered the preflight from it, but the
responses of its integrations went out with no Access-Control-Allow-Origin, so
a browser refused to hand the page any answer of the API. AWS documents both
halves ("Configuring CORS for an HTTP API"): for a CORS request API Gateway
adds the configured headers to the integration's response, and once an API
has a CORS configuration it ignores the CORS headers the integration returns.

Measured on HTTP APIs (eu-west-1, 2026-10-16 and 2026-10-18):
- API Gateway's own refusals on a matched route get the same headers: a JWT
  authorizer's 401 and its 403 for a missing scope, an unsigned call to an
  AWS_IAM route's 403, a Lambda authorizer's 401 (no identity) and 403
  (isAuthorized false); so does a function that is gone, which answers 500
  Internal Server Error (Floci answered 404 "Function not found" without
  them).
- A preflight a route matches (an OPTIONS or ANY route, $default) goes
  through that route, its authorizer and its integration, and gets the
  preflight headers on whatever answers; only a preflight no route matches
  is answered 204 by API Gateway. Floci answered every preflight itself, so
  a route behind an authorizer looked open to a browser's preflight.
- A preflight gets the preflight headers only when its origin, its method
  and every header it asks for are allowed, and never the exposed headers;
  otherwise, or for an OPTIONS without Access-Control-Request-Method, no CORS
  header at all. An actual request gets them whatever its method. Lists are
  joined with a bare comma.
- A preflight that gets the headers always carries
  Access-Control-Allow-Headers, empty when none are configured, and
  Vary: origin unless AllowOrigins is a single exact origin or "*" (two
  origins, the "https://*" prefix, and "*" beside an exact origin all
  vary). No other response gets a Vary; an integration's own is kept.
  Floci sent no Allow-Headers when none were configured, and Vary: Origin
  on every preflight that echoed the origin.
- A route without a target answers 404 Not Found with no CORS header, as an
  unmatched route does (Floci answered 500).

The configuration is now applied once, by withHttpApiCors, on whatever the
matched route answers, so no response path can miss it: it drops the six
headers the configuration owns from the response and, when the Origin is
allowed (exactly, by "*", or by a prefix wildcard such as https://*), adds
Access-Control-Allow-Origin, plus Credentials and Expose-Headers when
configured, or the preflight's set for a preflight. An API without a
configuration still leaves CORS to its integrations.

Tests: ApiGatewayExecuteControllerTest for the headers withHttpApiCors
sets and when a preflight varies, HttpApiCorsIntegrationTest for the
routing, the refusals and the custom domain;
HttpApiJwtAuthorizerScopesTest and HttpApiRequestAuthorizerTest for the
measured refusals of a JWT scope and of a Lambda authorizer, on their own
fixtures; ApiGatewayV2CorsTest in sdk-test-java for the refusals, an
unmatched preflight and a two-origin API's Vary through the SDK;
ApiGatewayV2UnsignedAccountRoutingTest now tells a route found in its
account by AWS's 500 instead of Floci's "Function not found".

* fix(apigatewayv2): answer a failed invocation with API Gateway's own status and CORS headers

Review of #5935 (Qodo). Measured on an HTTP API with a CORS configuration
(eu-west-1, 2026-10-18), with an allowed Origin:
- a Lambda integration API Gateway may not invoke, and a function that
  raises, answer 500 {"message":"Internal Server Error"}; a function Lambda
  throttles (reserved concurrency 0) answers 503 {"message":"Service
  Unavailable"}; each carries Access-Control-Allow-Origin and
  Access-Control-Expose-Headers;
- an OPTIONS request no route matches is answered 204 with no CORS header
  whether or not it carries Origin or Access-Control-Request-Method, so the
  unmatched OPTIONS answer stays as it is, now pinned by a test.

Any AwsException from the invocation now becomes API Gateway's answer
inside the matched route, so the CORS configuration reaches it: 503 for
Lambda's throttling, 500 otherwise. Only the function that is gone did
before; the others escaped to the exception mapper without the headers.

A configured list with a null entry no longer fails a preflight: the
entry matches nothing and is left out of the header.

Tests: HttpApiCorsIntegrationTest gains a throttled function's 503 and an
unmatched OPTIONS that is not a preflight, ApiGatewayExecuteControllerTest
a null entry, and ApiGatewayV2CorsTest in sdk-test-java both new cases
through the SDK; the throttled and null cases fail on the previous head.

* test(apigatewayv2): share the HTTP_PROXY API fixture and the Lambda zip helper

Review of #5935. HttpApiCorsIntegrationTest.createProxyApi repeated the
API, stage, HTTP_PROXY integration and route sequence of
HttpApiHttpProxyMultiValueIntegrationTest.createProxyApi: both now call
HttpProxyApiFixtures.createProxyApi, which takes the API's extra fields,
the stage, the backend port and the path. The stage is auto-deployed for
both, as an API needs to be served on AWS.

The throttled function is a Node.js one built with
WebSocketTestSupport.createLambdaZip; it never runs, so its runtime does
not matter.
2026-10-18 12:05:07 -04:00
David Phillips 356c79e78e fix(ssm): parse and bound command delivery timeouts (#5908)
* fix(ssm): limit public command delivery time

* docs(ssm): describe command delivery timeouts

* fix(ssm): deserialize delivery timeouts before checking bounds

Handle numeric delivery timeouts consistently without bypassing limits.

* fix(ssm): report member-specific deserialization errors

Name the expected scalar type and explain malformed structures.

* refactor(ssm): keep delivery timeout errors consistent
2026-10-18 11:03:48 -04:00
David Phillips 1a80884f40 feat(servicequotas): configure applied EC2 vCPU quota (#5926)
* feat(servicequotas): configure applied EC2 vCPU quota

Report configured EC2 vCPU quotas separately from AWS defaults.

* fix(servicequotas): reject negative applied quota settings

Reject invalid quota settings before serving local requests.

* docs(servicequotas): clarify negative quota settings

* fix(servicequotas): reject invalid settings at startup
2026-10-18 11:03:06 -04:00
Alessandro Lattao 8db159761c fix(cloudformation): refuse every Lambda property of the wrong type (#5923)
* fix(cloudformation): refuse every Lambda property of the wrong type

The follow-up asked on #5912. Environment, ImageConfig, Layers,
Architectures and FileSystemConfigs, and a layer's CompatibleRuntimes
and CompatibleArchitectures, went through readers that took a value of
the wrong JSON type as absent, so a malformed property reset the
function's setting instead of failing; FileSystemConfigs alone refused
one, with a message of Floci's own, and also refused an AWS::NoValue
chosen by Fn::If, which AWS accepts.

Measured on CloudFormation (eu-west-1, 2026-10-18): each fails the stack
before the resource is touched, "Property [Layers] expected type:
JSONArray, found: JSONObject", "Property [Environment] expected type:
JSONObject, found: JSONArray", "Property [Variables] expected type:
JSONObject, found: String" for Environment's Variables, a number or a
boolean reading as a String; and Ref AWS::NoValue, directly or through
Fn::If, leaves any of them out.

Every reader of the provisioner now resolves through one resolveTyped,
which omits AWS::NoValue and refuses another type with that message.

Tests: every measured case on create, AWS::NoValue on the list
properties and through Fn::If, and through the SDK a Layers object; the
FileSystemConfigs test reads the measured message. They fail on main.

* fix(cloudformation): read a list property from a CommaDelimitedList Ref as a list

Review of #5923. Layers: !Ref LayerArns, with LayerArns a
CommaDelimitedList, was refused with "Property [Layers] expected type:
JSONArray, found: String", because the engine resolves that Ref to the
comma-joined text; AWS reads it as a list.

Measured on CloudFormation (eu-west-1, 2026-10-18), Layers and
Architectures of AWS::Lambda::Function:
- a Ref to a CommaDelimitedList parameter, and Fn::Split over a String
  parameter, create the stack with the list;
- a Ref to a String parameter, and Fn::If choosing a literal string, fail
  validation with "expected type: JSONArray, found: String".

The string-list readers (Layers, Architectures, and a layer's
CompatibleRuntimes and CompatibleArchitectures) now go through one
resolveStringList: a literal of another type is still refused, and an
intrinsic is read through engine.resolveStringList, which splits the
comma-joined text and expands Fn::Split, Fn::GetAZs and Fn::If. The
engine keeps parameter values, not their types, so a Ref to a String
parameter reads as a list too, where AWS refuses it.

Tests: CloudFormationLambdaObjectPropertyIntegrationTest creates a
function with Layers and Architectures from CommaDelimitedList Refs and
with Layers from Fn::Split; CloudFormationLambdaObjectPropertyTest in
sdk-test-java does the CommaDelimitedList case through the SDK. Both
fail on the previous head.
2026-10-18 09:25:59 -04:00
Vũ Thế Huy e38dba5f11 feat(cognito): support Google identity provider federation (#5868)
* feat(cognito): support Google identity provider federation

* fix(cognito): synchronize federated provisioning, support linked users and retain discovery endpoints

* fix(cognito): preserve stored provider identity for standard OIDC federation

* fix(cognito): refuse disabled users during federated sign-in
2026-10-18 09:20:48 -04:00
Alessandro Lattao d425e2d884 fix(lambda): refuse a log level under Text as Lambda does (#5920)
Floci accepted ApplicationLogLevel and SystemLogLevel under Text and
dropped them, which a test pinned and the docs described as Floci's own
call rather than probed behaviour. Measured on Lambda (eu-west-1,
2026-10-18): CreateFunction and UpdateFunctionConfiguration refuse either
level under Text, whether LogFormat names Text or is left to that
default, with InvalidParameterValueException "LogLevel is not supported
when LogFormat is set to "Text". Remove LogLevel from your request or
change the LogFormat to "JSON" and try again." In a stack, a valid level
under Text passes the template's validation and fails the resource with
Lambda's message. Floci now refuses it in validateLoggingConfig, so the
API and the CloudFormation update check, which validates through
loggingSettings, both do; and its enum errors list the levels in Lambda's
order: [FATAL, TRACE, WARN, ERROR, INFO, DEBUG] and [WARN, INFO, DEBUG].

The default format is worked out in one place, logFormat, for the
validation and for loggingSettings.

Tests: a level under Text refused on create and on update through the API
(LambdaVpcSnapStartLoggingIntegrationTest, replacing the test that pinned
the old behaviour) and through the SDK (LambdaFunctionConfigTest), by
loggingSettings (LambdaServiceTest), and by a stack update
(CloudFormationLambdaLoggingConfigIntegrationTest); the enum messages'
order. They fail on main.
2026-10-18 08:10:40 -04:00
Alessandro Lattao 30d2bf03d9 fix(cloudformation): refuse a Lambda function property that is not an object (#5912)
* fix(cloudformation): refuse a Lambda function property that is not an object

The AWS::Lambda::Function provisioner read an object property that
resolved to a scalar or a list as absent, so a malformed VpcConfig,
DeadLetterConfig, TracingConfig or EphemeralStorage reset the function's
setting to its default instead of failing. Measured on CloudFormation
(eu-west-1, 2026-10-18): such a value fails the stack before the function
is touched, on create and on update, with "Property [VpcConfig] expected
type: JSONObject, found: String"; a list reads "found: JSONArray", and a
number or a boolean reads "found: String" too.

resolveMapOrDefault, which reads every object property of the function,
now refuses such a value with that message. AWS reports it from its
pre-deployment validation, with the detail in DescribeEvents, which Floci
does not model; the message is on the resource's failed event.

Tests: CloudFormationLambdaObjectPropertyIntegrationTest (a number VpcConfig
and a list DeadLetterConfig on create, a string TracingConfig on update that
keeps the setting) and, through the SDK, CloudFormationLambdaObjectPropertyTest;
both fail on main. The compatibility suite gains TestFixtures.awaitStackTerminal,
the same helper #5902 adds.

* fix(cloudformation): leave out a Lambda property that resolves to AWS::NoValue

Floci's template engine resolves Ref AWS::NoValue to an empty text node,
which the new type check refused as a String, so a valid template that
leaves VpcConfig, TracingConfig, DeadLetterConfig or EphemeralStorage out
through AWS::NoValue, directly or chosen by Fn::If, failed. Measured on
CloudFormation (eu-west-1, 2026-10-18): both stacks are created.
resolveMapOrDefault now resolves with resolveNodeOmittingNoValue, as other
provisioners do for optional properties, and reads what it leaves out as
the default.

Test: a direct Ref AWS::NoValue on VpcConfig and TracingConfig, and an
Fn::If choosing it for DeadLetterConfig, each create the stack; it fails
on the previous head.
2026-10-18 00:56:25 -04:00
Alessandro Lattao 63af5cd299 fix(cloudformation): pass a function's LoggingConfig to Lambda (#5902)
* fix(cloudformation): pass a function's LoggingConfig to Lambda

The AWS::Lambda::Function provisioner never read LoggingConfig, so every
function a stack created logged in Text to /aws/lambda/<name>, whatever
the template said, and an update to it was never applied.

Measured on AWS (eu-west-1, 2026-10-16): the function reads back the
LogGroup the template names; a change to JSON with an ApplicationLogLevel
updates it in place, SystemLogLevel reading back INFO; and removing the
property from the template puts the function back on Text and
/aws/lambda/<name>, again in place. So the provisioner always sends a
LoggingConfig, empty when the template has none, which Lambda resolves to
the function's defaults (JSON for a durable function, which refuses
Text).

The update check compares what Lambda would store, through the same
LambdaService.loggingSettings that UpdateFunctionConfiguration applies,
so an unchanged LoggingConfig is still a no-op redeploy and the two
cannot drift apart.

Tests: the stack lifecycle in CloudFormationLambdaLoggingConfigIntegrationTest
and, through the SDK clients, CloudFormationLambdaLoggingConfigTest, both
failing on main; the normaliser in LambdaServiceTest. The compatibility
suite gains TestFixtures.awaitStackTerminal for the new test rather than
another private copy of the stack wait.

* fix(cloudformation): refuse an invalid log level before comparing LoggingConfig

The update check compared normalised logging settings, and the normaliser
dropped both log levels under Text before anything validated them. An
update whose only change was an invalid level, ApplicationLogLevel VERBOSE
on a Text function, then looked unchanged, never reached
UpdateFunctionConfiguration, and the stack went UPDATE_COMPLETE where
AWS fails the update. LambdaService.loggingSettings now runs
validateLoggingConfig before it normalises, so the comparison refuses
what Lambda refuses, and applyLoggingConfig validates once, through it.

The integration test registers its stacks' deletion with PartitionCleanup,
and the compatibility test's cleanup no longer swallows a failed
DeleteStack, which succeeds for a stack that is already gone.
2026-10-18 00:47:18 -04:00
Alessandro Lattao 964756145e fix(cloudwatch): match FilterLogEvents with the filter pattern syntax (#5903)
FilterLogEvents kept an event when its message contained filterPattern as
a substring. A JSON pattern such as { $.template = "sign-in-code" } then
never matched, and terms matched where AWS does not: an unquoted
sign-in-code, which AWS reads with its own term rules, matched every
message containing those characters.

Measured on AWS (eu-west-1, 2026-10-16) on five events, JSON, plain and
mixed: JSON patterns over nested paths and numbers, case-sensitive terms,
quoted phrases, ?alternatives and -exclusions each matched exactly the
events the parser Floci already uses for metric and subscription filters
matches. So FilterLogEvents now parses its pattern with it, once, before
the scan, and an invalid one is refused with InvalidParameterException
whatever the group holds.

The error text is the parser's own, as for PutMetricFilter and
TestMetricFilter; AWS words these differently per action, which is left
for a change of its own.

Tests: the measured events and patterns in CloudWatchLogsServiceTest and,
through the SDK, CloudWatchLogsFilterPatternTest, which fails on main.
2026-10-17 20:17:59 -04:00
Vũ Thế Huy c33823bd48 feat(redshift): complete Glue external table lifecycle (#5866)
* feat(redshift): complete Glue external table lifecycle

* fix(test): use existing frame helper in Spectrum bridge test

* fix(redshift): safeguard external catalog lifecycle operations

* fix(redshift): shorten spectrum catalog lock waits and reuse test helper
2026-10-17 13:59:29 -04:00
David Phillips 23edd58992 fix(ssm): separate shell execution and delivery timeouts (#5865)
* fix(ssm): separate shell execution and delivery timeouts

* fix(ssm): require a command list for public shell requests

* test(ssm): share command request and cleanup fixtures
2026-10-17 13:43:37 -04:00
David Phillips 043b919e85 fix(rds): require headroom for enabled storage autoscaling (#5863)
* fix(rds): require headroom for enabled storage autoscaling

* fix(rds): retain autoscaling headroom during storage growth

* fix(rds): check thresholds against current storage
2026-10-17 12:40:31 -04:00
Kenshin Okinaka 043daa5da6 feat(ses): validate v2 tracking configuration overrides (#5871)
* feat(ses): validate v2 tracking configuration overrides

SendEmail and SendBulkEmail now check ConfigurationOverrides.Tracking's
values the way SES v2 does: a value outside ENABLED/DISABLED is a
validation error, both values reported together with the click one first,
ahead of the tags and the configuration set. The shapes pre-check already
refuses a wrong JSON type. Floci has no open or click tracking, so a valid
override is accepted and has no effect.

* test(ses): check a refused tracking override records no message

* refactor(core): share the Smithy validation-error message

The "N validation error(s) detected: a; b" message is Smithy's, not SES's, yet
SES built it in eight places, plus five helpers that wrote the single-violation
form by hand. They now all go through core.common.SmithyValidationErrors,
which takes the protocol's error code. No message changes.
2026-10-17 12:23:02 -04:00
Jackson Price 0be4581d4e fix(ec2): preserve IAM instance profile identity (#5671)
* fix(ec2): preserve IAM instance profile identity

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

* fix(ec2): probe metadata readiness with IMDSv2

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

* fix(autoscaling): preserve launch profiles and metadata options

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

* fix(ec2): preserve automatic public addresses across launch paths

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

* fix(ec2): honor metadata token requirements and profile identity

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

* fix(ec2): keep synthesized node identity and mock addresses consistent

- IMDS iam/info serves the instance profile identity EKS synthesizes for
  its cluster nodes while IAM holds no such profile. The node carries a
  stable IAM-shaped profile id, which DescribeInstances now copies too.
- Mock instances get their automatic public address however the launch
  completes, DescribeInstanceStatus included. An associated Elastic IP
  replaces it, disassociating gives a running instance a new one, and
  termination leaves none.
- CreateFleet forwards the launch template's metadata options and its
  primary interface AssociatePublicIpAddress.
- Launch templates store a profile name and ARN pair as given and the
  launch from them rejects it, since AWS does not fully validate
  template parameters at creation.
- CloudFormation launch-configuration MetadataOptions resolve Fn::If and
  AWS::NoValue.

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

* fix(ec2): refuse profile pairs for groups and keep Elastic IPs exclusive

- Auto Scaling refuses a group whose launch template, directly or
  through its mixed instances policy, names both an instance profile
  name and an ARN, with ValidationError, instead of accepting a group
  that can never launch.
- AssociateAddress disassociates the Elastic IP an instance already
  has, as AWS documents. In mock mode a terminated instance takes no
  address, and an unchanged address is not written again.
- IMDS iam/info falls back to a cluster node's synthesized identity
  only while IAM holds no profile at that ARN; a held profile without a
  role answers 404.
- CreateFleet takes the subnet of the device-index-0 interface first,
  as RunInstances does.

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

* test(ec2): assert profile ids and launch configuration metadata via the SDK

Ec2InstanceProfilePathTest now checks that direct, template, override
and fleet launches report IAM's InstanceProfileId, and AutoScalingTest
round-trips launch configuration MetadataOptions through the AWS SDK for
Java v2, including the absent structure and a rejected hop limit.

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

* fix(ec2): displace an Elastic IP a retained interface carries

- AssociateAddress also disassociates an Elastic IP held by the
  instance's primary interface, which a retained network interface
  carries from an earlier instance, so one instance never holds two.
- Mock stop and terminate change the instance's state and public
  address under its lock, like the launch and Elastic IP writes.
- Docs and comments say where the profile pair fails and when
  CreateFleet falls back to another interface's subnet.
- Tests cover the retained-interface address, the group update path,
  the full refusal message and the fleet's availability zone, and the
  SDK launch configuration test cleans up on failure.

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

* fix(ec2): refuse reserved RunInstances tags before resolving the profile

Resolving the instance profile called the EC2 service before tag parsing,
so a reserved aws: tag was refused only after that lookup. Parse tags first,
as the reserved-tag check requires.

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

* test(autoscaling): assert the refresh launched the replacement

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

* test(autoscaling): describe what the refresh assertion checks

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

* test(cloudformation): cover invalid launch-configuration metadata options

Invalid HttpTokens, invalid HttpEndpoint, hop limits of 0 and 65 and a
non-integer hop limit each fail the AWS::AutoScaling::LaunchConfiguration
resource with the validation message, roll the stack back and leave no
launch configuration behind.

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

* test(cloudformation): pin metadata failure reasons and accepted hop limits

Assert the exact resource failure reason, and cover hop limits of 1 and 64,
a string hop limit and one from a Number parameter.

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

* refactor(ec2): leave IMDS token enforcement to a separate change

HttpTokens=required enforcement, the IMDSv2 readiness probe and the helper
shell environment reset move to their own pull request, so this change
keeps only the instance profile identity.

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

* refactor(ec2): leave mock public addresses to a separate change

Mock public IPv4 assignment, primary-interface public IP and subnet handling
and Elastic IP displacement move to their own pull request.

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

* refactor(autoscaling): leave launch metadata options to a separate change

Launch-configuration MetadataOptions over Query and CloudFormation, and
metadata options forwarded from launch templates and EC2 Fleet, move to
their own pull request. Launch-configuration profile resolution stays.

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

* test(ec2): use the shared metadata and authorization fixtures

Ec2MetadataProfileIntegrationTest starts its metadata server and requests
tokens through Ec2MetadataTestFixture, and it and
Ec2InstanceProfileIdentityIntegrationTest build their Authorization header
with EnforcementFixtures.auth.

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

* docs(ec2): close the Auto Scaling profile paragraph's code fence

Removes a stray fence that rendered the launch-configuration profile
paragraph as code, and a doubled blank line before the iam/info paragraph.

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

* test(ec2): find profile identity launches by a run tag

Each launch carries a tag unique to the test run, and the tests look their
instances up by that tag rather than by client token.

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

* refactor(ec2): leave the client-token filter to a separate change

The instance filter is not part of the profile identity, and this copy let
a wildcard match instances launched without a token.

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

---------

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
2026-10-17 08:03:38 -04:00
Vũ Thế Huy fa2a49e771 feat(redshift-serverless): add scheduled action actions (#5852)
Add CreateScheduledAction, GetScheduledAction, ListScheduledActions,
UpdateScheduledAction and DeleteScheduledAction. An action is recorded and
echoed, never run, and a cron schedule reports no upcoming invocations. It is
tied to the namespace by the namespace's generated id, so a namespace recreated
under the same name does not inherit it.

Required members, name patterns, the snapshot name prefix length and the tag
shape come from the AWS model through RedshiftServerlessRequestShapes. Only what
the model cannot express stays in the service: the schedule union, the time
window, the retention range and the namespaces that must exist.
2026-10-17 00:04:32 -04:00
Suja Shaj a611e9ea6f fix(iam): authorize Secrets Manager requests against the secret's ARN (#5781)
* fix(iam): authorize Secrets Manager requests against the secret's ARN

IAM enforcement evaluated CreateSecret against secret:* because the
builder read only SecretId, and a secret named by its name was evaluated
as secret:<name>, without the random suffix every secret ARN carries.
A secret:<name>-?????? policy, the pattern AWS documents for granting
access to a secret that may not exist yet, matched neither.

CreateSecret is now evaluated against secret:<Name>-??????, standing in
for the suffix that is assigned at creation, and a name-based SecretId
resolves to the stored secret's full ARN in the target account.

Closes #5364

* fix(iam): pick the Secrets Manager target by the serving operation

CreateSecret now reads only Name and other actions only SecretId, so a
field the handler ignores cannot choose the resource. Minted ARNs take the
request's partition, and a name lookup also reads a legacy unprefixed
secret for the default account. Adds an SDK compatibility test.

* fix(iam): resolve a partial-ARN SecretId to the stored secret's ARN

A SecretId given as an ARN without the random suffix is now authorized
against the stored secret's full ARN, resolved in the caller's account in
the order the operations use: an exact ARN first, then the ARN read as a
partial one. The enforcement tests share EnforcementFixtures' auth, a new
assumeRole helper, and a new createRole helper that removes the role after
the test. The Secrets Manager enforcement test also deletes the secrets it
creates.
2026-10-16 23:24:38 -04:00
Vũ Thế Huy 1cb8b0f747 feat(redshift-serverless): accept customDomainName in GetCredentials (#5856) 2026-10-16 23:11:42 -04:00
Vũ Thế Huy 2a012cf9a4 feat(redshift-serverless): add snapshot copy configuration actions (#5798)
* feat(redshift-serverless): add snapshot copy configuration actions

Add CreateSnapshotCopyConfiguration, ListSnapshotCopyConfigurations,
UpdateSnapshotCopyConfiguration and DeleteSnapshotCopyConfiguration. A
configuration is recorded and echoed; Floci copies no snapshot. A namespace has
one configuration at a time and the destination Region must differ from its own.
The configuration is tied to the namespace by the namespace's generated id, so a
namespace recreated under the same name does not inherit it.

Required members come from the AWS model through RedshiftServerlessRequestShapes.
The destination Region name and the retention range are checked by hand because
the model leaves them unconstrained.

* fix(redshift-serverless): validate boundary inputs and scope snapshot copy pagination tokens

* refactor(redshift-serverless): share maxResults range check and invalidPagination helper
2026-10-16 22:42:36 -04:00
XuJian d1509c368f fix(s3): default new buckets to BucketOwnerEnforced (#5782)
* fix(s3): default new buckets to bucket owner enforced

Initialize ownership controls at bucket creation and opt ACL-focused tests into legacy ownership modes. Repair existing import grouping so repository-wide Checkstyle passes.

* fix(s3): honor bucket ownership and ACL headers

Preserve explicit CreateBucket ownership and ACL grants, and reject grants incompatible with enforced ownership. Validate multipart grants at initiation and carry accepted grants through completion. Adapt ACL-focused regressions to opt into legacy ownership modes.

* fix(s3): respect account public ACL setting at bucket creation

* refactor(s3): share create-bucket ownership XML builder
2026-10-16 22:26:24 -04:00
Alessandro Lattao 197ccb5fb7 fix(cloudformation): refuse an update that has nothing to change (#5849)
* fix(cloudformation): refuse an update that has nothing to change

UpdateStack ran a full update for a stack resubmitted as it was, ending
UPDATE_COMPLETE, and CreateChangeSet created an AVAILABLE change set for
it. CloudFormation refuses the update with "No updates are to be
performed." and creates the change set FAILED, UNAVAILABLE, with "The
submitted information didn't contain changes. Submit different
information to create a change set."; the CDK and aws cloudformation
deploy read that reason as "no changes".

What CloudFormation compares was measured in eu-west-1: each active
resource's Type, Properties, Metadata, DeletionPolicy, UpdateReplacePolicy
and UpdatePolicy, and each active output's Value, Description and Export,
with whatever does not depend on a resource resolved first, and the tags
as a set (absent Tags keep the stack's). ComparedTemplate brings a
template to that form: a new Description, an unused parameter, a
DependsOn or a literal written as Fn::Join is no change, while a used
mapping value, a Ref of a resource rewritten as Fn::Sub, or a dynamic
reference whose stored value moved is one. Templates are compared as
processed, AWS::Include fragments read again and the SAM transform
applied with the stack's parameter values, and a stack with a nested
stack is always updated. The change set diff uses the same form.

The CDK deletes the FAILED change set and deletes it again by name
before its next deploy, so DeleteChangeSet now answers success for a
change set the stack does not have, as CloudFormation does. A stack set
instance whose stack has nothing to change is left as it is. Tests that
resubmitted an identical template to exercise an update add an output
through CfnUpdates.forceUpdate, which is an update on AWS too.

* fix(cloudformation): record dynamic reference values when an operation commits

Answers the review of #5849.

The value each dynamic reference resolved to is now recorded when the
stack's operation commits, from the template the stack then has and
keyed as ComparedTemplate hands the references over, instead of while
the engine provisioned each resource. Recording and comparison so see
the same strings, an Fn::Sub that also reads a resource included; an
update that fails and rolls back records nothing and keeps the last
deployment's values; a reference the template dropped is dropped; and
AWS::RDS::DBInstance's master credentials, which its provisioner
resolves itself with ssm-secure, are compared like any other reference.
The values are kept as an HMAC-SHA256 under a random key of the stack's
own rather than a bare SHA-256.

ComparedTemplate keeps an AWS::NoValue inside a function it compares as
written, and gives the array form of Fn::Sub the static variable
substitution the string form has, its own variables left as written.

A stack set instance with nothing to change succeeds whatever status an
earlier rolled-back update left its stack in, and the change set that
found it so is deleted. DeleteChangeSet by a change set's ARN alone
succeeds when the change set is gone, as measured on CloudFormation in
eu-west-1 on 2026-10-17.

The comparison now catches only what it can meet: a template that does
not parse, and the AwsException an AWS::Include, the SAM transform or an
SSM parameter raises, which the update itself then reports.
2026-10-16 21:53:03 -04:00
Vũ Thế Huy 7cab804d22 feat(redshift-serverless): add custom domain association actions (#5766)
* feat(redshift-serverless): add custom domain association actions

Add CreateCustomDomainAssociation, GetCustomDomainAssociation,
ListCustomDomainAssociations, UpdateCustomDomainAssociation and
DeleteCustomDomainAssociation. An association is recorded and echoed; Floci
serves no traffic on the domain and reads no ACM certificate. It is tied to the
workgroup by the workgroup's generated id, so a workgroup recreated under the
same name does not inherit it.

The domain name and certificate ARN patterns, lengths and the required members
come from the AWS model through RedshiftServerlessRequestShapes, so the service
carries no validation of its own.

* fix(redshift-serverless): address review findings for custom domains

- Expose custom domain name and certificate ARN in workgroup responses.
- Ensure custom domain names are unique across workgroups in a region.
- Remove ambiguous Pagination.paginate overload in favor of paginateNamespaced.
- Add domain name and certificate ARN validation patterns and length checks.
- Enforce validation for required parameters in custom domain operations.

* fix(redshift-serverless): enforce single custom domain per workgroup and populate certificate expiry

* fix(redshift-serverless): read certificate expiry dynamically and share custom domain serialization
2026-10-16 21:18:45 -04:00