Use an injectable UTC clock for transaction deadlines. Advance the test clock
only after the blocking query starts, then check idle expiry after it finishes.
This removes the one-second wall-clock race without changing runtime TTLs.
test(rds-data): reuse the shared manual clock
Use ManualClock for the transaction concurrency fixture and advance it
through its existing duration-based interface.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Expose backend keep-alive and idle-pool timeout controls while retaining the existing defaults. Preserve target failures without replaying uncertain requests, and document target timeout hints and local transport limits.
Validate negative idle timeouts with a Floci-specific error before creating clients, and attempt every fixture cleanup step while preserving aggregated failures. Cover negative, zero and positive configuration values and real-listener connection behavior.
Closes#7524
test(elbv2): replace timer-dependent backend checks
With Docker-backed VPC networks, one container of an awsvpc task joins
its VPC's Docker network at the task ENI address, so the address
DescribeTasks reports answers. A Lambda function with VpcConfig joins
the same network at an address leased from its first subnet, skipping
addresses an interface already holds, and returns it once its container
is removed. Peer and Cloud Map addresses still resolve on the network a
container was created on.
Closes#7639
Move the Java sources from io.github.hectorvent.floci to io.floci.aws, matching io.floci.gcp, io.floci.az and io.floci.oci. Generated by tools/rename/rename_package.py apply on the base commit, with no other edits.
Logger categories and the arn.fail-on-blank-region property move to the io.floci.aws prefix. The pom groupId becomes io.floci; the artifactId stays floci.
Refs #6589
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(cloudformation): keep NAT gateway secondary addresses the stack never declared
* test(cloudformation): keep NAT gateway secondary addresses the stack never declared
* fix(cloudformation): a null NAT gateway secondary property counts as not declared
* test(cloudformation): a null NAT gateway secondary property counts as not declared
Closes#7522
Origin comparisons preserved host casing and default ports, CSP named only the immediate parent, and expired sessions remained in storage indefinitely. Normalize both sides of origin checks, allow all configured ancestors, and reap expired sessions across accounts with the shared sweep worker.
* perf(core): read the SigV4 credential scope without regular expressions
Every request ran its Authorization header through regular expressions
five to eight times to read the access key, the region and the signing
service. The account id check String.matches("\\d{12}") also compiled a
new pattern twice per request.
SigV4CredentialScope, RegionResolver and AccountResolver now read the
common header shape with indexOf. Any other shape still goes through the
same regular expressions, so every result stays the same. The account id
check is a plain loop.
* perf(core): read the access key by hand and skip the regexes without a credential
StopPipelineExecution traversed the action list while a worker could append
to it under the execution monitor. Use the same monitor for abandonment
so a concurrent registration cannot invalidate the traversal.
Add a deterministic public-handler regression that registers an action
while the stop waits and verifies that only in-progress actions are abandoned.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
A listener port carries no credentials, so the data plane read target
groups, load balancers and listeners as the default account and answered
502 for any other account. Read them as the account in the listener ARN.
Startup ran outside a request too, so only the default account's indexes,
listeners and health monitors came back. Rebuild the indexes from every
account and restore each stored account as itself.
Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
Five classes had their own copy of the SigV4 URI encoder, and three had their own copy of the signing key derivation and HMAC-SHA256. They now call SigV4Canonicalization.uriEncode and SigV4RequestValidator. The S3 list response encoding for encoding-type=url also uses the shared encoder instead of URLEncoder and three replacements.
Scope AppConfig stores, sessions and deployment cursors to the request's
account and region. Keep legacy keys in the configured default region.
Adapt the source change to current deployment and CloudFormation behavior,
and cover storage reloads and SDK routing.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
* perf(sns): find a topic's subscriptions without copying every subscription key
* perf(sns): match a topic's subscription keys without copying each one
A job stores the parameters of a COPY from S3 in the cluster database, and sys_copy_job lists it with AWS's columns. The checks AWS documents are made when the job is created: an S3 source, an explicit IAM_ROLE, no manifest, access keys, MAXERROR or IGNOREALLERRORS, no hyphen in the name, no transaction block, at most 200 jobs. COPY JOB RUN is refused until files can be loaded automatically.
* fix(core): avoid Podman host-gateway aliases in container builder
* fix(core): share host alias parsing and log probe failures
* refactor(lambda): reuse builder host alias guard and test fixture
* fix(docker): register version response for native image
StartInstances keeps the container, so the container check alone let a lookup started before a stop overwrite the address learned after the next start. Each lookup now takes a sequence number under the instance lock and publishes only while it is still the latest for the instance.
fix(ec2): drop service-network lookup state when an instance terminates
The lookup sequence and retry marker were cleared only when a launch failed, so every instance terminated normally kept an entry for the life of the process. terminate now clears both under the instance lock, and a lookup that runs once the instance is shutting down or terminated starts nothing and records nothing.
test(ec2): share the paused service-network lookup between the race tests
The replacement, stop-and-start and teardown tests each built the same paused lookup by hand: two latches, an inspect that blocks on its first call, and a virtual-thread lookup joined after the release. PausedLookup holds that setup once.
Closes#7582
- Add support for owner, service-name, service-region, service-type,
supported-ip-address-types, tag:key, and tag-key filters
- Build service details with all properties for filtering
- Validate filter names before iterating services
- Return InvalidFilter (HTTP 400) for unknown filter names
- Keep requested service names unchanged
- Preserve S3 gateway service in China partition
- Validate service-name filter values, reject regex metacharacters
- Use AWS error message wording for unsupported filter values
- Use Ec2Service.requireSupportedFilters for filter name validation
- Reuse Ec2Service.wildcardMatches for wildcard matching
- Integration tests for all filter types
- Cover unknown filter name, '[' and 's3+' values, and refusal after an
earlier filter empties the candidate set
Closes#6958
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
AWS returns a stack set's tags and the recorded root and OU deployment targets of a service-managed stack set. Read the same saved targets that ListStackSetAutoDeploymentTargets reports.
Replace the tag map on UpdateStackSet instead of clearing and refilling a map that a concurrent DescribeStackSet may be reading. Copy the request's tags so the published map is independent of later request changes.
Cover both response members, an update interleaved with tag iteration, and request-map isolation with regression tests.
Use the shared account-scoped InMemoryStorageFactory for the added regression tests instead of a private factory copy.
Under IAM enforcement, Redshift requests were checked on `*`, so a
grant scoped to a cluster, a snapshot or a database user was refused,
and a deny scoped to one never applied.
The redshift namespace moves from NOT_COVERED to NAMESPACES in the
request resources generator, with corrections where the generated rule
checks the wrong resource. GetClusterCredentials now also gives the
redshift:DbUser condition key, from a new generated table, to its own
check and to the CreateClusterUser check that AutoCreate adds.
Refs #5907
fix(redshift): act only on a snapshot of the cluster the request names
A snapshot request is checked on snapshot:<cluster>/<name> for the
cluster it names, but DeleteClusterSnapshot, RestoreFromClusterSnapshot
and DescribeClusterSnapshots found the snapshot by its name alone. A
caller allowed on one cluster's snapshots could act on a snapshot of
another cluster by naming the allowed one.
A snapshot taken from another cluster than the one the request names,
in SnapshotClusterIdentifier, the cluster of a SnapshotArn, or
DescribeClusterSnapshots' ClusterIdentifier, is now not found.
Refs #5907
chore(iam): generate the Lambda Web and Redshift condition keys into one table
chore(redshift): read a restore's snapshot ARN once
* feat(stepfunctions): evaluate the execution role on SQS tasks
Under IAM enforcement an SQS task now requires the execution role to exist
and trust Step Functions, assumes the role its Credentials name, and checks
sqs:SendMessage on the queue as the role it ends up with. LambdaTaskAuthorizer
gains a general authorize() that later integrations map onto through
TaskPermissions; it reads any service's resource policy and accepts resource
* and an S3 ARN's empty account. Lambda, API Gateway and nested tasks keep
their own paths and errors.
TaskScheduled and LambdaFunctionScheduled record taskCredentials when a task
declares Credentials. With enforcement off they are read softly, so a RoleArn
that does not resolve is omitted and the task still runs.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(stepfunctions): let a queue's policy decide SQS task and direct calls
SQS had no resource policy provider, so a task's call to a queue in another account could never be granted. Add one reading the queue's Policy attribute, which IAM enforcement and the task authorizer both read, and build a direct request's ARN from the account its QueueUrl names so the right queue's policy is read.
Credentials read only for history now tolerate only a resolution failure, and the Step Functions integration tests share one client.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
With an explicit zero minimum, drain stale REPLICA tasks whose fixed
published ports conflict with a replacement. Wait for background Docker
cleanup to confirm removal before placing the replacement, including
port-owning security-group helpers.
Keep task protection and failed-deployment guards, remove helpers outside
the firewall monitor, and revoke task credentials even when cleanup fails.
Closes#7523
Centralize fixed host-port selection in EcsContainerManager and use it from both container publishers and scheduler conflict detection. Preserve existing bridge, host, and awsvpc publication behavior.
Validation: 179 focused ECS and firewall tests passed.
An address the subnet picks for a NAT gateway takes a lease on the VPC
network, and DeleteNatGateway never gave it back, so once the gateway was
gone automatic allocation skipped that address. Secondary addresses leaked
the same way, on delete and when an update dropped them.
DeleteNatGateway now gives back the lease of every address the gateway
holds. It reads the gateway once, under the allocation lock, and gives
nothing back for a gateway stored as deleted, whose addresses an earlier
delete already gave back. A secondary-address update gives back the lease
of each dropped secondary, except one the same update names again in a new
slot. Every place in Ec2Service that gives leases back now goes through
one releasePrivateIps helper.
In Ec2ServiceTest, a MockedNetworkFixture replaces the setup the
mocked-network tests repeated, and the older tests that built that setup
by hand use it too.
* fix(cloudformation): store stack policies and return them
* test(cloudformation): remove the stack policy test bucket after use
* fix(cloudformation): apply a stack policy with its stack operation
UpdateStack now stores its policy when the update commits, before UPDATE_COMPLETE is published, and CreateStack when execution starts. A policy-only update no longer leaves its change set FAILED. SetStackPolicy checks the stack state again under the stack lock after reading a StackPolicyURL.
* fix(cloudformation): apply a creation policy when the create is claimed
* fix(cloudformation): keep a rejected policy-only update executable
* fix(cloudformation): assign a stack policy when its change set is created
* test(cloudformation): stop the stack policy test's executor
* test(cloudformation): round-trip stack policies through persistent storage
* test(cloudformation): build the stack policy requests on CfnRequests
* test(cloudformation): construct CloudFormationService through one shared fixture
* fix(cloudformation): refuse a missing or malformed StackName in the stack policy actions
SetStackPolicy and GetStackPolicy looked a missing StackName up as the
stack named "null". Both now validate StackName first, as AWS does,
with the checks ContinueUpdateRollback already applies.