Closesfloci-io/floci#8007
Persist whether a standalone instance has never initialized its database. Protect engine versions before backend startup so runtime loss and proxy failures cannot expose existing storage to a metadata-only version change. Update SDK compatibility assertions to reject unsupported upgrades and verify resizing separately.
Apply supported minor upgrades using the version-specific image on the existing volume and endpoint. Keep major upgrades, downgrades, and pinned-image changes blocked before mutation. Preserve the never-started case, report failed restarts honestly, and restore successful minor-upgrade coverage in the Java SDK compatibility suite.
* fix(glue): preserve existing partitions on duplicate creation
Reject CreatePartition for values already stored in the table before
mutating partition metadata. Keep the existing BatchCreatePartition
error and allow explicit updates through UpdatePartition.
Port the independent duplicate check and regression from
AndreKurait/floci commit f6905c8ced6c21fd9aeca013beb4ac511e5c1469.
Add SDK coverage for single and batch creation, preserved metadata,
per-item batch errors, and subsequent explicit updates.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(glue): serialize concurrent partition creation
Synchronize single and batch creates so duplicate detection and writes share
one service critical section. Cover all four concurrent single/batch combinations,
preserving the first metadata and per-item batch errors.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(glue): isolate catalog fixtures from Athena readers
Share the existing floci-duck resource lock with Athena and Firehose tests.
Their catalog setup must not read temporary Glue metadata whose S3 locations
are placeholders while the catalog test is running.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
* fix(bedrock-agentcore): use runtime IDs and endpoint names in ARNs
Keep runtime ARNs stable across versions and use the parent runtime ID and endpoint name for endpoint ARNs. Update API responses, ARN lookups, tagging dispatch and CloudFormation references together.
* fix(bedrock-agentcore): preserve legacy and harness runtime lookups
X-Ray is the one AWS service local stacks ask for and Floci does not have: SQS
and SNS already carry AWSTraceHeader, and nothing on the other end accepts the
segments that header points at. This serves the ingest loop, the summaries that
read it back, the service graph a console draws from it, and the sampling the
X-Ray daemon polls on its own timers.
The API is REST JSON on literal paths (/TraceSegments, /Traces, /TraceSummaries,
/ServiceGraph, /TraceGraph, /GetSamplingRules, ...), which S3's path-style routes
would swallow as a bucket name, so a request signed for the xray credential scope
is rewritten onto an internal prefix and every other request keeps its path. Only
the paths Floci serves are claimed.
What Floci stores is the segment document as sent: BatchGetTraces has to answer
exactly what PutTraceSegments accepted, so re-serialising through a model would
change what the caller reads. The summaries and the graph parse those documents
on read, which keeps the stored bytes the caller's and costs nothing while a local
stack is idle.
A filter expression is parsed, not pattern-matched: service("name"), hasError,
hasFault, hasThrottle, duration, responsetime, http.status, annotation.key,
comparisons, AND, OR, NOT and parentheses. Anything outside that set is refused
with InvalidRequestException naming what it could not read, because accepting a
filter and ignoring half of it hands a caller a superset and looks like a pass. A
lone '!' is refused the same way rather than left as a delimiter no branch
consumes, and responsetime is compared in seconds, the unit AWS uses.
The graph collapses segments into services by name, derives edges from parent ids,
and reports AWS's SummaryStatistics and cumulative DurationHistogram per node and
per edge. A node is a service, not a document shape: the same service seen once
with an http block and once without is one node.
Sampling answers the Default rule AWS serves in every Region, so a daemon has
something to sample at before any rule exists, and five rules per Region on top of
it. It is answered, not adapted: the reservoir is reported as the quota and
renewed every 10 seconds rather than decremented per report, and the service page
says so.
A local emulator runs for days, so the store is bounded to 10000 traces per Region
with AWS's 30 day window, oldest evicted first. A bad document is reported under
UnprocessedTraceSegments with its reason instead of failing the whole call, and
100 documents per call is the AWS limit, enforced.
Co-authored-by: David Guardiola <davidguardiola@gmail.com>
* fix(logs): support or in Logs Insights filters
A filter or where stage now keeps rows matching any or-joined comparison, case-insensitive, with parenthesized and nested groups. Syntax the engine does not model (and, not, ||, escapes, backtick fields, expressions in place of a field, empty stages) fails the query instead of returning a silently wrong result set.
Closes#7907
* fix(logs): limit Insights bare filter values to numbers and enforce the queryString length
An unquoted filter value is now a number compared by value, as on AWS (n = 2 matches 2 and 2.0).
Other unquoted values, such as a word or 1+1, fail the query instead of being read as text.
StartQuery rejects a queryString over 10,000 characters with InvalidParameterException, which
also bounds the nesting the or parser walks.
* fix(logs): keep Insights field parsing stack-safe and count queryString in code points
A long dotted field such as a.a.a... overflowed the stack in the field regex, which repeated a
group recursively; the repetition is now possessive and runs in a loop. The queryString limit
uses the shared Smithy length check, which counts code points as AWS does, so a query of
emoji under 10,000 code points is no longer rejected.
* refactor(logs): share one quote-skipping scanner across the Insights parser
In the native image every $foreach property of a VTL mapping template
resolved to null: #if($foreach.hasNext) was always false, so the usual
comma-between-items pattern rendered invalid JSON, and $foreach.index,
$foreach.count and $foreach.hasNext printed as literal text. Velocity
binds $foreach to a ForeachScope and reads its getters through
reflection, but only the Foreach directive was registered, not the scope
it creates. Velocity then fell back to reading the scope as a map, which
holds none of those keys.
ForeachScope and its parent Scope are now registered alongside the
directive. Reflection registration covers the whole image, so AppSync
resolver templates, which loop through the same directive, get the
scope too.
Add CreateMembers, ListMembers, GetMembers, DisassociateMembers, DeleteMembers and
DisableOrganizationAdminAccount, the operations Landing Zone Accelerator and Terraform's
aws_securityhub_member use to manage Security Hub members.
Organization accounts added by the delegated administrator become Enabled members and have
Security Hub and its default standards enabled for them; other accounts are Created. Organization
members can be disassociated but not deleted. Disabling the delegated administrator marks its
organization members Removed.
Macie already served POST /members and GET /members, so Security Hub calls on those paths were
answered by Macie. Both routes now dispatch on the SigV4 credential scope in
SecurityAdminController, as GET /admin already does; unsigned requests still reach Macie.
Closes#2197
* feat(paymentcryptography): the single DES decryption
The retail MAC closes its tag with a decryption under the right half of the
key, so the cipher package needs the Single DES decryption as well as the
encryption. It is the same cipher the encryption is, the other way round, and
it is BouncyCastle's like every other cipher here.
* feat(paymentcryptography): the card values and the authorization cryptograms
The card validation value is the three digit value of the X9 algorithm: the
account number, the expiry and the service code, enciphered under the card
verification key, and decimalized. The dynamic variants compute the value
from the transaction rather than from the card's own fields, and they take a
key of their own usage that may derive.
The authorization cryptogram is the ARQC of the transaction: the ISO 9797-1
algorithm 3 retail MAC over the transaction data, cut to eight bytes, under a
session key the request's derivation produces. The EMV common session key, the
EMV 2000 one, the Mastercard one and the Visa one are served. The American
Express derivation is refused rather than approximated: the AEIPS session key
derivation is proprietary and there is nothing to verify it against, and a
plausible wrong cryptogram is worse than an error.
The operations are written on the data plane as it is now: the hexadecimal is
java.util.HexFormat, the digests are the shared Digests, and the ciphers are
the BouncyCastle ones the package already uses. The routes of the card
operations are in the vendored rest-routes.json already, so they are
authorized by the generated rules and need no hand-written ones.
* test(paymentcryptography): the card operations over the SDK and the CLI
The unit tests call the operations directly, so they do not reach the routes
the requests travel, the JSON the body carries, or the rules that decide which
action a request is. The suite does, through a client that signs the request
the way a client of the data plane signs it.
The Java suite drives the card verification value and the authorization
cryptogram with the AWS SDK for Java v2, and the CLI suite drives them with
the AWS CLI. Both refuse the American Express derivation, the key of another
usage, and the value or the cryptogram that does not verify.
* fix(paymentcryptography): the card requests are checked against the model
The card operations' constraints were not vendored, so their requests were
checked by hand and only partly: the account number was read as the digits it
carried, the expiry and the service code were not checked at all for the
first card verification value, and the key an operation acted on was not
checked to be a key.
The constraints are in the model, so they are vendored now, the four
operations are checked against them before they look at the request, and the
checks that repeat them are gone.
The model states that the PAN sequence number is two digits and that the
application transaction counter is two bytes. The derivation reads the last
eight bytes of the packed PAN || PSN and the first two bytes of the counter,
so the longer values the hand-rolled checks allowed were read as something
other than the counter they stood for. The vectors are the ones the EMV
derivation gives for the model's inputs.
* docs(paymentcryptography): the card requests are checked against the model
The account number is digits, the expiry is four of them, the service code is
three and the PAN sequence number is two, the EMV ones as the model states
them. A formatted account number and a longer sequence number are refused
rather than read as the digits they carry.
* docs(paymentcryptography): the data plane's operation count
The Service Matrix counts the operations a service documents, and the data
plane documents four more now: the card verification value and the
authorization cryptogram.
* fix(paymentcryptography): the card operations raise the errors the model names
Three findings from the review, all in the card operations.
A key that may not be used for the operation was refused with
InvalidKeyUsageException, which the data plane's model does not name, so a
client cannot catch it as its own type. The data plane names three errors,
and a refusal that is not one of them is a ValidationException.
The ARPC method 2 read an ArpcInputFormat member that no model, and no SDK,
carries, so the branch it guarded could never be taken. The member is gone
and the response value is always made the way the reference makes it.
And a hexadecimal member of an odd length is a request the model allows and
the cipher cannot read, so it was answered with an internal failure the
caller cannot catch. It is refused with the error the model names, and the
refusal names the member.
* test(paymentcryptography): the card operations' members are covered
Seven members the card operations read were read by no test, so nothing
proved they work: the response attributes and the response code, the card
status update and the proprietary data, the track data, the unpredictable
number and the validation data length. Each is sent now, and the shape the
service receives with them is exercised.
The response value is made by both ARPC methods, and a request that asks for
none is answered without one.
* test(paymentcryptography): the padding type is refused
The padding type belongs to RSA, and the symmetric cipher does not pad, so a
request that names one is refused rather than answered with a cipher that
ignored it. Nothing sent one, so the refusal was never exercised.
* fix(paymentcryptography): the wrapped key is refused on every operation that carries one
The encrypt, decrypt and re-encrypt requests hold a wrapped key for the key
exchange, and the unwrapping is part of that exchange rather than part of the
cipher. A request that carries one is refused, as the PIN operations already
refused it, rather than answered as if the key were a fixed one.
The rule now lives in one place, so the two paths cannot disagree on it.
* fix(paymentcryptography): the master key is derived over the rightmost sixteen digits
The block the ICC master key is derived over is the rightmost sixteen digits of
the account number and the PAN sequence number, padded on the left with zeros
when they are shorter. That is the rule EMV 4.4 Book 2 Annex A1.4.1 gives for
Option A, and the Visa Integrated Circuit Card Specification states it the same
way.
An account number of twelve digits is therefore read and derived from, where
the derivation used to refuse it, and the refusal in the request layer goes
with it.
A derivation the request cannot be read for is refused with the error the
model names, rather than answered with a failure the caller cannot catch.
* test(paymentcryptography): the derivations are the ones the specifications give
The vectors are the ones the specifications publish: the ICC master key from
the EMV Option A derivation, the MasterCard proprietary session key and the
application cryptogram it produces over the same data from the M/Chip worked
example, and the common session key from the same document.
The common session key is compared with the parity bits masked, because the
document does not force the parity of the derived key and the derivation does
not affect the computation.
* fix(paymentcryptography): the dynamic value is the one Visa describes
The Visa Contactless Payment Specification gives the dynamic card
verification value in full: the leftmost four digits of the account number are
replaced by the transaction counter, and the result, the expiry and the service
code are enciphered under the card's unique derived key, which the issuer
derives from the master key with the account number and the PAN sequence
number. The three leftmost decimal digits of the result are the value.
The derivation used a session key and covered the account number as it stands,
so it was the emulator's own construction and not the value Visa describes.
The key it needs is the one the unique derived key derivation already makes,
and the request carries the PAN sequence number that derivation takes.
The counter is a binary coded decimal counter, so a counter that is not one
is refused rather than read.
* docs(paymentcryptography): the dynamic code is the emulator's one
* fix(paymentcryptography): the card value carries the length asked for
The model states the length of a card validation value as three to five, and
the service refused every length but three. The value now carries the number
of digits the request asks for, and the verification compares as many.
The dynamic value's counter is a binary coded decimal counter, so the digits
that replace the leftmost ones of the account number are zero padded on the
left to the four the field holds.
* fix(paymentcryptography): the card values and cryptograms as specified
The review of the branch found that the card values and the authorization
cryptograms did not follow the rules they are made by.
The Option B master key derivation turned the hexadecimal digits of the
hash into digits as it scanned them. The specification takes the decimal
digits of the hash first and only then the nibbles that are not decimal
digits, each reduced modulo ten, so the derivation now follows it.
The transaction data reaches the service already padded, because the
caller pads it the way the card padded it before the card enciphered it.
The service was padding it a second time, which enciphered a block the
card never enciphered. The data is enciphered as it was sent now, and a
length that is not a whole number of eight-byte blocks is refused,
because the ISO 9797-1 MAC runs over whole blocks.
The key table names the application cryptogram usage, the TDES_2KEY
algorithm and the DeriveKey mode of use for the ARQC key, so a key of
another usage, another algorithm or without the mode of use is refused.
The rules are asked in one place now, so the card operations and the
cryptogram operations cannot drift apart on what they accept.
The response value of the second issuer authentication method is made of
the card status update and the proprietary data, as the specification has
it. The response code belongs to the first method.
The EMV 4.1 tree derivation and the dynamic card verification code are
refused rather than approximated: the first is proprietary, and the
second was the emulator's own construction.
A verification that fails carries the reason the model names, and a key
that is not there is answered with a 404.
* refactor(paymentcryptography): the model settles the card value's length
The card operations refused a validation data length that was not three to
five digits, and a validation data that was not, while the model states
both. The model is checked before the operation runs, so the two checks
never reached the point where they could answer, and the model answers
the same request with the same error. The checks are gone, and the
model's own constraints have a test each, so the refusal is proved.
The class comment of EmvCrypto said the ARQC is made over the CDOL, and
it is made over the transaction data as the caller sent it, so the
comment says that now.
* refactor(paymentcryptography): the card side reads the shared helpers
The review found the card side holding copies of what the service already
holds, and the comments around them out of date.
The card operations read the request members through
PaymentCryptographyAttributes now, the same as the cryptogram operations,
instead of carrying their own text and soleVariant.
They read the key's material through PaymentCryptographyKeyRules.materialHex
as well. A key read back after a restart holds no material, and the shared
rule says so, where the raw accessor gave a null that the derivation failed
on.
The refused dynamic card verification code left its branch in the
computation and the track data and unpredictable number fields behind, and
the two-argument retailMac had no callers. They are gone.
The comments are in step with the code now: the class comment of the
cryptogram operations no longer calls the EMV 2000 derivation the common
one, the comment on the second issuer authentication method no longer
carries the response code in its input, and the class comment of EmvCrypto
no longer names OpenSSL or the original engine.
RunTask and StartTask pulled the images and started the containers inside the
request, so an unreachable registry held the call for minutes. They now answer
PROVISIONING (awsvpc) or PENDING with PENDING containers, as AWS does, and the
launch runs on a virtual-thread executor. A failed pull shows on DescribeTasks
as STOPPED / TaskFailedToStart, and a StopTask during the pull is no longer
overwritten when the containers start.
A RunTask response's PENDING containers carried the ExecuteCommandAgent as
RUNNING with a lastStartedAt; AWS reports it PENDING with neither. A start
failure after a StopTask overwrote the user's reason and UserInitiated code
with TaskFailedToStart.
AWS reports a container's memoryReservation from the moment RunTask answers.
Docker-mode responses had it from the started container; the pending
placeholders now carry it too.
ECS reports a task as pending from RunTask until it runs, through
PROVISIONING as well as PENDING. The cluster's pendingTasksCount was a
stored field nothing ever set, and the pending statistics counted only
PENDING, so both read 0 while a background launch pulled its image.
RunTask now answers before the task's images are pulled, so the test
waits for the launch to land the task instead of expecting RUNNING
straight away.
Closes#7670
Signer was the last control plane Floci's CloudFormation provisioner stubbed:
SignerCfnProvisioner recorded only the identifiers a template handed it, with
a comment saying Floci has no Signer API. This serves the API, so an SDK, the
CLI or a stack sees the profile it actually created.
Cancellation keeps the profile, as AWS does: it stays readable through
GetSigningProfile with the same ARN and version and the status Canceled, it
stops accepting jobs, and ListSigningProfiles hides it unless includeCanceled
is set or statuses names Canceled. A PutSigningProfile on the same name brings
it back as a new active version.
A signing job fails by default, and says why. Nothing on this machine signs the
artifact, so a succeeded job would advertise a signedObject key that does not
exist and every download of it would fail; the job instead completes as Failed
with a statusReason naming the object that was not written, and RevokeSignature
refuses it because there is no signature to revoke. Metadata-only callers can
set floci.services.signer.mock-signing-jobs=true, which records jobs as
succeeded and is documented as a mock rather than as AWS behaviour.
Signer routes collide with S3's path-style ones, so a request signed for the
signer scope is rewritten onto an internal prefix before matching. That rewrite
used to happen before IAM resolved the action from the path, which left every
Signer call unchecked; IamActionRegistry now strips the internal prefix the
signing service owns, and SignerIamEnforcementIntegrationTest proves a key with
no policy is refused while one with signer:* is allowed.
Co-authored-by: David Guardiola <davidguardiola@gmail.com>
Both list operations now page through the shared Pagination helper, return NextToken only while items remain, and answer an out-of-range MaxResults or a foreign or malformed NextToken with ValidationException. NamePrefix, State and ScheduleGroup filtering apply before paging.
Fixes#6720
Let the namespaced Pagination overload take the reject-empty-token flag that
paginateUnencoded already uses, and drop SchedulerService.requireNonEmptyToken.
Explain why the compatibility test's best-effort cleanup ignores failures.
* feat(paymentcryptography): the data plane as a service of its own
docs(paymentcryptography): the data plane has a page of its own
fix(paymentcryptography): a MAC under a three-key Triple DES key is computed
test(paymentcryptography): a key of another purpose does not encrypt data
feat(paymentcryptography): the data plane's IAM is generated
fix(paymentcryptography): a DUKPT MAC needs a base derivation key
fix(paymentcryptography): a key whose material is not held is refused
docs(paymentcryptography): the data plane's example runs
test(paymentcryptography): the data plane through the AWS SDK
test(paymentcryptography): the data plane through the AWS CLI
fix(paymentcryptography): the CLI test removes the keys it makes
docs(compat): the AWS CLI suite names the data plane
test(paymentcryptography): the route is read as the registry reads it
test(paymentcryptography): the request names its method and its URI
fix(paymentcryptography): the cipher pads no data
fix(paymentcryptography): the data plane takes the service scope
fix(paymentcryptography): a MAC length that is not a number is refused
docs(paymentcryptography): the data plane says the cipher pads no data
fix(paymentcryptography): the data plane ciphers with Triple DES as well
fix(paymentcryptography): the scope alias names the model's scope
fix(paymentcryptography): the Triple DES cipher is BouncyCastle's
fix(paymentcryptography): the usage and the blob keep their comments
fix(paymentcryptography): a key's family is read from its algorithm
fix(paymentcryptography): the cipher reads the vector through one helper
test(paymentcryptography): the keys are built by one builder
fix(paymentcryptography): the data plane checks the model's rules
fix(paymentcryptography): the Triple DES check value is BouncyCastle's
fix(paymentcryptography): the SDK names it TDES_2_KEY
docs(contributing): the ciphers come from BouncyCastle
refactor(paymentcryptography): the model owns the request shapes
refactor(paymentcryptography): the ciphers are BouncyCastle's
test(compat): one helper makes a key of either algorithm
docs(contributing): the cipher rule comes out
fix(paymentcryptography): the refusals are the model's
refactor(paymentcryptography): the ciphers are one helper each
refactor(paymentcryptography): the generators share the helper
docs(paymentcryptography): the javadocs name both ciphers
test(aws): the moved constants read from the shared helper
fix(paymentcryptography): the deprecated cipher constructors go
chore(paymentcryptography): the duplicate import goes
test(paymentcryptography): the DUKPT vectors the standard publishes
fix(paymentcryptography): the DUKPT refusal is the derivation's
docs(paymentcryptography): the retail MAC is over a double-length key
fix(paymentcryptography): the ISO 9797-1 MAC pads only a partial block
refactor(paymentcryptography): the refusals the model already makes
chore(aws): the routes are generated from the models again
* chore(aws): the IAM resources are generated again
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>
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.
StepFunctionsActivityTest, StepFunctionsDescribeMapRunTest,
StepFunctionsExecutionHistoryTest and StepFunctionsNestedSmTest each had their
own pollUntilDone loop. They now call TestFixtures.awaitExecutionTerminal with
the same time budgets as before (60 s, 15 s, 60 s and 30 s). Every caller
asserts the status right after, so an execution still RUNNING at the deadline
fails the test as before.
Co-authored-by: Syed Ali Hasan Shah <257496457+syedali032-creator@users.noreply.github.com>
Match observed HTTP listener DescribeListenerCertificates responses by omitting the absent Certificates list. Preserve configured HTTPS certificates and cover both Java SDK and XML response shape.
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>
Consume and delete the original EventBridge deliveries before replay.
Verify both order IDs and event types through bounded one-message SQS receives.
(cherry picked from commit 09f83296d313720aafeeaa90b26c7bf56a301ea3)
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Serialize the two Cognito compatibility classes that clear the shared SES and SNS inspection stores, using the suite's established Isolated convention. Preserve existing assertions and timeout bounds.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(ec2): support NAT gateway secondary addresses
* fix(ec2): update a NAT gateway's secondary addresses in place
A CloudFormation update that changed only a NAT gateway's Secondary*
properties replaced the gateway. The replacement was created while the old
gateway still held its Elastic IP or fixed private address, so it came back
failed with Resource.AlreadyAssociated (or InvalidIPAddress.InUse) and the
update failed. The schema does not mark the secondaries create-only, so AWS
changes them in place and the gateway keeps its id.
Ec2Service.updateNatGatewaySecondaryAddresses sets a gateway's secondaries
to the requested ones: kept ones stay, dropped Elastic IPs are handed back,
new ones are checked as CreateNatGateway checks them, and every check runs
before anything changes. The provisioner calls it instead of replacing, and
records the prior secondaries so a rolled-back update puts them back.
* fix(ec2): keep a NAT gateway's picked secondary when listed ones change
The counted slots of an in-place secondary update kept the first secondary
with no Elastic IP and an address the request does not list. With
SecondaryPrivateIpAddresses [A] and a count of 1 changed to [B] and 1, that
was the dropped listed A, while the address the subnet had picked was given
up. Counted addresses always follow the listed ones, so the counted slots now
keep the last such secondaries, in order.
Tests cover a count changed in place (an unrelated change keeps the same
addresses; 1 to 2 keeps the first; 2 to 1 keeps one of them), the picked
address surviving a listed change, and secondary Elastic IPs swapped between
listed addresses or moved to a new one, with DescribeAddresses showing each
held at its new address.
* test(ec2): pin which counted NAT gateway secondary an update keeps
The counted slots keep the last unlisted secondaries, so a count lowered
from 2 to 1 keeps the second address; the test now asserts that, and that
raising the count from 1 to 2 adds a new address in the subnet after the
kept one. The comment no longer claims counted addresses always follow the
listed ones: slot position is the only record of an address's origin, and
across updates a once-listed address can move behind a picked one.
* fix(ec2): read a NAT gateway under the allocation lock before updating its secondaries
The secondary-address update read the gateway before taking the lock that
DeleteNatGateway holds. A delete finishing in between left the update
holding a stale copy, which it then wrote back, re-associating the Elastic
IPs the delete had released and overwriting the association of a gateway
that had since taken the primary one. The gateway is now read again under
the lock, and one that is gone or deleted is refused with NatGatewayNotFound.
* test(cloudformation): read NAT gateway addresses through XmlParser
The secondary-address tests picked addresses out of DescribeNatGateways and
DescribeAddresses with a regular expression and substring checks that
depended on element order. They now select the non-primary items of
natGatewayAddressSet through XmlParser.
* test(ec2): cover a NAT gateway stored as deleted by a racing tag write
CreateTags writes a NAT gateway back under the gateway's tag lock, which
DeleteNatGateway does not take. A tag write that read the gateway before a
delete therefore stores the very record the delete marked deleted, so the
secondary-address update's deleted-state check is reachable. The test pauses
the tag write's put, deletes the gateway, lets the put finish, and asserts
the update refuses the record with NatGatewayNotFound and holds no Elastic
IP for it.
* refactor(ec2): fill a NAT gateway's address slots in one place
CreateNatGateway and the secondary-address update each walked the gateway's
slots the same way: take the listed Elastic IP and address at each
position, assign a free address where none is listed, build the address,
and give back what was assigned if a later slot fails. Both now call
fillNatGatewaySlots. Create passes its primary address as slot 0 and marks
it primary afterwards; the update passes the slots its kept secondaries
already fill. The order addresses are assigned in, the error codes and the
release on failure are unchanged.
* test(ec2): cover NAT gateway lease release and reuse the shared test helpers
No test covered the lease a NAT gateway gives back when its addresses run
out part way, so the shared slot-filling walk could lose its release with
every test green. Two tests now run a /28 subnet out of addresses, one
through CreateNatGateway and one through a secondary-address update, and
verify the lease taken on the VPC network is released and that the update
leaves the gateway as it was.
The concurrent-delete test now builds its service with mockModeService()
and waits for the blocked update with ThreadStates.awaitBlockedOrDone.
* test(ec2): build the small NAT subnet with privateSubnet
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
* 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
regen_partitions.py reads each region's optIn and s3WebsiteDashForm from the
aws-cdk checkout, so make botocore-bump could carry unrelated flag changes and
aws-data-check-botocore accepted them. Add --carry-region-flags, which keeps the
stored flags and refuses a region with none, and use it in the botocore-only
targets. aws-data-sync and aws-data-check still read aws-cdk.
Hold the ses-account lock in SesCustomVerificationEmailTemplateTest, which sends
and could overlap a test that turns account sending off.
Correct the lambdaTaggedArn Javadoc, which still described the MicroVM tag target
from before #7145.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
* fix(ecs): own network lifetimes in runtime fixtures
Give ECS capacity-provider and ephemeral-volume fixtures their own VPC/subnet lifetimes, with allocation rollback and reverse cleanup. Preserve all existing service/task/provider/volume assertions and waiter bounds.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* test: own RDS fixture subnets across regions
Extend the shared owned EC2 network fixture to retain two regional subnets. Keep RDS proxy teardown inside each network lifetime and roll back partial subnet allocation. Preserve existing region and subnet-cardinality assertions.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* test: distinguish mixed VPC rejection from zone validation
Place the second owned VPC subnet in another availability zone and require the VPC-specific error. Preserve proxy absence and reverse resource cleanup.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* test: remove cross-class RDS fixture lifecycle controls
Remove two tests that reassign another class static fixture state, and remove their Isolated annotation. Keep the independent mixed-VPC rejection test byte-identical; shared network tests retain rollback and close-order coverage.
Signed-off-by: Andre Kurait <akurait@amazon.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
In memory mode, or with prune-volumes-on-delete, deleting the last repository
removes the backing registry container and the next CreateRepository starts a
new one. Floci running in Docker reached the registry by container name, so
when the new container got a different IP the JVM's cached lookup kept
answering with the old address. Until it expired, DeleteRepository returned
500 and CreateRepository could wait long enough for the SDK to time out and
retry, which then failed with RepositoryAlreadyExistsException.
Use the address Docker reports for the container just started or adopted,
and only fall back to the name when none is known. EcrTest no longer needs to
keep a repository to avoid this.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Review of #7212 left three gaps in the parallel sdk-test-java setup.
The classes that create SES contact lists share a one-list-per-account limit
and three of them delete every list, and SesAccountAttributesTest turns
account sending off while other classes send. All of them now hold
ses-account, which costs about 8 s of serial time.
The pre-pull step discarded its output, so a failed pull only showed as a
slower run. Each pull now records its result and duration, and a step puts
them in the job summary with a warning when one failed.
Under JUnit parallel execution Surefire writes some test cases into another
class's XML file, so the timing report credited them to the wrong class. It
now sums per test case classname, which also splits sdk-test-python's single
"pytest" row into its classes.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>