* 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>
* chore(compat): run sdk-test-java classes in parallel and pre-pull service images
The sdk-test-java leg has grown to ~18 min because the suite runs strictly
serially and most of its time is spent waiting on containers Floci starts
and on minute-aligned metric ticks. Run test classes three at a time (the
methods of a class stay on one thread, in order), with @ResourceLock on the
classes that change Organizations or SES account-level state and @Isolated
on the ones that change wider shared state.
Also pull the heavy service images in the background before the tests
start, so they no longer serialize inside the test window, and drop the
stale "~10 min" note from the timing-report comment.
On the homelab runner (x86, 6 vCPU, JVM Floci with CI's flags) the suite
went from 21.5 to 10.7 min with the same 2933 tests and no new failures.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* chore(compat): lock the classes that share port 5432 and floci-duck
The first CI run in parallel failed three tests. RdsControlPlaneTest's DB
proxy could not bind port 5432 while DsqlCompatTest's endpoint held it, so
the two now share a lock. DataLakeTest's Athena query failed in floci-duck
while RedshiftRelationalSpectrumTest was using it; the classes that drive
floci-duck now share a lock too.
EcrTest deleted its last repository and the next CreateRepository stalled
for 30 s, past the SDK's timeout, while Floci kept calling the removed
registry's cached address. The retry then got RepositoryAlreadyExists. The
class now keeps one repository for its whole run, so the registry stays up.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Promote the complete retained fork #235 listener lookup validation and affected SDK and CloudFormation regressions on the qualified main base. Preserve the original compatibility fixture and JUnit SDK adapter.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(ec2): include r5.large in the instance type catalog
Promote the complete retained fork #234 catalog entry and SDK regression on current main. Keep catalog metadata and offerings consistent.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test(ec2): use JUnit and Hamcrest for R5 catalog assertions
Preserve all 18 metadata and offering assertions while following the src/test assertion conventions requested in review.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* feat(cloudformation): provision AWS::EC2::KeyPair with its private key in Parameter Store
AWS::EC2::KeyPair had no provisioner, so a stack stubbed it: the stack
reached CREATE_COMPLETE without creating a key, Ref returned a made-up
id and Fn::GetAtt returned the literal "Key.KeyPairId". A template that
creates a key pair for an instance, as the AWS::EC2::KeyPair reference
shows, got nothing to log in with.
The new provisioner does what that reference describes:
- Without PublicKeyMaterial it calls CreateKeyPair with the template's
KeyType and KeyFormat, so rsa and ed25519 keys and pem and ppk files
all work, and stores the private key in the SecureString parameter
/ec2/keypair/<KeyPairId>. With PublicKeyMaterial it imports the key,
takes the key's type from the material (KeyType is ignored, as
documented) and writes no parameter.
- Ref is the key name; Fn::GetAtt KeyPairId and KeyFingerprint are the
key's own.
- Tags are applied once the key exists and the parameter is written
last, so a step that fails leaves only the key to undo. Deleting a
created key deletes its parameter first, on stack delete, rollback
and replacement cleanup alike; a key or parameter already gone counts
as deleted. A key is deleted by its name, as Cloud Control's
DeleteResource names it; a key deleted outside the stack still has
its parameter deleted with the stack.
- Only AWS::NoValue leaves a property out; an empty string a parameter
supplies is a value, as the same string written literally is. An
empty PublicKeyMaterial fails with the MissingParameter error
ImportKeyPair gives for it.
- Every property is create-only (the registry schema has no update
handler) and KeyName is required. An update that changes another
property under the same name is refused with CloudFormation's
custom-named replacement error. A rename creates the new key, then
deletes the old one with its parameter once the update commits, or
deletes the new one if the update rolls back.
The create-only list is added to create-only-properties.json, so a
change set reports a changed name or type as a replacement, and the
generated resource-type table lists KeyPair.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): delete orphaned key pair parameters on cleanup
Replacement cleanup and rollback delete a displaced or rolled-back
AWS::EC2::KeyPair by name only. When that key had already been deleted
outside the stack, its /ec2/keypair/<KeyPairId> SecureString parameter
was left behind.
Record the id of each created key the resource still owes a delete,
keyed by name, so the cleanup, the rollback and a rollback retry also
delete that key's parameter. Imported keys have no parameter and are
not recorded.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): end a key pair's rollback retry when an update starts
A rollback that could not delete a renamed key pair's replacement leaves
it owed for ContinueUpdateRollback. Once that skipped the resource, a
later update that failed before creating anything rolled back by
retrying that old delete instead of undoing itself, and could end in
UPDATE_ROLLBACK_FAILED.
Call ReplacementCleanup.endRollbackRetry as an update starts, as the
other replacing provisioners do. The replacement stays listed, so the
next committed update or the stack delete still removes it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(cloudformation): say the rollback retry test pins a helper contract
The test added with the endRollbackRetry call rolls back the same
resource whose update failed. The engine does not do that for a key
pair today: it restores the previous resource and skips its rollback,
so the earlier commit's UPDATE_ROLLBACK_FAILED scenario is not
reachable yet. Say that the test pins the ReplacementCleanup contract
instead.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): clean up partial KeyPair parameter writes
* refactor(cloudformation): share KeyPair create-only tracking
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(sts): cap account-root token durations at one hour
Cap GetSessionToken and GetFederationToken credentials issued to the account-root identity at one hour, preserving IAM user durations and validation ordering.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test(sts): bound root token expiry by request time
Check the one-hour default using timestamps captured before the request and after the response, allowing millisecond wire precision. Preserve the root duration cap.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(ec2): tag an AMI with the tags RegisterImage is given
RegisterImage never read TagSpecification, so an AMI registered with
image tags came back from DescribeImages untagged: its tag filters
matched nothing and DescribeTags listed nothing for it. A tag
specification for another resource type was accepted as well, although
AWS fails that request.
RegisterImage now reads its image tag specifications and refuses any
other resource type with InvalidParameterValue. It checks the tags as
CreateTags does (no aws: prefix, the key and value lengths, at most 50
tags) before registering anything, so a refused request leaves no AMI
behind. The tags are stored before the AMI is, so DescribeImages never
lists it without them, and a key given twice keeps its last value, as
Floci's CreateTags keeps it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(ec2): copy an AMI's tags when CopyImage sets CopyImageTags
CopyImage never read CopyImageTags, so a copy asked to carry its
source's tags came out untagged, and DescribeImages could not find it
by them.
With CopyImageTags=true the copy now gets the caller's tags on the
source, read in the source region, less the aws: system tags, which
AWS does not copy either. Without it, or with false, no tags are
copied, which is AWS's default. The source keeps its tags, and the
copy's are stored in the destination region only. The tags are read
under the source AMI's own id, so a catalog AMI's tags on that id are
copied too, while tags put on one of its aliases are not. Floci keeps
each account's tags apart, so another account's tags never reach the
copy.
CopyImage still neither checks nor applies TagSpecification, and the
docs now say so.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(ec2): stub the CopyImage overload the handler calls
Upstream's handler test for CopyImage tag specifications stubbed the
five-argument copyImage. On this branch the handler passes
CopyImageTags as well, so the stub never matched, the mock returned
null and the test failed with a NullPointerException. It now stubs the
six-argument call with CopyImageTags false, which is what a request
without it sends.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(ec2): leave RegisterImage tag specifications to upstream's handling
Upstream now reads RegisterImage's TagSpecification in the Query
handler, refuses other resource types and checks the tags before the
AMI is registered, so this branch's own path for the same thing is a
duplicate. The seven-argument registerImage overload and the tag code
in registerImageLocked are removed, and RegisterImage goes back to
upstream's code. CopyImage stores the tags it copies straight after it
registers the copy instead.
The branch's RegisterImage tests go too: upstream's
Ec2CreateTagSpecificationIntegrationTest and Ec2QueryHandlerTest cover
the same behaviour. What the branch adds is CopyImageTags alone.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(ec2): pin a TagSpecification tag over a copied tag of the same key
With CopyImageTags=true and an image TagSpecification on the same
request, the copy carries both sets. When both name the same key, the
TagSpecification value is the one the copy keeps, since the handler
applies the specification after the service copies the source's tags.
The docs row says so; this test holds it.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(ec2): refuse a CopyImage over the tag limit before creating the copy
With CopyImageTags=true and an image TagSpecification, the copied and
the specified tags were each checked against the 50-tag limit on their
own. The service then created the AMI and its snapshots and stored the
copied tags, and only the handler's CreateTags of the specification saw
the combined set: past 50 it answered TagLimitExceeded while the copy
it had just made stayed behind, so a retry under the same Name failed
with InvalidAMIName.Duplicate.
The handler now passes the requested image tags to the service, which
checks the union of copied and requested keys before it registers
anything. The upstream handler test stubs the new signature.
The docs and the test of a key given both ways now say that the
TagSpecification value winning is Floci's behaviour: the public
CopyImage reference does not say how AWS settles that.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(ec2): keep one CopyImage service signature
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): honor retained resources on stack deletion
* test(cloudformation): assert the unretained sibling bucket is removed
* fix(cloudformation): skip every retained resource, whatever its status
A DELETE_FAILED stack can hold a CREATE_FAILED resource that the delete
never touches, because floci only deletes a failed resource it owns for
rollback. Naming it in RetainResources was accepted but left it
CREATE_FAILED with no DELETE_SKIPPED event. AWS reports every retained
resource DELETE_SKIPPED, so the retain check now runs before the
deletability guard.
* test(cloudformation): build the retain integration test on the shared CFN helpers
Use CfnStackWaits.awaitStatus, which also fails at once on another
terminal status, instead of a private poll, and CfnRequests.cfn for the
Query requests.
* fix(ec2): report NAT gateways as zonal and honor PrivateIpAddress
The Terraform AWS provider reads network_interface_id, private_ip and
public_ip from a NAT gateway only when it is reported with
availabilityMode zonal. Floci never sent availabilityMode, so all three
stayed null. Every gateway Floci creates sits in one subnet, so the
responses now say zonal.
Floci has no regional NAT gateways. A regional request that named only
its VPC failed on the missing subnet, and one that also named a subnet
got a zonal gateway, through both CreateNatGateway and
AWS::EC2::NatGateway. Both now refuse AvailabilityMode regional with
UnsupportedOperation. Any other value except zonal, such as Regional,
fails with InvalidParameterValue instead of creating a zonal gateway.
Once Terraform reads private_ip back, the gateway has to hold the
address it was asked for. private_ip forces a new gateway, and
CreateNatGateway ignored PrivateIpAddress, so a config that set it
would plan a replacement on every run. CreateNatGateway and
AWS::EC2::NatGateway now give the gateway's interface the requested
address, checked by the same rules as RunInstances: inside the subnet,
not reserved and not in use. A changed PrivateIpAddress replaces the
CloudFormation resource, as it is createOnly. A gateway has its primary
address only, so SecondaryAllocationIds, SecondaryPrivateIpAddresses
and SecondaryPrivateIpAddressCount are refused with
UnsupportedOperation instead of being dropped.
AWS::EC2::NatGateway also sets EniId, the gateway's primary interface,
which Fn::GetAtt resolved to the literal "Nat.EniId" although the
gateway has had a real interface since #5622.
Closes#6767
* fix(ec2): take no VPC network lease for a NAT gateway's requested address
DeleteNatGateway never returns a lease, so the one CreateNatGateway took
for its PrivateIpAddress kept the address from automatic allocation
after the gateway was gone. Check that the address is free the way
CreateNetworkInterface does, without the lease; automatic allocation
already steps around addresses a stored NAT gateway holds.
Ec2NatGatewayAddressIntegrationTest now sends its requests through the
shared Ec2Requests.ec2 instead of its own copy.
* feat(glue): data quality rulesets
CreateDataQualityRuleset, GetDataQualityRuleset, UpdateDataQualityRuleset
and DeleteDataQualityRuleset answered InvalidAction, and
ListDataQualityRulesets always returned an empty list, so Terraform's
aws_glue_data_quality_ruleset failed at its first apply.
Rulesets are now stored per account and Region by name, with their
description, DQDL text, target table, security configuration and created
and last modified times, and tagged through the shared tag store by their
dataQualityRuleset ARN. Update replaces only the members the request sets.
List returns them in name order with RuleCount, filtered by name,
description, target table, created and last modified times and tags, and
paged by MaxResults and NextToken. Errors follow the model:
AlreadyExistsException for a duplicate, EntityNotFoundException for an
unknown name, InvalidInputException for a missing or oversized member.
Rulesets are stored, not evaluated.
Closes#6830
* fix(glue): match a ruleset's catalog and take its store from the caller
The ListDataQualityRulesets target table filter compared only TableName and
DatabaseName, so filtering for one catalog also returned a ruleset on the
same table in another. A CatalogId in the filter now has to match too, with
a target table that names no catalog in the account's own.
The package-private GlueService constructor built the ruleset store itself;
it now takes it as an argument, as it does every other store.
* fix(glue): reuse hasTags and AwsJsonTimestamp for ruleset listing
The ruleset tag filter now goes through hasTags, as jobs, crawlers and
triggers do, and the list filter's timestamps through
AwsJsonTimestamp.epochSeconds, so a timestamp sent as a string is refused
with InvalidInputException as the SDKs never send one.
---------
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
* fix(cloudfront): return the decoded function code from GetFunction
GetFunction wrote the stored base64 text into the response body where
AWS returns the code the request carried, so reading back what you sent
gave different bytes. The body is the decoded code now, with the
octet-stream content type and the ETag header unchanged; the
CloudFormation provisioner base64-encodes the template's plain code so
the stored form stays the wire form, and GetFunction is the single
decode point.
Closes#6749
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(cloudfront): read a plain-code record persisted by an older Floci version
GetFunction served a 400 for a stored code that was not base64, and an
upgrade over persistent storage kept the records older Floci writes
wrote the CloudFormation provisioner as plain text, so those functions
stopped serving their code. A non-base64 record now reads back as its
stored bytes, and the next UpdateFunction rewrites it into the uniform
base64 form. The compat round-trip test captures the updated etag
before asserting so a failed assertion cannot hijack the cleanup's
delete.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* test(cloudfront): read the ETag update header the model names and rebase the decoded-code management tests
The decoded-code round trip asserts UpdateFunction answers the version
in the ETag header the SDK models name, so it reads the value it was
extracted from instead of null. The compat round-trip test uses AssertJ
like the rest of the compatibility module.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
---------
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(redshift-serverless): copy snapshots into the configured destination region
A SnapshotCopyConfiguration used to be stored and echoed, with nothing copied.
A background sweep now carries each AVAILABLE snapshot of the namespace, taken
at or after the configuration was created, into the destination Region with its
dump and metadata. The copy is an ordinary snapshot there, so describe, restore,
delete and expiration work on it unchanged.
- The source records the Regions it has been copied to, so a deleted or expired
copy is not made again and a retry or restart after a crash makes no second
copy. A copy made for an earlier snapshot of the same name is replaced.
- Retention and KMS key come from the configuration. A name already taken by
an unrelated snapshot in the destination is kept and logged.
- Rules carry the account and namespace id, so accounts never collide and a
recreated namespace does not inherit its predecessor's configuration.
- The destination must be a known Region in the namespace's partition.
- ResetAll now removes every snapshot dump, which it used to leak.
- New switches: snapshot-copy-enabled and snapshot-copy-sweep-interval-seconds.
* fix(redshift-serverless): keep the earlier snapshot copy restorable when a replacement fails
Each copy now gets its own dump file and the replaced copy's dump is removed
only after the new record is saved. Drop the slow, partition-bound
compatibility test; the in-repo engine and integration tests cover the copy.
* fix(redshift-serverless): name a snapshot copy's dump by id so long snapshot names still copy
* feat(rds): automated backups, kept after a delete and restored from
DescribeDBInstanceAutomatedBackups, DeleteDBInstanceAutomatedBackup,
DescribeDBClusterAutomatedBackups, DeleteDBClusterAutomatedBackup,
StartDBInstanceAutomatedBackupsReplication and
StopDBInstanceAutomatedBackupsReplication answered UnsupportedOperation, and
DeleteDBInstance and DeleteDBCluster ignored DeleteAutomatedBackups, so a
deleted database could not be restored to a point in time.
A live standalone instance with backups on now reports an active automated
backup. A delete with DeleteAutomatedBackups=false keeps a retained one, with
the PostgreSQL data saved outside mock mode, and RestoreDBInstanceToPointInTime
(by DbiResourceId or backups ARN) and RestoreDBClusterToPointInTime (by
DbClusterResourceId) restore from it. Replication to another Region is
metadata only: the replica is listed as replicating, the source lists it under
DBInstanceAutomatedBackupsReplications, and a stop or the source's delete keeps
it as retained.
Closes#6828
* fix(rds): restart stopped replication, use the replica's window, match the source ARN
A stopped replica kept as retained refused a second start of replication to
its Region; only a replica that is still replicating refuses it now, and a
retained one is replaced. A restore from a replicating backup checked the
time against the live source's window; it checks the replica's own window
now and still copies the live source. A replication source ARN naming
another account or service found this account's instance by identifier; the
whole ARN must now match the instance's.
The RDS count in the docs service matrix is 117, for the six new actions.
DescribeAlarms read only AlarmNames, AlarmNamePrefix and AlarmTypes. It
ignored StateValue, ActionPrefix, ChildrenOfAlarmName and
ParentsOfAlarmName, so each of them answered every alarm of the
requested types, and combining them was never refused.
StateValue and ActionPrefix now narrow metric and composite alarms
alike. ActionPrefix matches an alarm, OK or insufficient-data action,
since the API reference calls it a prefix for any action.
ChildrenOfAlarmName lists the alarms a composite alarm's rule names, by
name or ARN, and ParentsOfAlarmName the composite alarms whose rules
name an alarm. Neither lists the alarm it names, and both return only
the members the API reference lists: name, ARN, StateValue and
StateUpdatedTimestamp for children, name and ARN for parents.
As the API reference says, either one combined with any member except
MaxRecords and NextToken is refused with ValidationError. A StateValue
outside the enum and an empty or over-long ActionPrefix or alarm name
are refused with Smithy's validation messages, reported together with
an invalid AlarmTypes. Both handlers pass the request's filters to the
service as one AlarmFilter, so Query, JSON and CBOR answer alike, and a
JSON null member counts as left out, AlarmNamePrefix included, which
read as the prefix "null" before.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(s3): keep Content-Encoding and Cache-Control on multipart uploads
CreateMultipartUpload ignored both headers, so an object completed from a
multipart upload came back from HeadObject and GetObject without them while a
single PutObject kept them. A client that decodes by Content-Encoding (a
browser, curl --compressed) then received raw gzip bytes for any object large
enough to be uploaded in parts.
The controller now reads both headers on the ?uploads branch, stripping the
aws-chunked token as PutObject does. S3Service records them on the
MultipartUpload and applies them to the object when the upload completes.
An upload created without either header still produces an object with neither.
* test(s3): use .bin keys and text/plain in the multipart encoding tests
Match the neighbouring tests, which name objects *.bin; the behaviour under
test is not specific to YAML. The content type is text/plain rather than
application/octet-stream because MultipartUpload falls back to
application/octet-stream when CreateMultipartUpload carries no Content-Type,
so asserting that value could not catch a dropped header.
---------
Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
* fix(rds): report the RDS hosted zone id on clusters and instances
DescribeDBClusters omitted HostedZoneId and DB instance endpoints omitted
Endpoint.HostedZoneId, so Terraform's aws_rds_cluster.hosted_zone_id was
empty and Route 53 alias records pointing at RDS endpoints failed.
Add a per-region rdsHostedZoneId fact to region-facts.json through the
generator, with the us-east-1 value from the AWS CLI RDS documentation,
and read it through AwsRegionFacts.rdsHostedZoneId. Regions without a
captured value fall back to the us-east-1 zone; Floci's Route 53 resolves
alias targets by DNS name, so the fallback does not affect resolution.
The value is looked up when the response is built, so existing clusters
and instances report it too.
Closes#6778
* fix(rds): read the RDS hosted zone from the CLI example and keep the fallback in RDS
AwsRegionFacts.rdsHostedZoneId now returns an Optional like every other
accessor there, and RdsQueryHandler owns the fallback zone for regions with
no captured value, the way API Gateway keeps its own placeholder. A missing
us-east-1 entry can no longer break a describe call.
The generator reads the us-east-1 zone from a snapshot of the AWS CLI
describe-db-instances example under aws-docs/partition-guides, as the
GovCloud API Gateway zones come from the GovCloud guide, instead of a
typed-in constant. The parse is required and fails on a missing,
wrong-region or ambiguous example. Adding another region is now a data
change.
* fix(cloudwatch): evaluate composite alarms with CloudWatch's reasons and refusals
Composite alarms recorded "AlarmRule evaluated to <state>" with no
StateReasonData, were evaluated only when created, accepted a rule
naming an alarm that does not exist, and let DeleteAlarms remove an
alarm a composite alarm still names. Published CloudWatch captures
show each one differently.
- A change of state records the StateReason CloudWatch writes: "<arn>
was created and its alarm rule evaluates to OK", "<arn> was updated
and its new alarm rule evaluates to ALARM", or "<child arn>
transitioned to ALARM at Monday 14 September, 2026 06:29:58 UTC".
- StateReasonData lists triggeringAlarms: the children whose state
agrees with the new one, most recently changed first. After a child's
change only the children that changed since the composite alarm last
did are listed; the alarm history orders those changes.
- PutCompositeAlarm evaluates an alarm it updates, and its parents
follow the change.
- A rule naming a missing alarm is refused with "Could not save the
composite alarm as alarms [<arn>] in the alarm rule do not exist".
- DeleteAlarms deletes nothing when it names an alarm a composite alarm
references ("Cannot delete <name> as there are composite alarm(s)
depending on it.", or "a,b ... depending on them."), or more than one
composite alarm ("Cannot delete [2] Composite Alarms as only one
composite alarm delete is allowed in single request").
The new service, Query, JSON and SDK tests fail on main.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(cloudformation): cover a composite alarm over its stack's metric alarm
A stack whose composite alarm names the stack's own metric alarm is
created child first and deleted parent first, so neither the new
refusal of unknown children nor the refusal to delete a referenced
alarm fails it. A stack whose rule names a missing alarm rolls back
with CloudWatch's message; that test fails on main.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudwatch): evaluate composite alarms only when a child changes state
Review follow-ups to the composite alarm evaluation change.
- A child's PutMetricAlarm update, or a SetAlarmState to the state it
already has, no longer re-evaluates its parents. CloudWatch documents
that a composite alarm set with SetAlarmState "returns to its actual
state only once any of its children alarms change state"; such a
parent used to flip back with a reason naming an old transition.
- Application Auto Scaling deletes a policy's alarms one at a time, so
when a composite alarm names one of them only that one stays.
- A changed child that no longer resolves leaves its parent as it is
instead of failing the request.
- The docs say that an update closing a cycle is not evaluated, where
CloudWatch evaluates it.
- Tests: the wire and SDK tests ignore missing data so the alarm
evaluator cannot reset the states they set, one pins the reason when
two children change together, and the self-reference and cross-region
assertions, which pinned texts CloudWatch does not use, are gone.
The new manual-state and Application Auto Scaling tests fail without
this change.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudwatch): evaluate composite alarms above a cycle
A composite alarm on a cycle stayed pending, which blocked every
composite alarm above it: one whose other child changed state was never
evaluated. Alarms on the cycle are still not evaluated, but they no
longer hold up the ones above them.
Also from the second review: the docs say only a metric alarm child's
update is not a change of state, and that alarms above a cycle are
evaluated; a test covers a rule stored before missing children were
refused, whose child is created later; a test docstring links the
SetAlarmState reference.
The test for an alarm above a cycle fails without this change.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* chore(cloudwatch): log a composite evaluation that stops with alarms pending
The third review found one way the evaluation can still stop with
alarms pending: an alarm named like another alarm's ARN makes the cycle
check follow the wrong rule. The debug line removed in the previous
commit is back, so that case is visible again; the name lookup itself
predates this branch. The docs say an alarm above a cycle is evaluated
when one of its children changes state.
No behaviour change.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudwatch): count composite StateReasonData in code points
triggeringAlarms stopped adding children once the serialized JSON
passed 4000 UTF-16 units, while the StateReasonData length check
counts Unicode code points, as Smithy's length constraint counts
Unicode scalar values. An emoji is two units but one code point, so
children whose entries still fit were dropped. The cap now counts code
points, shares its constant with SetAlarmState's length check, and the
docs say so.
The new test names fifteen children with emoji and a newest one with a
short name, so that twelve entries come to exactly 4000 code points. It
lists 7 of them before this change and all 12 after; an exclusive cap
would list 11.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(cloudwatch): keep the composite alarm SDK test on Java 17 APIs
CloudWatchCompositeAlarmTest called List.getFirst(), which Java 21
added. compatibility-tests/sdk-test-java compiles for Java 17, and CI
builds it in maven:3.9-eclipse-temurin-17, so its test-compile failed
and took the sdk-test-java and ec2-containers jobs with it. The three
calls use get(0) now.
A test-compile of sdk-test-java with --release 17 fails on those three
lines before this change and passes after it. No other file of the
branch is outside the root module, which builds for Java 25.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>