Record SignIn events for USER_PASSWORD_AUTH, ADMIN_USER_PASSWORD_AUTH,
ADMIN_NO_SRP_AUTH and USER_SRP_AUTH on pools with the Plus feature plan
and threat protection in AUDIT or ENFORCED mode, and list them newest
first with MaxResults and NextToken paging. Other pools get
UserPoolAddOnNotEnabledException. A wrong password is Fail, a sign-in
interrupted by a challenge stays InProgress until it ends in tokens, and
no EventRisk is reported since Floci performs no risk evaluation.
Events are matched to their pool and user by the stored owner, not the
key prefix alone, and a sign-in that ends after its user is deleted
records nothing.
Closes#6137
* fix(rds): restore a postgres snapshot on an image that creates a template database at startup
* test(rds): clean up the template restore test's instances and snapshot even when it fails
* test(rds): build the template restore test's requests with RdsRequests
Run archive replay in a fresh duplicated Vert.x context seeded from its own account and region, so the initiating request ending cannot invalidate delivery. Ordering, cancellation and ARN parsing are unchanged.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* feat(redshift): add PutResourcePolicy, GetResourcePolicy and DeleteResourcePolicy
aws_redshift_resource_policy could not be created: the provisioned Redshift API had none of the three operations. They now take the ARN of a Redshift Serverless namespace or a provisioned cluster, the targets of a zero-ETL integration, matched exactly in the caller's account and Region. The policy is kept on its namespace or cluster, so it goes with the resource, and is stored and echoed, not evaluated.
* feat(redshift): return resource policies and their errors as AWS does
Checked against AWS with read-only GetResourcePolicy calls: a stored policy comes back with Version and
Statement first and each statement's Effect, Principal, Action, Resource and Condition first,
pretty-printed, so it is now stored in that form. A namespace that does not exist answers "The requested
namespace doesn't exist."; an ARN in another Region, a namespace id that is not a UUID and an ARN of any
other resource type are InvalidParameterValue with AWS's messages, not UnsupportedOperation.
Adds an SDK compatibility test for the three operations.
* fix(redshift): keep a namespace's resource policy across updates
The Namespace copy constructor, used by tagging, untagging and UpdateNamespace, did not copy the
resource policy, so any of them dropped it. findClusterByArn now reads the ARN through AwsArnUtils.
Without a Version, GetResourcePolicy reached Elastic Load Balancing, which defines the name but does
not serve it; it now goes to Redshift.
* fix(redshift): refuse an empty resource policy before looking the resource up
Enforce ElastiCache IAM authentication's engine version floor (Redis OSS 7.0, Valkey 7.2), in-transit encryption and IAM user ID rules on create and modify, and refuse an AuthToken with TransitEncryptionEnabled=false. TransitEncryptionEnabled no longer implies IAM authentication.
Refs #4502
* fix(cloudformation): delete a stack whose create is still running only once the create stops
* fix(cloudformation): leave a deferred delete to the execution it waits on and report its failure
* fix(cloudformation): refuse a new execution once a delete has been deferred
* test(cloudformation): wait for stack statuses with the shared CfnStackWaits helper
* fix(s3): resolve ResourceAccount conditions from the bucket owner
* fix(s3): generate ResourceAccount action coverage
Read s3:ResourceAccount support from the Service Reference action table and carry each evaluated action into shared signed-request and service-call context. Preserve resolved bucket ownership, existing request tag coverage and SDK session-policy regressions. Reuse AwsTestClients for IAM and STS fixtures.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Reuse the existing container init option so the duck server receives SIGTERM instead of waiting for Docker to force-kill PID 1. Preserve the configured URL path and the existing stop timeout.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(dynamodb): authorize ListTables against its regional collection
* test(dynamodb): reject ListTables authorization through ignored selectors
* fix: generate the DynamoDB ListTables request resource
Record the measured table collection as a generated correction and dispatch table-owned operations before hand-built fallbacks. Preserve batch, transaction and PartiQL resource extraction.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(autoscaling): match AWS capacity target validation errors
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(autoscaling): align sparse target error expectation
Preserve sparse-index and rejected-update state assertions while matching the capacity-target validation message.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test: reuse shared clients for capacity target validation
Use AwsTestClients for both SDK clients while retaining the account, region, error matrix and rejected-update state assertions.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* perf(core): drop per-request lookups on the shared request path
Every request resolved the EmulatorConfig and ResolvedServiceCatalog CDI
beans again in the claim, account and signature filters, fetched the
RequestContext through Instance.get() on each storage operation, built a
URI for the Host even when the header was present, formatted the Date
header from scratch, and let CloudTrail copy its key set to find no
trails.
The filters resolve config and catalog once. AccountAwareStorageBackend
and RegionResolver keep the RequestContext client proxy. RequestHost reads
the Host header before it touches the URI. The Date header is cached per
second as one immutable pair. StorageBackend gets isEmpty(), which every
in-memory map implements directly, and emitS3DataEvent returns at once
when no trail exists.
* perf(core): read the query map once and mint request ids without SecureRandom
AccountContextFilter asked UriInfo for the query parameters up to six
times per request, and each call builds a new map wrapper. It now reads
them once and hands the map to its helpers.
AwsRequestIdFilter drew its UUID from SecureRandom. A request id is not a
secret, so it is now a version 4 UUID built from ThreadLocalRandom, with
the same format and the same single id in all three headers.
* perf(core): scope AccountAwareStorageBackend.isEmpty to the current account
keys() and scan() only see the current account, so isEmpty() now
answers for that account too. A delegate with no entries at all still
answers without copying its key set.
* chore(cognito): give the sign-up scope test one request context that follows the calling thread
AccountAwareStorageBackend keeps the RequestContext it gets from the
Instance, as the request scoped client proxy forwards to the current
request. The test handed out a different context per get() call from a
ThreadLocal, so the kept one pinned both threads to the first account.
It now hands out one context whose account id follows the thread.
* feat(redshift): take a DynamoDB table and a Serverless namespace in zero-ETL integrations
CreateIntegration took only a DynamoDB stream ARN as SourceArn and a provisioned cluster ARN as
TargetArn. AWS takes the table ARN and a Redshift Serverless namespace ARN (its model allows no
cluster: ARN), so a Terraform aws_redshift_integration written for AWS failed to create.
Both AWS forms are now accepted and the original ones are kept. A missing table is
IntegrationSourceNotFoundFault and a missing namespace IntegrationTargetNotFoundFault, as the API
reference lists. A namespace is written through its workgroup into the namespace's database. A
table source reads changes from the table's latest stream, following one turned on after the
integration was created.
Stream records never landed: the writer bound ApproximateCreationDateTime as an Instant, which the
PostgreSQL driver refuses, so only backfilled items reached the landing table. It now binds an
OffsetDateTime as TIMESTAMPTZ.
* fix(redshift): drain a table's replaced stream and match the source table ARN
A table source moved to the table's latest stream as soon as it changed, dropping records the old
stream still held, and moved to no stream when DynamoDB Local reported none for a table whose streams
were turned off. It now reads the followed stream until a read comes back empty, or until the stream
has expired, before moving, keeps it while the table reports no stream, and persists the move.
A source table ARN was resolved by its table name alone, so a table of another account, or an ARN
with more after the name, was taken for the caller's table of that name. The resolved table must now
have the supplied ARN. The docs no longer promise IntegrationSourceNotFoundFault for a missing stream.
* test(redshift): use the shared Docker probe and Query request helpers in the zero-ETL test
No EMR test ran a step or a job run through Floci's Docker runner: the
runner's wrappers and settings were unit tested and run by hand in the
images. EmrDockerRunnerDockerIntegrationTest, a Docker-gated
@QuarkusTest on ContainerDataPlaneProfile (which now sets both runner
modes to docker), runs them for real in the emr-7.5.0 image, reaching
Floci's S3 from the container:
- a hadoop-streaming word count step, its mapper and reducer from S3,
writing its counts to S3;
- the same word count as a custom JAR at EMR's streaming jar path;
- s3-dist-cp from S3 into the cluster's HDFS and back;
- a cluster's spark-env export, read by a Spark step's driver;
- an EMR Serverless run on the user guide's virtual environment recipe,
spark.archives with #environment and the driver's and executors'
Python in it, from an archive that needs no package index.
EmrRequests.awaitStep and EmrServerlessRequests' createSparkApplication,
startJobRun and awaitJobRun are shared helpers, each wait checking that
its call answered 200 before reading the state, and
RetryingTarCopier.putEntry, pulled out of singleFileTar, writes the
archive's entries. The CI prefetch queues the 3.5 GB image for the
shard that runs the class, last, behind the Lambda runtimes, and the
prefetch results step no longer warns about an EMR Serverless image on
ECR Public, the only place AWS publishes them.
The Glue Data Catalog client, which Spark's Glue catalog and Hive's
Glue metastore use on EMR, could not read back a table it had just
created on Floci: "NullPointerException: Cannot invoke
java.lang.Integer.intValue() because the return value of
Table.retention() is null". Floci's Table had no Retention, and its
StorageDescriptor no StoredAsSubDirectories, SortColumns, BucketColumns,
SkewedInfo or AdditionalLocations, so what the client wrote was
dropped, and the client unboxes Retention, Compressed, NumberOfBuckets,
StoredAsSubDirectories and an Order's SortOrder without a null check.
Past that, a partitioned table came back with each partition, and so
each row, five times: the client reads a table's partitions in five
GetPartitions segments by default, and Floci answered every segment
with all of them.
Now:
- Table keeps Retention and IsRegisteredWithLakeFormation, and
StorageDescriptor keeps AdditionalLocations, BucketColumns,
SortColumns, SkewedInfo and StoredAsSubDirectories, and the table and
descriptor copies carry them.
- every table and partition a catalog action returns (GetTable,
GetTables, SearchTables, GetTableVersion, GetTableVersions,
GetPartition, GetPartitions, BatchGetPartition) reads Retention as 0,
IsRegisteredWithLakeFormation as false, and a storage descriptor's
Compressed, NumberOfBuckets, SortColumns and StoredAsSubDirectories
as false, 0, an empty list and false when they were written without
them, as the CLI reference's get-tables output shows Glue doing. The
stored records keep their nulls: Spectrum reads a partition's missing
Compressed as its table's.
- GetPartitions honours Segment, "a non-overlapping region of a
table's partitions": a partition is in the one segment its values
hash to, a SegmentNumber past the last holds none, and TotalSegments
outside 1 to 10, a negative SegmentNumber or a missing member is a
ValidationException, and a member that is not an integer a
SerializationException.
- a SortColumns entry that is null, lacks Column or SortOrder, or has a
SortOrder other than 0 or 1 fails the whole CreateTable, UpdateTable,
CreatePartition, UpdatePartition, BatchCreatePartition or
BatchUpdatePartition with a ValidationException before anything is
stored, as the client unboxes SortOrder on read.
- the EMR runner gives the client the job's account as its
hive.metastore.glue.catalogid, on a cluster and in an EMR Serverless
run. Given none, the client in emr-7.10.0 asks STS GetCallerIdentity
for it through an STS client no setting points at Floci, so a step
reached real AWS STS and failed. The job's own account is what an
unset one means, and a cluster's spark-hive-site or a run's
spark-defaults one, for a Data Catalog in another account, still wins.
IsRegisteredWithLakeFormation is always false, as Floci does not tie a
table to a location registered with Lake Formation.
docs/services/iam.md and IamValidationErrors read as if the capture that
moved IAM's required-member message settled it for every member. It settled
one: an omitted Status, answered from a real account on 2026-10-31 as "Value
at 'status' failed to satisfy constraint: Member must not be null" against
the shape the four credential operations share.
Every other omitted member this service answers, the sites checked by hand
and each required member the model walk reads, carries that form on this
service's reading rather than on a recording: the word null was never a
value AWS sent, an absent member having none to carry. The doc separates the
two and keeps that reasoning, IamValidationErrors says the capture covers
Status alone where the form is decided, and the account-properties test,
which quoted the Status capture beside an assertion on an omitted properties
map, says the reading is what carries over there.
Prose and comments only, no behavior change. Follow-up to #7265.
* fix(ssm): return a SecureString's KMS ciphertext when a read does not decrypt
GetParameter, GetParameters, GetParametersByPath and GetParameterHistory
returned a SecureString's plaintext whether or not the request set
WithDecryption. AWS encrypts the value with KMS on PutParameter, under the
parameter's key with the PARAMETER_ARN encryption context, and returns
that ciphertext unless the read asks for decryption.
PutParameter now encrypts a SecureString with Floci's KMS and stores the
ciphertext with the version, so every read of a version returns the same
value and KMS Decrypt with the parameter's ARN as context returns the
plaintext. A key KMS cannot use, a value over KMS's 4096-byte limit, and
a version stored before this change are still returned unencrypted.
* fix(ssm): log a SecureString stored without a ciphertext and keep the at-rest note
* fix(ssm): say how AWS encrypts Advanced SecureStrings and reuse the shared test client
* fix(s3): place the encryption condition keys on a put, and on a part from its upload
A policy on s3:x-amz-server-side-encryption or
s3:x-amz-server-side-encryption-aws-kms-key-id read neither key, so a Deny under a
negated operator refused every put, encrypted or not.
A PutObject, CopyObject or CreateMultipartUpload now carries both from its headers, each
value as sent, in the enforcement filter and in S3's own bucket policy check. A part or a
completion sends neither header and carries what its upload recorded when it was created.
A part naming an upload not held answers NoSuchUpload, as S3 does under such a policy.
* fix(s3): check as an object write a PUT or POST naming an upload but not routed as a part
The enforcement filter let through a request naming an upload not held, and judged one
naming a held upload by that upload's encryption, on uploadId alone. A PUT with no
partNumber, or a POST asking for a new upload, creates an object or an upload whatever
that parameter says, so it skipped IAM or read the wrong encryption. Both now match the
routes S3Controller takes as a part or a completion. A part copy naming an upload not held
stays checked, since it names a source.
* test(s3): put the multipart encryption cases beside kmsOnlyBucket
The multipart cases copied S3BucketPolicyEnforcementIntegrationTest's two-statement KMS-only policy
and BUCKET_KEY. They now sit beside kmsOnlyBucket and reuse it, with the policy written once
(putKmsOnlyPolicy). The two cases whose upload is opened before the policy stands use a bucket with
no default encryption, as before: S3 records the bucket's default on an upload that asks for none,
where Floci records only what the request asks for.
Settle completed replacements under the group lock after validation and successful detach cleanup. Retain the active refresh reference so ownership is released even after completion. Preserve pending work, capacity bounds and empty detach behavior.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* feat(redshift): support MAXERROR in COPY
MAXERROR n of 2 or more now asks the backend to skip records it cannot convert
(ON_ERROR ignore) and to fail the COPY at the n-th one (REJECT_LIMIT n - 1),
which needs a PostgreSQL 18 backend. A MAXERROR of 0 or 1 fails at the first
error, as without the option.
* test(redshift): add PostgreSQL 18 MAXERROR integration test
* test(redshift): use shared DockerAvailability and RedshiftConnections in PostgreSQL 18 IT
Address review feedback on PR #7291:
- Call testing.DockerAvailability.isAvailable() instead of carrying a private copy of the probe.
- Use RedshiftConnections.waitForConnection(cluster) instead of duplicating the JDBC connection wait helper.
* fix(autoscaling): settle completed refresh work before standby
Record already settled replacement progress before standby changes member lifecycle. Reuse the owning completion helper after request validation under the existing group lock. Preserve pending replacements and unrelated group/region refreshes.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(autoscaling): preserve refreshes on empty standby requests
Settle completed refresh work only when standby will move a member. Reuse the group resolved under the existing lock and retain invalid-lifecycle rejection before refresh mutation.
Signed-off-by: Andre Kurait <akurait@amazon.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(stepfunctions): authorize callbacks with generated resource lookups
Preserve measured callback resource authorization, token ownership and closed-token behavior. Use explicit generated member lookups, retaining ordinary name resolution and invalid-token precedence. Preserve current main Redshift session-through lookups, generator type validation and payment alias consumers.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* test(stepfunctions): reuse the SQS callback queue fixture
Create callback queues through SqsTestQueue and await token JSON with the shared in-process helper. Retain the existing callback authorization matrix, token error precedence and cleanup registration.
Signed-off-by: Andre Kurait <akurait@amazon.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(redshift): keep tags, VPC and subnet detail on cluster subnet groups
CreateClusterSubnetGroup dropped Tags and passed a null VPC, so
DescribeClusterSubnetGroups returned no Tags, VpcId, SubnetGroupStatus or
SubnetAvailabilityZone and the Terraform provider saw drift on every plan.
Tags are now parsed (Tags.member.N and Tags.Tag.N) and stored on the group,
where DescribeTags/CreateTags already find them under the subnetgroup ARN.
The VPC and each subnet's zone are resolved from EC2 on create and modify;
subnets EC2 does not know are kept unresolved, as before. Groups persisted
earlier load unchanged (the new zone map is nullable).
* fix(redshift): inject Ec2Service through the constructor
Replace the Ec2Service field injection with a constructor parameter held
in a final field. The previous @Inject signature stays as a package-private
delegating constructor passing null, so hand-built test services still
skip subnet resolution.
* test(redshift): build the EC2 setup requests with Ec2Requests
ec2Id now only extracts the id from the response; the auth header and
Action come from the shared Ec2Requests.ec2 helper.
* test(redshift): make ec2Id a plain path extraction
Call sites build the EC2 request with Ec2Requests.ec2 and pass it in;
the account and region are named constants.
A receive that found a message over its maxReceiveCount left it in the
source queue and removed it in a separate step after the claim. A second
receive in between selected the same message again, so both copied it
into the dead-letter queue.
The claim now takes dead-letter candidates out of the source queue in
the same critical section that selects them. A redrive policy whose
target does not resolve to an SQS queue no longer selects candidates.