The drift check fails on main as well: AWS has added SharingStrategy and
NvidiaMpsAllocation to AWS::ECS::TaskDefinition since main vendored the
file, and a fresh generation from main's own tree shows the same three
ECS shapes. The AWS::EC2::Instance and AWS::EC2::LaunchTemplate entries
this PR vendors already match AWS. The resync is an unrelated change, so
the vendored file goes back to this PR's EC2-only addition; the check
stays red until main syncs.
This reverts commit 092eb432f.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
A rolled-back update that changed only tags puts the declarations back
and reports that it could not undo the update, without touching the
options. A stack whose update only declares the default HttpTokens the
instance already has ends UPDATE_ROLLBACK_COMPLETE when a later
resource fails, and a string member left out with Fn::If and
AWS::NoValue keeps its default. The ec2 notes say that a blank member
is refused and that an update that changed no EC2 setting rolls back in
full, which covers any property Floci does not apply, not only
MetadataOptions. A stale test name and comment are corrected.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
The vendored file lacked the AWS::ECS::TaskDefinition SharingStrategy
and NvidiaMpsAllocation members AWS has published since it was last
generated, so the drift check, which runs when a change touches the
file, failed. This is make cfn-property-types-sync, and the file now
matches AWS's schemas.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
An update that kept the instance saved a rollback record only when it
changed the instance's MetadataOptions. One that changed only what was
declared, such as declaring a default the instance already had, left
rollbackUpdate nothing to restore, so a later resource's failure ended
the stack with "Rollback is not implemented". Every update that keeps
the instance now saves its __FlociDeclared records, with the prior
options only when it changes them, and a rollback restores what was
saved and counts as done when nothing else on the instance changed.
A MetadataOptions member given as an empty or padded string read as
absent, so HttpTokens: "" launched with the default. The text is now
kept as written and EC2's checks refuse it, as EC2 does; AWS::NoValue
still leaves a member out.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
A tag change in the same in-place update makes a rollback put the
MetadataOptions back but report the update undone, and a tag failure
leaves the options unchanged, since they are the update's last change.
The validation comment now lists tags among what runs before them.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
The EC2 notes now say that AWS::EC2::LaunchTemplate stores
MetadataOptions and AWS::EC2::Instance launches with its own over its
template's, what a wrong type and AWS::NoValue do, that an update
applies and resets options in place and a rollback puts them back, and
that a changed or dropped LaunchTemplate keeps the instance where AWS
replaces it, unless the ImageId or KeyName it supplies changed.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
An update that kept the instance and changed its MetadataOptions left
them changed when a later resource failed and the stack rolled back:
rollbackUpdate undid replacements only, so the instance kept options
the stack no longer declared, and the stack reported that the update
could not be rolled back.
The update now saves the options it replaces, with their region and the
instance's __FlociDeclared records, and changes them last, after the
tags, so nothing else in the step can fail after them. rollbackUpdate
puts both back. The rollback counts as done only when the update changed
nothing else on the instance; the instance type, groups, user data,
profile and tags still have no rollback, so the stack keeps saying so
for them, with the options put back all the same. Ec2Tags.reconcile now
reports whether it changed anything, so a tag change counts. A committed
or cleared update drops the saved copy.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
When LaunchTemplateData is absent or an intrinsic call, its resolved
form has no MetadataOptions member either, so the fallback to it always
gave null. Say so and use null. A test row also covers a launch template
whose MetadataOptions is a string.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
The launch template read its MetadataOptions from LaunchTemplateData
after resolving it, which turns AWS::NoValue into an empty string, so
since the previous commit a block or hop limit left out with Fn::If and
AWS::NoValue failed the template as the wrong type. Read the block as
the template writes it, with AWS::NoValue already left out, as the
instance does.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
AWS::EC2::Instance and AWS::EC2::LaunchTemplate read a MetadataOptions
member given as a list or an object, such as HttpTokens: [required], as
absent, so the instance launched with HttpTokens=optional; a block that
was not an object was dropped the same way. Read the block through
CfnPropertyTypes against the shape each resource schema declares, as
AWS::AutoScaling::LaunchConfiguration is: a block or member of the
wrong type now fails the resource with CloudFormation's template
validation error, and a hop limit that is not a whole number says what
it is ("found: Float") rather than a message Floci made up.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
AWS::EC2::Instance and AWS::EC2::LaunchTemplate are to read their
MetadataOptions through CfnPropertyTypes, so the generator lists them
and checks the MetadataOptions members they rely on. Only their entries
are added to the vendored file: a fresh generation also carries new
AWS::ECS::TaskDefinition members AWS has published since, which belong
to their own sync.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
When the replacement's delete fails and the saved declarations cannot
be read, report the delete failure with the read failure suppressed,
rather than replacing it.
The docs and the provisioner comment said every launch template change
keeps the instance; an ImageId or KeyName the template supplies still
replaces it, and a change set still previews a literal LaunchTemplate
change as a replacement. Tests pin the replacement and a retried
rollback.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Replacing an instance on another launch template, version or none could
not be made to agree with the change-set preview: a Version given by
Fn::GetAtt LatestVersionNumber previews no replacement, and the template
publishes a new, identical version for a Metadata-only change. Keep the
instance in place, as upstream does, and reconcile what the template
declares; the docs state this as a deviation from AWS.
A rollback whose delete of the replacement throws has already named the
prior instance again, and a rollback that then skips the resource never
calls back, so put the prior instance's declared records back before
rethrowing. A saved copy that cannot be read now fails the rollback.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
The previous commit left a new version of the same launch template in
place, on the grounds that the template's provisioner publishes a
version on every stack update. It publishes one only when the template
itself changes, so an instance naming Fn::GetAtt LatestVersionNumber
sees its LaunchTemplate change exactly when AWS replaces it. The
recorded spec now includes the version, and the change-set preview and
the update agree: another template or version, or none, replaces the
instance; one added to an instance launched without one keeps it, and
an instance launched without one now carries no record at all.
When a later resource failed a replacing update, the rollback restored
the prior instance but kept the attempt's __FlociDeclared records, so a
retry compared against the wrong declaration (a retried template drop
kept the instance requiring tokens). The records as they stood before
the replacement are saved and put back by rollbackUpdate, and cleared
when the update completes.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
LaunchTemplate is a replacement property of AWS::EC2::Instance, and
Floci's change-set preview already says so, but an update kept the
instance whatever happened to it: removing the template (CDK's
requireImdsv2 turned off) reset the instance's options in place where
AWS launches a new instance. The provisioner now records which template
it declared and replaces the instance when the update names another
one, adds one or drops it. A new version of the same template is still
applied in place, because Floci's AWS::EC2::LaunchTemplate publishes a
version on every stack update.
The record of declared MetadataOptions now keeps only the member names,
which is all the reset needs, instead of a serialized model object.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
An update that keeps an AWS::EC2::Instance applied its MetadataOptions
last, after resizing it and rewriting its security groups, user data
and profile, so a bad value failed the update with the instance half
changed while the stack reported a rollback. The options are now
checked with EC2's own rules before anything changes, which needs
Ec2Service.validateMetadataOptions to be public.
An update that stopped declaring an option, its own or through its
launch template (CDK's requireImdsv2 turned off), left the instance
with it. The provisioner now records what it declared and returns an
option it no longer declares to the launch default, as it already does
for an instance profile it stops declaring.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
AWS::EC2::LaunchTemplate dropped LaunchTemplateData.MetadataOptions,
and AWS::EC2::Instance read only the image, type and key from its
launch template and ignored its own MetadataOptions. A CDK instance with
requireImdsv2 therefore launched with HttpTokens=optional, and
DescribeInstances reported that whatever the template declared.
The template now stores the block, the instance launches with its own
options over its template's, and an update that changes them applies
them in place with ModifyInstanceMetadataOptions, as the property's
"No interruption" update behavior allows. A hop limit that is not an
integer fails the resource.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* 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.
* feat(sfn): encode HTTP Task object bodies as form data
* refactor(sfn): simplify HTTP Task payload encoding
Reuse the shared RFC 3986 URI encoder and remove the unused form payload branch while preserving buffer and no-body requests.
* 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.
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.
* fix(cloudformation): infer no leftover order from custom resource data
Leftover ordering read every attribute of a resource the template no
longer names as a reference to what it uses. A custom resource's
attributes are its handler's response Data, which can name a resource
that depends on it, so a custom resource whose Data named a bucket that
DependsOn it was deleted before the bucket. Before leftovers were
ordered, reverse creation order got this right.
A custom resource is now one the dispatcher routes to the generic
handler, and of its attributes only Floci's own __Floci keys, such as
its ServiceToken, count. Custom::DynamoDBReplica has its own provisioner
and keeps the edge its TableName gives. A nested stack's Outputs.* and
an SSM parameter's Value are values passed through, not references, and
no longer order leftovers either.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): order leftovers without recursion
The leftover walk recursed once per link, so a long chain of leftovers,
each naming the next, could overflow the stack. A StackOverflowError is
not an Exception, so it got past the fall back to insertion order and
stopped the delete, cleanup or rollback. The walk now runs on an explicit
stack, with the same memo and the same cut where a cycle closes. Its
test walks 10,000 links on a small thread stack, which the recursive
walk overflows, and waits for it a bounded time.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): keep a leftover's own id from ordering it after a dependent
Some dependents take their parent's id as their own physical id: a
bucket policy is named by its bucket, a secret target attachment by its
secret's ARN. The parent's attribute naming that id then matched the
dependent, so a leftover bucket or secret was deleted before the policy
or attachment that depends on it.
An attribute naming the leftover's own id is no longer a reference, nor
is a resource whose id extends it. A leftover whose id extends another's
past a separator, as parent-1/child-1 does parent-1, goes before that
resource. A bucket policy or secret target attachment goes before
whatever else holds its id, including a bucket or secret the template
still names, whichever of the two was recorded first.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): order a custom resource or nested stack by what it was given
Leftover ordering read no edges from a custom resource's Data or a
nested stack's outputs, which left both with nothing they use. A custom
resource whose properties name a bucket it empties went after that
bucket, and a nested stack whose child created subnets in a VPC the
parent passed it went after the VPC, which then could not be deleted.
A Lambda ServiceToken, an ARN, never matched its function either, whose
physical id is its name.
A custom resource now orders by its resolved properties, with the
function name any Lambda ARN in them gives. A nested stack records the
parameters it passes its child under hidden __FlociUses keys and orders
by those. An SSM parameter's Value is what the parameter was given, as
with Value: !Ref Bucket, so it counts again. The registry now says which
types the generic custom-resource handler serves.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): let a leftover's own id still name another resource
A value equal to a leftover's own id was skipped outright, so a leftover
rule named like the event bus it is on lost its EventBusName edge and
went after the bus, which cannot be deleted while it has rules. Such a
value now skips only the leftover itself and the dependents that take
the same id. A function URL and a cluster's capacity provider
associations also take their parent's id, so they go before it. A
leftover recorded without a type no longer throws on the type check,
which had sent the whole stack back to insertion order.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): order a custom resource or nested stack by the resources it names
Ordering a leftover custom resource by the text of its properties, and a
nested stack by the values of its parameters, also matched literals. A
certificate resource given a domain's name went before the custom domain
that uses the certificate, which then cannot be deleted.
A custom resource or nested stack now keeps, as it is provisioned, the
physical id of each resource its definition names through Ref,
Fn::GetAtt, Fn::Sub or DependsOn, under hidden __FlociUses keys, and is
ordered by those. An update replaces them, and a rolled-back update puts
back the ones from before. Its properties and parameters are no longer
read for this.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): find what a leftover depended on by its logical id too
A custom resource or nested stack keeps the physical id of each resource
its definition names, but an update replaces a resource it only
DependsOn without touching it, so the id it kept goes stale and the
leftover lost that edge. A kept resource now also counts as whatever the
stack holds under its logical id.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): let what a definition named outweigh a shared id
CDK's S3AutoDeleteObjects resource takes its bucket's name as its id and
depends on the bucket and its policy. Left over with both, the bucket's
own name named the custom resource, the own-id rule dropped the policy
the definition named, and the policy counted the custom resource as the
holder of its id it uses, so the bucket went first and its delete failed
on the objects the custom resource would have removed.
What a definition named is now found by logical id and taken as given,
and a resource whose definition named a leftover is its dependent, not
something it uses. A nested stack saved before definitions were kept
orders by its outputs again, as it did then.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* docs(cloudformation): say which leftovers order by their kept uses
A nested stack keeps no uses when its definition names no resource, as
well as when it was saved before uses were kept, and orders by its
outputs either way. A kept use is found by its logical id, its physical
id being a record. A resource whose own definition named a leftover is
skipped by all three inferred rules, not only the value match.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): read no parent from a WAF or custom action type id
A WAFv2 web ACL or IP set has the physical id name|id|scope, and a
CodePipeline custom action type category|Custom|provider|version. Their
first part is their own identity, not a parent's id, yet the leftover
walk read it as the id of a resource they belong to, so a leftover web
ACL sharing a bucket's name was ordered after the bucket. These types no
longer get an edge from a prefix of their own id.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): keep a DependsOn-only change for a later leftover delete
An update that changes only a custom resource's or nested stack's
DependsOn does not re-provision it, so the resources it was kept as
using stayed as they were, and as a leftover it could later be deleted
after a resource it had come to depend on. As an update commits, what
each custom resource and nested stack the template names now names is
kept again. An update that rolls back keeps what was kept before.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): refresh kept uses only for active resources, safely
The refresh as an update commits re-read the definition of a custom
resource or nested stack whose condition had turned false, choosing its
Fn::If branches by conditions it was never provisioned under; if its
cleanup delete then failed, it stayed held with uses it never had. It
also ran where a failure would skip the committed update's cleanup. Such
a resource now keeps what it was provisioned with, and a failure in the
refresh is logged and costs only those keys.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(cloudformation): let provisioners say how their ids name a parent
The leftover walk listed in CloudFormationService which types take their
parent's physical id (bucket policy, secret target attachment, function
URL, capacity provider associations) and which types' ids name no parent
(WAFv2 web ACL and IP set, CodePipeline custom action type). That is
knowledge of how those types are provisioned. Two default hooks on
CfnResourceProvisioner, asked through the dispatcher as for replacement
updates, now let the S3, Secrets Manager, Lambda, ECS, WAFv2 and
CodePipeline provisioners say it for their own types. No behaviour
changes.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(cloudformation): answer the provisioner hooks as production does
The rollback test's stand-in provisioners were plain mocks, so they
answered no to a prefix of a custom resource's id naming its parent,
where a provisioner that overrides nothing answers yes. They now call
the interface's own defaults, the dispatcher test checks a custom type
keeps them, and a static import is back in order.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* 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.
* 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
* feat(lambdaweb): publish the Web Function metrics to CloudWatch
AWS counts a request that reached an environment in ExecutedRequests, also one answered with
Runtime.OriginRequestError or Runtime.RequestTimeout. The status classes count the platform pages too,
except the 400, 404 and 505 pages. Each environment has a datapoint at init, also a failed one, then
one each minute and one when it ends.
* fix(lambdaweb): bound the waiting metric writes and store them before shutdown
* fix(lambdaweb): report each answer before it goes out and build datapoints with MetricDatum.of
A test can then wait for the publisher once and read the metrics without polling. RDS and SES build
their datapoints with the same factory.
* fix(lambdaweb): wait for the metric writes even when their queue is full
The wait now takes the last accepted write instead of a slot in the queue.
The writes run one at a time in order, so once it is done all are.
Only PutMetricData stores a zero timestamp as the current time, so the
MetricDatum.of comment says so.
* 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.
* 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>
* fix(s3): check the extra IAM actions a CreateBucket needs
A CreateBucket whose headers configure the new bucket needs more than
s3:CreateBucket, as the CreateBucket API reference lists:
- s3:PutBucketAcl for a canned ACL other than private, or a grant header
- s3:PutBucketObjectLockConfiguration and s3:PutBucketVersioning for
x-amz-bucket-object-lock-enabled: true
- s3:PutBucketOwnershipControls for x-amz-object-ownership
S3Controller now checks these actions before the bucket is created, so
a denied request creates nothing.
* chore(s3): move the CreateBucket header actions next to the object ones
S3ObjectActions.bucketCreationActions now gives the actions a
CreateBucket needs from its headers, and reuses GRANT_HEADERS.
EnforcementFixtures.putUserPolicy replaces the test's own PutUserPolicy
helper.
* 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.
UpdateAccessKey refused the Expired that statusType permits, answered a
message of its own making, and read the status only after it had looked the
key up, so a bad key carrying a bad status answered NoSuchEntity 404 where the
shape is what AWS answers for. The reference's Valid Values line on the
operation reads "Active | Inactive | Expired" and the pinned model's
statusType holds those same three.
The fix is one call rather than a new rule. requireStatusFromEnum already
serves UpdateSigningCertificate, UpdateSSHPublicKey and
UpdateServiceSpecificCredential: it validates before each of those lookups and
answers the rendering a recording of the third shows, naming neither the
offending value nor the permitted set. UpdateAccessKey was the one operation
of the four not calling it, so it calls it, and the helper's javadoc and the
set behind it say four instead of three.
UserName was the other half. The page carries the sentence DeleteAccessKey
carries, "if the UserName is not specified, the user name is determined
implicitly based on the AWS access key ID used to sign the request", and the
handler passed the raw parameter straight through, so a call that omitted it
compared the key's owner against null and answered NoSuchEntity. It resolves
through resolveUserName now, as GetUser, ListAccessKeys and DeleteAccessKey
do, and AccessKeyId is read through requireParam, as the sibling handlers read
the ids they require.
AWS::IAM::AccessKey refused Expired as well, and its own Allowed values line
in the CloudFormation template reference reads "Active | Inactive | Expired".
Leaving it would have been the same drift on a second surface, and taking
Expired on the API while refusing it in a template is worse than either
alone. The provisioner keeps its own guard, which runs before a key is created
so that a refusal cannot orphan one, and its own message, which names the
resource it refuses.
One more drift came out of reading the method back, and it is the one that
mattered. updateAccessKey is a read-modify-write that took no lock, where each
of the three sibling status operations holds its family's. There was no access
key lock at all: createAccessKey counted a user's keys and only then stored
another, and the user rename rewrote each key's owner outside one, the single
credential family that rename did not guard. Measured before the fix, racing
the calls against each other: an update racing a delete wrote the deleted key
back on 80 of 2000 trials, and four callers racing the two-key quota left more
than two on 226 of 500. One accessKeyLock now covers the count and the store,
the lookup and the delete, the read-modify-write, and the rename's loop, and
the owner check that the delete and the update each carried is one helper.
Substituting a fresh monitor for that lock at all four sites fails the quota
case on its first trial and the resurrection case by its eighty-third.
Three more places the lock has to reach, each measured the same way. The rename
read the key list before taking the lock and rewrote it inside, so a delete that
landed in between was undone and the key came back under the new name, where it
authenticates again; the read moves inside the lock, where every other
credential family already reads its own, and putting it back outside fails by
the third trial. createAccessKey confirmed the user before taking the lock and
deleteUser checked for keys without holding it, so a create could store a key
for a user the delete had just removed; the confirmation moves inside the lock,
the way UploadSigningCertificate's already is, and deleteUser holds the lock
across its key check and the delete, outermost of the five it nests, which is
the order UpdateUser leaves intact by taking that lock on its own. Reverting
either half alone puts the orphan back, by the seventeenth trial and by the
second.
Fifteen tests. Seven over the wire: Expired stored and read back, a status
outside the set, an absent status, an absent key id, the order against a key
that is not there, a call that names no user, and another user's key still
answering NoSuchEntity. Three on the service for the three statuses, the
order, and the absent status. One on the provisioner for a template declaring
Expired. And four in IamConcurrencyTest, which raced six collections and
no credential family before this: an update against a delete, four creates
against the quota, a rename against a delete, and a create against DeleteUser.
The two refusals also read the key back, over the wire and on the service, so a
validation that wrote before it refused would not pass them. What is left is
the count: AWS reports "2 validation errors detected" when the id and the
status are both wrong, where every message here leads with one, which is the
follow-up #5280 already carries.
synthesizeContainerBackedRevision hashed the raw, caller-supplied version
string, but BaGetter's own version matching (BagetterSidecarClient.matchVersion,
via NuGetVersions.normalize) already normalizes a requested NuGet version
before resolving it, per AWS's own documented leading/trailing-zero rules.
Two equivalent spellings of the same stored version (1.00.0 and 1.0.0)
therefore returned different versionRevision values, and a revision obtained
with one spelling never matched a revision-pinned request using the other.
Normalizes the version for nuget only before hashing, shared by every one of
synthesizeContainerBackedRevision's six call sites (DescribePackageVersion,
GetPackageVersionAsset, GetPackageVersionReadme, both sides of
CopyPackageVersions, and ListPackageVersionAssets), so a single change fixes
all of them consistently rather than patching one at a time. Maven, npm, and
pypi are unaffected: only BaGetter's client normalizes the requested version
before matching; Reposilite and Verdaccio match the literal string.
Fixes#5967.
PutObjectRetention, GetObjectRetention, PutObjectLegalHold and
GetObjectLegalHold on a bucket without Object Lock set or returned the
setting with a 200. S3 refuses them with 400 InvalidRequest, "Bucket is
missing Object Lock Configuration", as LocalStack's AWS-validated
recordings show, and Floci now does too, before it looks for the key.
A legal hold without a status is still refused as malformed first, as
recorded.
PutObject, CopyObject and CreateMultipartUpload applied a mode, a
retain-until date or a legal hold of ON on such a bucket as well, and
since deletes enforce the lock there too, a COMPLIANCE object in it
could not be deleted until its date passed. They are refused the same
way. No AWS document or recording covers object creation; moto refuses
the same headers with InvalidRequest under its own message, so the
recorded one is used. A legal hold of OFF sets no lock and is still
accepted.
In a bucket with Object Lock, GetObjectRetention and GetObjectLegalHold
of an object without a retention or a legal hold answered 200, with no
mode or with OFF. S3 was recorded answering both with 404
NoSuchObjectLockConfiguration, which they answer now.
PutObjectRetention saved a mode without a date, a date without a mode,
or a mode S3 does not know. S3 was recorded refusing a mode without a
date, and an unknown mode, with 400 MalformedXML, and a date without a
mode would now read as no retention at all, so all three are refused
that way. A retention naming neither still removes it.
* 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.
* 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.