* feat(dynamodb): import tables from S3 and report new exports as IN_PROGRESS
ExportTableToPointInTime handed its worker the same description object it
returned, so a small export could already read COMPLETED in the initial
response. The worker now mutates a copy and runs under the request account.
ImportTable creates the table in CREATING, loads DynamoDB JSON lines from
every object under the S3 prefix on a virtual thread, and flips the table
to ACTIVE when done. DescribeImport and ListImports report it. DYNAMODB_JSON
with NONE or GZIP compression is accepted. CSV, ION and ZSTD are rejected
with a ValidationException.
* fix(dynamodb): item calls on a CREATING table return ResourceNotFoundException
* fix(dynamodb): concurrent ImportTable calls with one ClientToken share one import
* fix(dynamodb): import reads S3 as the caller and denies another account's bucket
* feat(sfn): publish Parallel branch and Map iteration history events
The states inside a Parallel branch or an inline Map iteration now publish
their events into the execution history.
The cause of a failure the interpreter raises now carries the AWS prefix
"An error occurred while executing the state '<name>' (entered at the event
id #<n>). ". It is written once, at the innermost state.
Every shape was verified against real Step Functions in us-east-1.
* feat(sfn): record EvaluationFailed for JSONata failures
A JSONata expression that fails now leaves the EvaluationFailed event AWS
records, with error, the attributed cause, location and state. The location
names the field the way the cause does. The event is recorded once per
attempt when the state retries, and before the Failed event and the Catch.
A Catch clause whose own expression fails records it from where the state
stood before its first Failed event, then fails the state again.
Verified against real Step Functions in us-east-1
* fix(sfn): record every Distributed Map run so DescribeMapRun resolves its ARN
* fix(sfn): stop counting history events once the execution has ended
RunInstances stores the MetadataOptions it is given, with AWS's launch
defaults for anything left out, and DescribeInstances reads the stored
values back instead of a hardcoded block. A launch template's metadata
options seed the launch and explicit request fields override them.
ModifyInstanceMetadataOptions changes only the fields it names and
returns the instanceMetadataOptions shape. Values outside the AWS
enumerations and a hop limit outside 1 to 64 are InvalidParameterValue.
Ported from lex00/floci#116, whose SSM half is floci-io/floci#3173.
* feat(controlcatalog): add control lookup operations
* fix(controlcatalog): complete control lookup contracts
* test(controlcatalog): verify pagination continuation
* fix(controlcatalog): move control model to package
* fix(controlcatalog): integrate service storage lifecycle
Add clientid(), timestamp(), accountid() and newuuid(), the isNull() and
isUndefined() functions, the IN operator against a payload array or an
array literal, and array literals such as [lat, long], each following
the tables in the AWS IoT SQL reference. Equality extends to arrays
(element by element, in order) and objects (by key, in any order).
clientid() needs the MQTT client that published, so publish and
handlePublish carry the client id: the broker passes its session's
client id and an IoT Data Publish over HTTP passes none, which the
function reports as n/a as AWS does.
principal() stays unparsed: it returns the certificate a device
authenticated with, and the broker does not verify one yet.
* fix(sts): return ExpiredTokenException for an expired web identity token
AssumeRoleWithWebIdentity mapped every WebIdentityTokenVerifier failure to
InvalidIdentityToken, so an expired but otherwise valid IRSA token got the
same wire error as a bad signature or wrong issuer. Real STS reports the
expiry case as ExpiredTokenException so callers can refresh and retry.
Fixes#3205
* test(eks): inject EksOidcService through the test constructor
Docker context endpoint now ranks between DOCKER_HOST and the hardcoded
platform default, so Colima/OrbStack/Podman work without manual setup.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* Fix#1990
PutBucketAnalyticsConfiguration, GetBucketAnalyticsConfiguration,
ListBucketAnalyticsConfigurations and DeleteBucketAnalyticsConfiguration,
plus the four inventory counterparts, follow the shape the metrics and
intelligent-tiering configurations already use. Each body is validated
against the published schema and re-serialized in the AWS element
order, stored on the bucket record under its id, and returned from the
single and list reads. The PUT and DELETE forms are routed ahead of the
unqualified CreateBucket and DeleteBucket so they cannot fall through.
* fix(lambda): honor MaximumBatchingWindowInSeconds on SQS event source mappings
CreateEventSourceMapping, GetEventSourceMapping and UpdateEventSourceMapping now
parse, validate (0 to 300), persist and return MaximumBatchingWindowInSeconds
instead of silently dropping it.
When the window is greater than 0 the SQS poller holds an underfilled batch open,
accumulating messages across polls, and invokes the function once the batch
reaches BatchSize or the window elapses since the first buffered message. A window
of 0 or unset keeps the previous invoke-on-first-receive behavior.
Closes#3155
* fix(lambda): cover the batching window in SQS message visibility and window-off transitions
Address review feedback on the batching-window poller:
- Visibility timeout is now fn.timeout + window + 30 instead of the max of the two,
so a message buffered for the full window and then processed for the full
function timeout stays invisible for the whole span. Otherwise a long invoke
could outlive the visibility and another consumer would receive a duplicate
with a stale receipt handle.
- When the window is changed from positive to zero (or unset) on a live mapping,
the poller now drains and delivers any already-buffered batch on the next tick
instead of ignoring it, so those messages are not stranded until their
visibility expires and cannot be replayed alongside fresh copies if a positive
window is later restored.
* feat(iot): configurable DescribeEndpoint address for published AWS IoT ports
AWS IoT's DescribeEndpoint returns a bare hostname and each client adds its
own port (8883, 443 or 8443). Floci returns host:4566 because its HTTP data
plane lives there and IoT Data clients build https://<endpoint> from it. Both
are right for their callers, and Floci inside a container cannot tell whether
the operator published the AWS ports.
floci.services.iot.endpoint-address (FLOCI_SERVICES_IOT_ENDPOINT_ADDRESS)
is returned as is for every endpoint type when set; unset or blank keeps the
host and port of the base URL. EmulatorConfig.iotEndpointAddress() resolves
it once for DescribeEndpoint and for the AWS-managed domain configurations,
which now follow a changed address instead of keeping the value they were
seeded with. The name joins the generated server certificate's SANs the way
FLOCI_HOSTNAME does, so devices verify it on 8883 and 443.
* docs(iot): DescribeEndpoint address when the AWS IoT ports are published
Describe FLOCI_SERVICES_IOT_ENDPOINT_ADDRESS on the IoT page with the
compose port layout it is meant for, note it on the TLS page next to the
other names the server certificate covers, and list the IoT Core variables
in the environment variable reference.
* fix(tls): accept only host or host:port as the IoT endpoint certificate name
A value with a query or fragment, such as host?x=1, still parsed to a host
and was added to the server certificate. The name now has to be exactly the
authority java.net.URI reads back, so anything beyond host[:port] is skipped
with the same warning as a URL or a path.
* test(iot): pin the address the concurrent seeding test asserts at the end
Every caller had already been joined, so the final describe could not race,
but setting the address explicitly before it makes that plain to read.
TagResourceOutput and UntagResourceOutput are empty structures with a
declared resultWrapper, so the Query responses must carry the
TagResourceResult and UntagResourceResult elements. The AWS Go SDK v2
unmarshaler behind the Terraform AWS provider fails on a response
without them even though the tag write succeeded.
Ported from lex00/floci#89.
DefaultCacheBehavior/CacheBehavior parsing tracked a single inAllowedMethods
flag across the whole <AllowedMethods> element, so <Method> entries nested
inside the sibling <CachedMethods> sub-object were folded into the parsed
AllowedMethods list too (and CachedMethods itself was silently dropped).
Since terraform-provider-aws's aws_cloudfront_distribution requires both
allowed_methods and cached_methods on every cache behavior, this produced a
permanent per-plan diff: AllowedMethods.Items came back duplicated
(["GET","HEAD","GET","HEAD","OPTIONS"]) and CachedMethods was missing
entirely.
Scope one of the two follow-up fidelity gaps flagged (but deliberately left
unfixed) by #3015, which fixed the TrustedSigners crash from #2767. The
other gap from that issue (ForwardedValues/MinTTL/DefaultTTL/MaxTTL dropped
on read-back for the legacy forwarded_values cache-behavior path) is a
separate, larger change, filed as #3208.
Name collisions on CreateFirewall/CreateRuleGroup/CreateFirewallPolicy now
raise the modeled InvalidRequestException instead of an unmodeled
ResourceAlreadyExistsException. Every UpdateFirewall*/Associate*/
Disassociate* firewall mutation now checks a caller-supplied UpdateToken
against the firewall's current token and rejects a mismatch with
InvalidTokenException, matching botocore 2020-11-12.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* Fix#2600
Base64-encode non-UTF8 request bodies instead of lossily decoding them,
map response cookies to separate Set-Cookie headers, and return 502
when the invoked function raises an unhandled error.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* Fix#3153
* feat(redshift-data): resource resolver, connection factory, statement store, service registration
* feat(redshift-data): field mapper, column metadata, SQL parameter binding
* feat(redshift-data): execute, describe, and paged result retrieval
* feat(redshift-data): batch execution, list statements, cancel
* feat(redshift-data): schema introspection operations
* test(redshift-data): end-to-end Data API over a real cluster plus SDK compatibility test
* docs(redshift-data): document the Redshift Data API surface
* fix(redshift-data): address code review findings
- rejectMultiStatement now reuses the SQL tokenizer so a semicolon inside a
comment, string literal, or dollar-quoted block no longer rejects a valid
single statement
- GetStatementResultV2 gains unit coverage for the typed and CSV envelopes
- CSV output is RFC 4180 quoted (embedded comma, quote, CR, LF)
- batch rollback is asserted transactionally in the integration test
- RedshiftDataFieldMapper logs a swallowed blob-read SQLException
- RedshiftPid/RedshiftQueryId use a non-negative hash
- NextToken that decodes to a negative offset is rejected
- CancelStatement leaves a FAILED statement FAILED
- DescribeTable paginates ColumnList and emits NextToken
- DbUser is echoed on the SecretArn path
- the statement store no longer builds its sweeper executor in the test constructor
* fix(redshift-data): address PR #3186 review findings
- SQL scanner handles PostgreSQL escape strings (E'...'): a backslash-escaped
quote no longer ends the literal and mis-detects a following :name as a bind
marker; plain '...' literals still treat backslash as an ordinary character
- ListStatements clamps MaxResults to 1..100 so MaxResults=0 no longer emits the
same NextToken forever
- DescribeTable matches Table / Schema exactly (=) instead of LIKE, so a name
containing _ or % cannot merge other tables' columns into ColumnList
- register the service in the README category table
- drop a stray em dash from the neighbouring services.yaml comment
* fix(redshift-data): bind string parameters untyped so real PostgreSQL infers the column type
CI ran the integration test against a real Redshift (PostgreSQL 15) cluster and
parameterisedStatement failed: a string bound to an int column via setString
raised "operator does not exist: integer = character varying". H2 in PostgreSQL
mode coerces it, so the unit test missed it.
- RedshiftDataConnectionFactory adds stringtype=unspecified to the JDBC URL, so
setString sends the value untyped and the server infers the target type,
matching how AWS binds Redshift Data API parameters
- ListStatements now rejects MaxResults above 100 with ValidationException
instead of silently clamping (PR #3186 re-review)
- RedshiftDataOperationsTest uses JBoss Logging, not java.util.logging (PR #3186 re-review)
* fix(redshift-data): back the statement store with StorageFactory
The store held a bare ConcurrentHashMap outside the configured storage and
lifecycle model. It now obtains an account-aware backend through StorageFactory
("redshift-data", statements.json), the same as Athena's query store, resolved to
the global storage mode via the catalog descriptor. Default mode stays memory, so
statements are still lost on restart as documented; the 24h TTL sweep now walks
every account partition and deletes per account since the sweep thread has no
request context. StoredStatement is annotated for reflection and field-visible
serialization so persistent modes round-trip it.
* test(redshift-data): cover StoredStatement serialization round-trip and values()
The StorageFactory-backed store serializes StoredStatement in persistent modes.
Adds a round-trip test through the exact mapper PersistentStorage builds,
covering the ArrayNode, enum, Instant, and nested sub-statement fields plus the
field-visibility annotation, and a values() test.
* fix(redshift-data): register the nested Status enum for reflection
PersistedModelReflectionTest walks every type reachable from a StorageFactory
persistence root; StoredStatement.status pointed at an unregistered enum, so
native-image deserialization of a persisted statement would fail on restart.
A ".$" Parameters/ResultSelector/ItemSelector field whose JSONPath does not
resolve against the input now fails the state with States.Runtime instead of
silently resolving to null, matching real AWS. An out-of-range array index
keeps resolving to null, the one leniency AWS actually has here.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* Fix#2521
* feat(pipes): validate ParallelizationFactor on Kinesis and DynamoDB sources
SourceParameters is stored as an opaque JsonNode, so ParallelizationFactor
already round-tripped through CreatePipe, UpdatePipe and DescribePipe with no
bounds applied at all. Apply the AWS constraints in validateSourceConfiguration,
which both the create and update paths already run:
- reject the field on a source its parameter block does not describe, for
example KinesisStreamParameters.ParallelizationFactor on an SQS source
- require a numeric, then an integral value
- require a value in [1, 10], reported with the offending value
The tiering and message shape follow LambdaService.parseScalingConfig, which
applies the equivalent MaximumConcurrency bounds for SQS event source mappings.
The value is persisted and returned on the wire but not yet enforced: the poller
opens an iterator on a single hardcoded shard and delivers one batch at a time,
so there is no per-shard concurrency to scale. Record that on both iterator
initializers and in an enforcement-status note in the docs, matching how
ScalingConfig documents the same gap for Lambda.
* fix(pipes): reject a ParallelizationFactor wider than an int
asLong hands back the low 64 bits of a BigInteger, so a value such as
2^64 + 5 read as 5 and passed the [1, 10] bounds check: CreatePipe accepted
it over raw HTTP and persisted the original digits. Gate the bounds on
canConvertToInt and report the value with asText, so an oversized literal is
rejected and named in full. Real AWS rejects it too, the field being an int32.
Also correct the docs: ListPipes returns pipe summaries and omits
SourceParameters entirely, so only DescribePipe echoes the factor back.
* feat(rds): implement CreateDBSnapshot and RestoreDBInstanceFromDBSnapshot for postgres (#1817)
* feat(rds): implement CreateDBSnapshot and RestoreDBInstanceFromDBSnapshot for postgres (#1817)
* feat(rds): generated docs
* fix(rds): preserve master password across DbSnapshot restore
* fix(rds): preserve thread interrupt flag in restorePostgresSnapshot
* fix(rds): handle duplicate RDS snapshots and mock mode operations
* fix(rds): separate stdout and stderr in container exec to prevent snapshot corruption
* fix(rds): add missing stderr argument to ContainerExecResult on timeout
* fix(rds): cleanup RDS instance on snapshot restore failure
* fix(rds): return structured AWS error when RDS snapshot restore fails
* fix(rds): address PR #1894 snapshot and restore review comments
- Wire handleDescribeDbSnapshots to use the new snapshots storage backend
- Change engine validation error from UnsupportedOperation to InvalidDBInstanceState
- Change restore failure error from InvalidDBSnapshotStateFault to InvalidDBSnapshotState
- Add corresponding unit and query handler tests
* fix(rds): address PR #1894 review feedback and restore process issues
- Wire DescribeDBSnapshots to the snapshots storage backend with filtering support
- Align CreateDBSnapshot engine error code to InvalidDBInstanceState
- Align restore snapshot failure error code to InvalidDBSnapshotState
- Carry over dbName from DbSnapshot to the restored DBInstance
- Connect to template1 during psql restore to prevent active postgres connection drop failures
- Remove unused AwsNamespaces import in RdsService
- Add corresponding unit and query handler tests
* fix(rds): address PR #1894 review feedback and snapshot error handling
* fix(rds): add --if-exists to pg_dumpall snapshot command
- Appends the --if-exists flag to pg_dumpall commands during database snapshot creation. This ensures DROP DATABASE statements are emitted conditionally, preventing restore failures on fresh container instances where user databases do not yet exist.
* fix(rds): added real docker test
* docs(rds): add descriptions for snapshot actions
Added concise, handwritten descriptions for the `CreateDBSnapshot` and
`RestoreDBInstanceFromDBSnapshot` actions in the RDS documentation
action table to comply with the contributing guidelines.
* feat(rds): improve RDS snapshot restore reliability and API coverage
- Update `postgresRestoreScript` to explicitly filter out the master user `CREATE ROLE` statement, preventing restore failures when `ON_ERROR_STOP=1` is enabled.
- Add strict validation for `masterUsername` in `CreateDBInstance` to adhere to AWS requirements (only alphanumeric chars starting with a letter, max 16 chars).
- Ensure `dbInstanceClass` is accurately preserved in the `DbSnapshot` model so it can be restored to the same hardware class automatically.
- Fix missing Windows absolute path detection in `ContainerStorageHelper`, resolving test-environment `NoSuchElement` errors on Windows.
- Make `RdsAwsIntegrationTest` gracefully skip on agents without a Docker daemon, matching test suite expectations.
- Update `rds.md` to include concise handwritten descriptions for all remaining placeholder actions.
- Improve exception logging inside container execution wrappers.
* fix(sts): reject unverified web identity tokens
* test(sts): expect invalid web identity tokens to fail
* fix(sts): make unknown issuer rejection opt in
* fix(s3): verify SigV4 signature on presigned POST uploads
Presigned POST previously accepted any upload once auth enforcement
was enabled: x-amz-credential/x-amz-signature were never checked
against a real secret key, and omitting the policy field entirely
skipped all validation. Now, when floci.services.s3.enforce-auth is
enabled, a policy, x-amz-credential and x-amz-signature are required
and the signature must verify against the resolved secret key
(mirroring PreSignedUrlFilter's SigV4 machinery), and the policy's
expiration is enforced.
* fix(s3): require expiration, full credential scope, and date on presigned POST
Tighten the presigned-POST auth check added for the SigV4 fix: require
the policy's expiration field (previously optional, letting a signed
policy remain valid forever), require x-amz-date to be present, and
require the credential scope to be exactly accessKeyId/date/region/s3/
aws4_request rather than accepting any 5+ part string with an arbitrary
service.
* fix(s3): verify x-amz-date agrees with the credential scope on presigned POST
x-amz-date was only checked for presence, while signing-key derivation
uses the date embedded in x-amz-credential. A client could send a
malformed or inconsistent form date and still produce a valid
signature, which real S3 rejects. Now the form date must be a
well-formed yyyyMMdd'T'HHmmss'Z' timestamp whose date matches the
credential scope's date.
* fix(s3): reject impossible x-amz-date calendar values on presigned POST
isConsistentAmzDate only checked the timestamp's digit shape via
regex, so a value like 20261332T999999Z (month 13, hour 99) passed as
long as its date prefix matched the credential scope. Parse with a
strict-resolver DateTimeFormatter instead, which rejects any date/time
component outside its real calendar range.
* fix(s3): route presigned POST through the shared authorizeObjectWrite check
Every other S3 write path calls S3Service.authorizeObjectWrite before
performing the write; presigned POST did not, making it inconsistent
even though its own signature verification already proves possession
of the real secret key (a strictly stronger check than what
authorizeObjectWrite currently performs for a signed request). Route
it through the same call so this path automatically inherits any
future strengthening of that authorization logic instead of silently
staying behind.
* fix(dynamodb): reject a BETWEEN with reversed bounds at parse time
A BETWEEN whose lower bound exceeds its upper bound parsed cleanly and
then failed the condition at evaluation, so PutItem answered with a
ConditionalCheckFailedException. AWS rejects the expression itself with a
ValidationException.
The bounds are compared during expression validation, when both resolve
to values of the same type.
Closes 1 TIER 1 case in the dynamodb-conformance suite.
* fix(dynamodb): order BETWEEN string bounds by UTF-8 bytes like DynamoDB
* fix(dynamodb): answer a 400 SerializationException for a malformed binary BETWEEN bound
* fix(dynamodb): wrap the ConditionExpression BETWEEN error in the AWS validation envelope
* feat(ssm): answer AWS's public Amazon Linux AMI parameters
GetParameter, GetParameters and GetParametersByPath resolve the
documented /aws/service/ami-amazon-linux-latest/ names from the EC2
image catalog, the way AWS seeds them in every account. They are
read-only and belong to no account, so DescribeParameters and the
parameter history leave them out.
Ported from the SSM half of lex00/floci#116.
* fix(ssm): reject reserved parameter names and list public ones under ancestors
PutParameter refuses names prefixed with aws or ssm, with or without a
leading slash and in any case, with the ValidationException AWS
returns. That closes the gap where a stored value could shadow a
public AMI parameter. GetParametersByPath applies the same path and
Recursive rules to public names as to stored ones, so a recursive
query on /aws or /aws/service lists them.
* fix(ssm): reserve only the aws and ssm path segments
The reserved-name check keyed on a bare prefix, which also refused the
names CloudFormation generates for an AWS::SSM::Parameter in a stack
whose name starts with aws or ssm. It now rejects a name whose first
path segment is aws or ssm, with or without a leading slash and in any
case, and accepts names such as ssm-auto-stack-Param-ABC.
* fix(cloudformation): resolve FunctionResponseTypes through whole-property intrinsics
Greptile review on #2964 (merged): resolveStringList checked isArray()
on the raw, unresolved property node, so a whole-property intrinsic
like Fn::If, Fn::Split, or a Ref to a CommaDelimitedList parameter was
silently rejected instead of evaluated, leaving FunctionResponseTypes
empty for otherwise-valid templates. hectorvent merged #2964 anyway,
treating this as an acceptable known limitation given the property's
narrow value domain, but it turned out to be a self-correction I
should have caught: this same file already has resolveStringListOrEmpty,
which resolves the whole property through resolveNode first, and
swapping to it is a straight improvement with no downside for the
plain-array case.
That still needed a real fix underneath it: resolveNode treated Fn::If
as a scalar-collapsing intrinsic like Ref/Fn::Sub, so it stringified
a chosen array or object branch instead of preserving it. This is the
same engine gap Greptile flagged on PR #2796 (ScheduleGroup Tags),
which hectorvent asked to be raised separately rather than fixed in
that PR. Since a real fix was needed here to close this issue's gap
for good, resolveNode now special-cases Fn::If: it picks the branch
the same way resolve() does, then resolves that branch recursively
instead of collapsing it, so the result keeps whatever shape the
chosen branch actually has. resolve() itself is unchanged.
Verified by disabling each fix independently and confirming the
corresponding test fails with the exact expected error before
restoring it. Full cloudformation package regression (1272 tests)
passes clean.
* fix(cloudformation): use resolveList for FunctionResponseTypes, not resolveStringListOrEmpty
Greptile review on this PR: resolveStringListOrEmpty routes through
resolveNode, so it now sees an Fn::If-wrapped list, but resolveNode
never implemented real list-splitting logic - it just special-cases
which intrinsics collapse to a scalar. Fn::Split and a Ref to a
CommaDelimitedList parameter still resolved to a bare string there,
so resolveStringListOrEmpty's isArray() check still rejected them.
The engine already has a purpose-built method for exactly this,
resolveList, which correctly handles a literal array, Fn::GetAZs,
Fn::Cidr, Fn::Split (with its actual delimiter), and a comma-delimited
scalar (a Ref to a CommaDelimitedList parameter). It only needed
Fn::If added, the same way resolveNode gained it: pick the branch,
then resolve that branch through resolveList itself rather than
collapsing it, so a list-shaped branch (a literal array or another
Fn::Split) stays list-shaped.
Made resolveList public and switched provisionLambdaEventSourceMapping
to call it directly for FunctionResponseTypes, closing the gap for
Fn::If, Fn::Split, and CommaDelimitedList Refs in one pass instead of
leaving Fn::Split and CommaDelimitedList as a known follow-up gap.
Verified by disabling the new Fn::If branch in resolveList and
confirming the test fails with the exact expected wrong value before
restoring it - the first version of that test used comma-friendly data
that passed either way, so it was rewritten with a non-comma delimiter
to actually discriminate. Full cloudformation package regression
(1276 tests) passes clean.
* fix(cloudformation): route FunctionResponseTypes through resolveStringList, not resolveList
hectorvent (review): since #2946, the provisioner's resolveStringList
helper already delegates to engine.resolveStringList, which handles
Fn::If/Fn::Split/CommaDelimitedList and drops blank entries - making the
resolveList hunk from this PR redundant, and worse: resolveList keeps
blanks, so a conditional element resolving to AWS::NoValue was forwarded
as an invalid empty-string response type (also flagged by Greptile).
Drops the resolveList call in favor of the existing resolveStringList
helper, makes resolveList private again (its only external caller was
this now-removed hunk), and points the engine tests at resolveStringList.
Adds a test pinning the NoValue-drops-the-entry behavior Greptile flagged.
RunInstances launches an unrecognised AMI id by falling back to the catalog
default image, but DescribeImages returned an empty set for that same id. IaC
providers read the AMI root device via DescribeImages before RunInstances when
a root_block_device is set, so the empty result aborted the instance create
with "collecting instance settings: empty result".
DescribeImages now synthesises a describable fallback image for an explicitly
requested, otherwise-unknown ami- id, mirroring the launch-time fallback. List
queries with no image ids are unchanged.
A ReportBatchItemFailures response with an empty, null or unknown
itemIdentifier, an entry without itemIdentifier, a non-array
batchItemFailures, or invalid JSON deleted every delivered message, so
a broken handler response silently dropped messages instead of
retrying them and letting the RedrivePolicy move them to the DLQ. AWS
treats each of these as a complete batch failure; only empty/null
lists and empty/null responses are a complete success.
Validate the response against the received message IDs before any
delete and route malformed responses through the existing
return-to-queue path. An id naming a filtered-out message stays inert
as before.
Fixes#3152
* fix(rds): keep the control plane working with no Docker daemon
CreateDBInstance and CreateDBCluster write the record and reach
available when no Docker daemon is reachable, instead of failing with
a raw socket error. The backing container is retried by reboot and the
RDS Data API, so it starts once a daemon appears. Delete no longer
touches Docker for a record that never had a container, and restore
keeps such records available on their recorded proxy ports.
Ported from lex00/floci#38, the RDS half left out of #2975.
* fix(rds): keep created-container identities and roll back a failed proxy start on retry
The retry updated the record before the auth proxy was up, so a proxy
failure left it pointing at a container nothing listened on and later
retries returned early. The proxy now starts from the handle first and
the record is written only after both halves are up. A proxy failure
stops the container.
tryStart no longer drops a retained cleanup identity that names a
created container. The next retry cleans it up before starting once the
daemon is back. Only an identity carrying the fixed container name,
from a start that failed before Docker created anything, is dropped
while the daemon is unreachable.
* fix(rds): retry a container cleanup that failed before the runtime starts again
A stop that failed after the auth proxy did not start left the live
handle and the runtime claim retained, and nothing retried that
cleanup, so the next start for the runtime failed on the claim. The
container manager now remembers a runtime whose cleanup failed, from a
failed start or a failed stop alike, and cleans it up before that
runtime starts again. A live handle with no pending cleanup is left
alone, so a concurrent duplicate start is still rejected.
* feat(iot): registered-certificate lookup and iot:Connect evaluation
* feat(iot): verify device certificates and iot:Connect on the MQTT TLS listener
* docs(iot): device verification on the MQTT TLS listener
* test(iot): device evaluation over plain stores and under racing policy and thing changes
* fix(iot): remember where a device certificate was found and log refusals at debug
* fix(iot): treat any address literal in SNI as no domain name
* fix(sns): honor FifoThroughputScope=MessageGroup on FIFO topics
A FIFO topic accepted FifoThroughputScope and echoed it back from
GetTopicAttributes, but deduplication stayed topic-wide, so the same
MessageDeduplicationId published under two different MessageGroupIds
delivered only the first message. A fan-out that reuses one dedup id per
group silently lost every message after the first.
Scope the deduplication cache key to the message group when the topic
sets FifoThroughputScope=MessageGroup, on both Publish and PublishBatch,
mirroring how SQS handles DeduplicationScope=messageGroup. Topic remains
the default and keeps the existing topic-wide behavior.
* fix(cloudformation): forward SNS FifoThroughputScope from AWS::SNS::Topic
SnsCfnProvisioner only forwarded ContentBasedDeduplication, so a topic
provisioned from a template kept the default topic-wide deduplication
even with FifoThroughputScope set, and a FIFO topic left unnamed got a
generated name without the .fifo suffix SnsService recognizes.
Forward FifoThroughputScope, suffix a generated FIFO topic name with
.fifo as CloudFormation does, treat a prior name whose suffix no longer
matches the createOnly FifoTopic flag as a replacing update, and rewrite
the mutable attributes on UpdateStack, which createTopic leaves untouched
when the topic already exists.
* fix(cloudformation): reset dropped SNS topic attributes on update
An UpdateStack that dropped FifoThroughputScope or
ContentBasedDeduplication kept the old value while reporting success.
Write the create-time default instead, for FIFO topics only: real SNS
rejects both on a standard topic.
A FifoTopic flip now fails rather than replacing the topic under a new
generated name, which would orphan it and its subscriptions. An
explicitly named .fifo topic counts as FIFO without the flag.
* fix(sns): make the group-scoped FIFO dedup key unambiguous
Nothing validates the characters in either id, so the NUL delimiter
could arrive inside one and make two different group and dedup pairs
share a cache key. Length-prefix the group instead.
* fix(sns): keep FIFO dedup scopes in separate cache namespaces
A topic-scoped dedup id shaped like the group-scoped key, "1#ab" for
group "a" with id "b", hit the same cache entry once the scope changed
inside the deduplication window. Mark each key with its scope so the
two formats cannot collide.
CreateLaunchConfiguration stores InstanceMonitoring.Enabled and
BlockDeviceMappings, and DescribeLaunchConfigurations returns both
structures the way AWS does, with monitoring defaulting to enabled and
mappings to an empty list. The Terraform provider read the missing
elements as disabled monitoring and no root device, which forced a
replacement on every plan.
Ported from lex00/floci#132.
* feat(ses): implement v1 ReorderReceiptRuleSet and CloneReceiptRuleSet
Completes the SES v1 receipt management surface with the two remaining
rule-set actions, both reproducing wire behavior probed against real AWS
(us-east-1, 2026-09).
ReorderReceiptRuleSet demands an exact permutation of the set's rules,
with the probed error precedence: rule-set existence first, then a
duplicate request name (InvalidParameterValue "Multiple positions found
for rule", even when the duplicated name is not in the set), then set
rules absent from the request (listed in set order), then request names
not in the set (RuleDoesNotExist, first in request order). RuleNames
members validate at the Smithy layer under the bare 'ruleNames' path
with a nested list-member constraint whose length cap is 100; there is
no service-level "Not a valid ruleName" stage, so a 65-char name lands
on RuleDoesNotExist. A failed reorder leaves the order unchanged.
CloneReceiptRuleSet deep-copies the source's rules under a new creation
timestamp; the active flag stays behind. Name validation is two-layer
for both members: the Smithy pattern combines violations with
originalRuleSetName listed first, and the service-level 64-char check
reports the target before the source. An existing target wins over a
missing source (AlreadyExists before RuleSetDoesNotExist).
Covered by unit tests, Query-protocol integration tests, and AWS SDK
compatibility tests run against a live local instance.
* fix(ses): parse ReorderReceiptRuleSet RuleNames with the probed AWS index grammar
Review flagged that a sparse Query list (RuleNames.member.1 plus member.3)
was silently truncated at the first missing index. Probing real SES with
raw signed Query requests showed the string-list grammar differs from the
receipt-action struct-list grammar: a gap is padded with empty members
(which then fail the ruleNames Smithy constraint, so nothing is ever
truncated) up to a skip of 10, counted from the previous index or from 1
for a leading gap; a larger gap is MalformedInput "Excessively sparse
input would skip N list elements" with a comma-grouped count; an index
above 214748369 (exact boundary, found by bisection) is MalformedInput
"Index N is illegal"; index 0, a leading-zero spelling, and a non-numeric
token are each their own probed MalformedInput; and a repeated index
keeps its first value.
The same probing showed the ruleNames Smithy violation carries no member
index and appears at most once however many members are malformed, so the
service now emits it once instead of per member.
Covered by wire-level integration tests for each grammar case and a unit
test for the single-violation behavior.
* fix(ec2): reject a CreateSubnet whose CIDR overlaps an existing subnet
AWS refuses a subnet whose IPv4 CIDR overlaps another subnet's in the
same VPC with InvalidSubnet.Conflict. CreateSubnet has no idempotency
token, so this check is also what stops an SDK transport retry after a
lost response from recording a second subnet at the same CIDR.
Ported from lex00/floci#191.
* fix(ec2): hold the VPC lock across the subnet conflict scan and store
Two overlapping CreateSubnet requests in flight together could both pass
the scan before either subnet was stored, so the retry case the check
targets could still record a duplicate. The scan and the put now run
under the VPC's stripe lock, the way the other per-resource mutators do.
* refactor(cloudformation): move the ElasticLoadBalancingV2 types into ElbV2CfnProvisioner
AWS::ElasticLoadBalancingV2::LoadBalancer, TargetGroup, Listener and
ListenerRule leave the legacy switch together with the ELBv2-only helpers
(ELB-safe name generation, full-name derivation, matcher, certificates,
action and rule-condition parsing). The monolith no longer depends on
ElbV2Service; its constructor loses that parameter and CfnProvisionerFixture
passes one argument less.
Behaviour is unchanged except where the move fixes it. An unnamed load
balancer or target group keeps the name its first execution generated, read
back from the LoadBalancerName / TargetGroupName attribute since the physical
id is the ARN; the switch generated a fresh name on every pass and left the
previous resource behind. Listener and ListenerRule branch create-vs-update
on the provision context, and a listener moved to another load balancer or a
rule moved to another listener (both create-only properties) is created as a
replacement instead of being modified under the old parent; one removed out
of band is created again. A non-integer Port or Priority is a ValidationError
instead of an uncaught NumberFormatException. Deletes call the service
directly: it already returns silently for an unknown ARN, and its refusals
(ResourceInUse, OperationNotPermitted) must keep failing the stack delete.
Fn::GetAtt follows the registry schemas' readOnly properties. The five load
balancer attributes, ListenerArn, RuleArn and IsDefault are as before;
TargetGroup gains LoadBalancerArns (comma-joined, empty until a listener
forwards to the group), which the switch never set and the schema coverage
test now requires. CloudFormationIntegrationTest keeps asserting the stack
outputs end to end; ElbV2CfnProvisionerTest covers the four types against a
mocked ElbV2Service. The whole CloudFormation test package passes on this
tree apart from the pre-existing ACM schema-gap row.
* refactor(cloudformation): clean up the ELBv2 entity a replacing update displaced
Review found that a listener moved to another load balancer, or a rule moved
to another listener, was created anew while the displaced one kept running,
holding its target groups in use and never appearing in the stack's cleanup.
The same was true of a renamed load balancer or target group.
Every replacing update of the four types now enters the replacement-cleanup
lifecycle the engine already runs (UPDATE_COMPLETE_CLEANUP_IN_PROGRESS,
DELETE_IN_PROGRESS on the prior ARN, three attempts, UpdateReplacePolicy
Retain honoured). ReplacementCleanup is the plain bookkeeping for provisioners
without a rollback snapshot, beside the richer record PipesCfnProvisioner
keeps; the provisioner delegates the four interface hooks to it and deletes
through its own delete arm. The direct service deletes stay as they were:
ElbV2Service returns silently for an unknown ARN, so there is no already-gone
code for CfnDeletes.safeDelete to tolerate, and its refusals (ResourceInUse,
OperationNotPermitted) must keep failing the stack delete.
* refactor(cloudformation): roll an ELBv2 replacement back and clean up dependents first
Review found two gaps in the replacement handling. A replacement this
provisioner produces (a listener moved to another load balancer, a rule moved
to another listener, a renamed load balancer or target group) could not be
rolled back when a later resource failed the stack update: rollbackUpdate had
no implementation, so the engine reported "Rollback is not implemented", left
the replacement running and the stack in UPDATE_ROLLBACK_FAILED. And the
committed-update cleanup walked resources in creation order, so a target group
renamed in the same update as its listener was moved would be deleted while
the old listener still forwarded to it, fail ResourceInUse three times and be
left behind.
ReplacementCleanup now keeps the attributes the resource carried before the
provision alongside the prior physical id, and rollback() puts both back and
deletes the replacement through the provisioner's own delete arm, spending
the record before the delete so a failing delete cannot put the restored
prior on the next cleanup's list. The provisioner records once, in
provision(), and delegates rollbackUpdate. A load balancer or target group
without a record has nothing to put back, every property being create-only
and the update having only described the existing entity, so it rolls back as
complete; a listener or rule modified in place keeps the engine's existing
handling, as under the switch.
CloudFormationService's committed cleanup walks resources in reverse creation
order, as every other teardown walk does. CloudFormationElbV2ReplacementIntegrationTest
drives both through the engine: a renamed target group plus a moved listener
end with DELETE_COMPLETE events on both prior ARNs and neither entity left,
and a moved listener followed by a failing resource lands the stack in
UPDATE_ROLLBACK_COMPLETE with the prior listener restored and the replacement
gone.
* refactor(cloudformation): order replacement cleanup by the template and keep an orphaned replacement owed
Two gaps in the replacement lifecycle, both found in review. The committed
cleanup walked the resource map reversed, but the map is insertion order and
a resource a later update added sits after the resources that depend on it,
so a target group added after its listener would still be deleted first,
fail ResourceInUse three times and be left behind. The cleanup now walks
resourcesInCreationOrder reversed, the template's dependency order, exactly
as DeleteStack does; a resource the template no longer names sorts last.
And a rollback whose delete of the replacement failed forgot the replacement:
the record was cleared before the delete, so nothing could remove that
entity later even though UPDATE_ROLLBACK_FAILED is updatable here and both
the next committed update and DeleteStack run the cleanup first. The record
is now a list of every entity owed a delete: a replacement whose rollback
delete fails is listed in the prior's place, never retained (a failed update
created it), and the prior's own id and attributes are kept beside the list
only while this update's replacement can still be rolled back. Every listed
entity gets its attempt on every cleanup call, so one that keeps failing does
not leave the others untried.
The load balancer and target group rollback note now says what is true: this
provisioner never modifies an existing one, so an update that kept the name
has nothing to put back (in-place changes to their updatable properties are
not applied, as under the switch).
CloudFormationElbV2ReplacementIntegrationTest gains the appended-dependency
case: a target group added by a later update than its listener, then both
replaced, ends with both prior ARNs DELETE_COMPLETE.
* refactor(cloudformation): keep a displaced entity owed until its own attempts are used up
Review found that once any listed entity reached three failed deletes, the engine's give-up cleared the whole record, forgetting entities that still had attempts left. clearUpdate now drops only the entries that used up their attempts (and the rollback fields), and the cleanup result reports the lowest attempt count among what remains, naming that entity, so the engine keeps retrying until every remaining entity has had its own three attempts.
* refactor(cloudformation): tolerate the ELBv2 not-found codes on delete and name one entity per cleanup
The four ELBv2 deletes go through CfnDeletes.safeDelete with the not-found
code ElbV2Service defines for each type (LoadBalancerNotFound,
TargetGroupNotFound, ListenerNotFound, RuleNotFound), the convention every
other per-service provisioner follows. The service's delete paths return
silently on an unknown ARN today, so nothing changes in behaviour; its
refusals (ResourceInUse, OperationNotPermitted) are not in the list and keep
failing the stack delete.
The replacement cleanup picks the entity it works on through one rule, the
owed entry with the fewest attempts, for both the physical id it announces
(DELETE_IN_PROGRESS) and the one it reports on failure (DELETE_FAILED), so a
cleanup's progress and failure events name the same thing. The unused
parameter on the record's region lookup goes.
A flow log with a CloudWatch Logs destination delivers through an IAM
role given as DeliverLogsPermissionArn. The value was dropped on create
and never returned on describe, so Terraform read aws_flow_log's
iam_role_arn back empty and proposed replacing the flow log on every
plan. The Query handler and the AWS::EC2::FlowLog provisioner now pass
it through, DescribeFlowLogs returns it, and the provisioner treats a
change to it as the replacement AWS performs.
Ported from lex00/floci#96.
* fix(transfer): allow DeleteServer regardless of server state
AWS's DeleteServer API has no state precondition: its error list has no
ConflictException, and terraform-provider-aws's resourceServerDelete
calls DeleteServer directly without stopping the server first. The
OFFLINE-only guard made every terraform destroy of a running
aws_transfer_server fail with a 409 that real AWS never returns.
CreateServer's ONLINE default is left as is: it matches real AWS, where
a new server transitions STARTING -> ONLINE automatically without a
StartServer call, and terraform's waitServerCreated treats OFFLINE as
an unexpected state that fails apply immediately. Added an integration
test locking in both behaviors.
Fixes#2802
* fix(transfer): return Domain from DescribeServer and ListServers
Real AWS always reports a server's Domain (default S3). Floci dropped
the field on CreateServer and never echoed it, so terraform-provider-aws
read back "" into its ForceNew domain attribute (default "S3") and every
re-plan of an aws_transfer_server proposed a replacement:
+ domain = "S3" # forces replacement
Store Domain on create, defaulting to S3 like AWS, and include it in
DescribeServer and ListServers. Needed for the resource to survive the
whole-config re-plan assertion in the terraform compat suite.
* test(compat): add aws_transfer_server to the terraform and opentofu suites
The resource was pulled from both fixtures while #1834 iterated because
DeleteServer 409'd on a running server (#2802). With that fixed, put it
back: the server is never stopped, so terraform destroy hits DeleteServer
while it is ONLINE, and the existing whole-config re-plan test guards the
DescribeServer round trip.
* docs(transfer): drop the OFFLINE precondition from DeleteServer
* refactor(cloudformation): move Cognito UserPool and UserPoolClient to CognitoCfnProvisioner
Batch 3 of the CloudFormationResourceProvisioner split. AWS::Cognito::UserPool and
AWS::Cognito::UserPoolClient join the provisioner that already owns UserPoolDomain;
the two arms, their switch cases, the type-list entries, the Cognito-only
resolveStringMapOrNull helper and the CognitoService dependency leave the monolith.
Behaviour is preserved except for what the split's conventions require:
- the create/update branch reads ctx.isUpdate() instead of the resource's physical
id, which provision overwrites as it runs
- deletes go through CfnDeletes.safeDelete tolerating only ResourceNotFoundException;
a pool that still has a domain keeps failing the stack delete with
InvalidParameterException, as on AWS
- the client also exposes Name, the read-only attribute the registry schema declares
(ClientName stays for now), so CfnSchemaCoverageTest needs no gaps row
- the ReplacementCleanup hooks are wired for both types; nothing replaces yet, so
they are inert until create-only properties are honoured
The unit test covers both types with a mocked service: request map and generated
names, update carrying the prior id, the exact attribute sets, positional client
arguments, and delete tolerance. The domain delete path now branches on type first,
since a pool resource also carries a UserPoolId attribute.
* fix(cloudformation): replace a Cognito user pool client when its create-only properties change
UserPoolId and GenerateSecret are createOnlyProperties in the AWS::Cognito::UserPoolClient
registry schema: on AWS a change to either creates a new client and deletes the old one
after the update commits. The provisioner passed the new pool id to UpdateUserPoolClient,
which fails with ResourceNotFoundException because a client is only found through the
pool that owns it, and a changed GenerateSecret was silently ignored since the update
call has no such parameter.
The provisioner now looks the prior client up by id, updates in place only when both
create-only properties are unchanged, and otherwise creates the replacement; the
ReplacementCleanup record deletes the displaced client once the update completes or
restores it on rollback. A prior client that is already gone is created anew. The by-id
describeUserPoolClient overload is new on CognitoService, mirroring its delete pair.
* fix(cloudformation): resolve Cognito UserPoolTags as the map the schema declares
AWS::Cognito::UserPool.UserPoolTags is an object (the type's tagProperty), not the
[{Key, Value}] list most types carry. The provisioner parsed it with the list helper,
which yields nothing for a map, so the tags only reached the service through the raw
property map, where a non-string tag value arrives as a number. The tags are now
resolved as a string map and put explicitly, on create and on update.
* fix(cloudformation): give Fn::GetAtt ProviderName on a Cognito user pool AWS's shape
The attribute returned the pool name. On AWS it is cognito-idp.<region>.amazonaws.com/<pool id>,
the value templates feed into an identity pool's CognitoIdentityProviders (CDK derives the
same string in UserPool.fromUserPoolArn). ProviderURL deliberately stays Floci's local
issuer, <base-url>/<pool id>, since that is the iss of the tokens Floci mints and a template
wiring it into a JWT authorizer must validate locally; the generated resource-type table
now says so.
* fix(cognito): apply PoolName on UpdateUserPool so a CloudFormation rename takes effect
UpdateUserPoolRequest carries PoolName in the service model and AWS::Cognito::UserPool
lists UserPoolName as updatable in place, but updateUserPool only ran populateUserPool,
which never sets the name, so a renamed pool kept its old name through both the API and
a stack update. The service now applies a non-blank PoolName.
The provisioner sends PoolName on update only when the template names the pool: an
unnamed pool keeps the name its first execution generated instead of being renamed to a
freshly generated one on every update.
* fix(cloudformation): expose only the schema's attributes on a Cognito user pool client
The AWS::Cognito::UserPoolClient registry schema declares ClientId, Name and ClientSecret
as its read-only properties. ClientName is a request property, not an attribute; on AWS
Fn::GetAtt Client.ClientName fails template validation, so no working template depends on
it. It is dropped in favour of Name.
* fix(cloudformation): validate Cognito user pool client properties instead of dropping them
A non-integer AccessTokenValidity, IdTokenValidity or RefreshTokenValidity was parsed to
null and silently ignored, so the template's intent was lost without a word. The
provisioner now fails the resource with ValidationError "Value of property X must be an
integer.", as the ECS provisioner does for DesiredCount. UserPoolId, the schema's one
required property, is likewise rejected when missing rather than passed through as null.
* test(cloudformation): cover Cognito user pool client replacement end to end
Through the CloudFormation API: a client moved to another pool and one whose
GenerateSecret flips are each replaced, with the displaced client gone once the update
completes; a rename updates the client in place; Fn::GetAtt Name and the pool's
ProviderName carry their AWS shapes; deleting the stack removes client and pools.
* fix(cloudformation): drop a stale ClientSecret attribute when a replacement client has none
The engine hands an update the prior attributes, and the provisioner only wrote
ClientSecret when the new client had one, so replacing a secret-bearing client with
GenerateSecret: false left the displaced client's secret readable through Fn::GetAtt.
The attribute is now removed when the client has no secret; rollback still restores it
from the cleanup record's snapshot.
* fix(cloudformation): refuse a Cognito client replacement that would reuse the prior client id
AWS client ids are random, so a replacement never collides with the client it replaces.
Under Floci's floci:override-cognito-client-id tag the id follows the client name, and a
replacement that kept the name (a GenerateSecret flip, or a move to a pool with the same
override) was created under the prior id: the store overwrote the prior client, the cleanup
record saw an unchanged id and recorded nothing, and the update could not be rolled back.
Neither overwriting nor delete-then-create can preserve the prior client, so the update is
now refused with ValidationError before anything changes and the stack rolls back intact.
CognitoService gains deterministicClientIdFor(userPoolId, clientName), sharing the id rule
with createUserPoolClient; the provisioner compares it with the prior id in the replacement
branch only.
* fix(cloudformation): refuse a Cognito client whose derived id another client already holds
The round-1 guard compared the derived id only with the client being replaced. Under
floci:override-cognito-client-id the store is keyed by client id alone, so a name whose
derived id belongs to any other client, in this pool or another, would overwrite that client
on create, and neither the cleanup record nor rollback knows about it. The guard now refuses
whenever an existing client holds the derived id, on a fresh create as well as a replacement.
* fix(cloudformation): make the deterministic Cognito client-id guard atomic and ignore orphaned records
Two gaps in the round-2 guard. CloudFormationService runs stack operations on a cached
thread pool and CognitoService's client store write is unconditional, so two stacks could
both find a derived id free and the later create overwrote the earlier stack's client; the
existence check and the create now run under one lock whenever the id is derived from the
name. And deleting a user pool does not remove its clients yet (#2949 adds that), so a client
of a deleted pool kept its derived id and the guard refused a legitimate create in another
pool; a holder whose pool no longer exists is now treated as a stale record the create may
take over. Random ids take neither path.