mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 23:00:59 -05:00
ff813c6f348489fd97fd6858db0ef484ccbfec6a
1511
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ff813c6f34 |
fix(ec2): create the key type and format CreateKeyPair asks for (#6112)
* fix(ec2): create the key type and format CreateKeyPair asks for CreateKeyPair ignored KeyType and KeyFormat, so asking for an ED25519 key or a PuTTY key file returned a 2048-bit RSA key as PEM, and any value of either was accepted. Now, as AWS answers: - KeyType=ed25519 creates an ED25519 key, returned in OpenSSH's own BEGIN OPENSSH PRIVATE KEY format and fingerprinted by the padded base64 SHA-256 of its public key blob. - KeyFormat=ppk returns the key as an unencrypted PuTTY version 2 key file whose comment is the key pair's name. An RSA key keeps the SHA-1 fingerprint of its DER private key, taken over the key with its larger prime first, the order PuTTY stores. - Any other KeyType or KeyFormat is InvalidParameterValue with AWS's validation message, checked before the name is found taken, and nothing is created. RunInstances injects the ED25519 public key of such a key pair, and DescribeKeyPairs reports it. Follow-up to the review of #6093. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): keep the CreateKeyPair test helpers in one place The launch test and the key unit tests use the Query helpers and the ED25519 readers of Ec2CreateKeyPairIntegrationTest instead of their own, PuttyKeyFile reads fields and RSA public keys with SshPublicKeys, the digests come from Digests, and the RSA prime-order test takes its keys from Ec2KeyMaterial.generateRsa instead of building them itself. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): answer a CreateKeyPair DryRun before its other checks AWS answers CreateKeyPair with DryRun=true by DryRunOperation (412) before it looks at the name or the key type, so a DryRun with an unknown KeyType is DryRunOperation rather than InvalidParameterValue. Floci ignored DryRun and created the key pair; it now answers it first and creates nothing. The CreateKeyPair tests share their requests and key readers through Ec2CreateKeyPairFixtures rather than an integration test class, the launch test shares the container-backed application of Ec2CapturedImageReclaimIntegrationTest, a described public key is compared without the line break AWS ends it with, a created ED25519 key imports with the same fingerprint, the PuTTY comment rule is checked for CR, tab and DEL as well as LF, and the case of a key with its smaller prime first is skipped rather than failed under a generator that never makes one. The orders AWS documents nowhere are described as Floci's. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): clean up after the CreateKeyPair tests The launch test terminates its instance and deletes its key pair, since it now shares an application with another class, and the import test deletes what it made even when a step before its assertion fails. A test comment and the DryRun comment no longer claim an order AWS does not document. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): say what the launch test's cleanup leaves behind With the container manager mocked, TerminateInstances releases the instance's address and volume but leaves its record pending, so the comment says so instead of claiming the instance goes. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): record the key type CreateKeyPair created With #6093 merged, CreateKeyPair stored every key pair's type as rsa, so an ED25519 key pair was described as rsa and the key-type filter found it under rsa. It now stores the type it created. The guard test now requires the reported type and checks the key-type filter. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): share Ec2KeyPairFixtures and keep the type check to what AWS does The CreateKeyPair tests now use the key pair fixture #6093 added, which gains the type-and-format CreateKeyPair and the ED25519 key readers, and their own fixture class goes. The described-type check no longer looks the key pair up with the key-type filter, which AWS answers with InvalidParameterValue. The createKeyPair Javadoc says the name is checked as present and valid before the values. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): read a stored key pair's type from its public key A key pair saved before its type was recorded was described as rsa whenever it held key material, which would misreport a created ED25519 key pair. Its type is now read from its stored public key, created or imported; a created key pair saved before Floci kept its public key is still rsa, the only type CreateKeyPair made then. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(ec2): generate ED25519 key pairs in Ec2KeyMaterial Ec2KeyMaterial already reads imported ED25519 keys, so the created ones move there too and share its base64 and fingerprint rule instead of a class of their own. Ec2PuttyKeys uses its colon-hex fingerprint, and the PuTTY test key moves into Ec2KeyPairFixtures with the other test keys. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): check the described key type through the SDK The SDK test now checks DescribeKeyPairs returns the type each key pair was created with, which the hardcoded rsa would have failed. The key pair fixture exports the region it signs for, and the legacy keyType paragraph in the EC2 docs is re-wrapped. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
804b1d9597 |
fix(logs): paginate log group descriptions (#6142)
* fix(logs): paginate log group descriptions * fix(logs): keep group paging and validation in service Preserve legacy ordered callers and share the existing bad-token error. Render out-of-range limits with SmithyValidationErrors. For 1000 reverse-ordered groups, a 50-group page now reads names 2199 times instead of 4197 in each of three samples. Keep a deterministic budget regression for the redundant sort. |
||
|
|
ab0737798d |
fix(elbv2): answer SetSubnets with one ALB subnet with ValidationError (#6116)
* test(elbv2): expect ValidationError for SetSubnets with one ALB subnet SetSubnets on an Application Load Balancer with one subnet answers InvalidConfigurationRequest with a message of Floci's own, once the subnet has been looked up. The SetSubnets API reference states the rule CreateLoadBalancer states, subnets from at least two Availability Zones, and since #6098 CreateLoadBalancer answers one subnet with ValidationError "At least two subnets in two different Availability Zones must be specified", counted before any subnet is looked up. - ElbV2ServiceTest, ElbV2IntegrationTest (Query protocol) and the compatibility suite's ElbV2Test expect that error for SetSubnets with one subnet, in Subnets or in SubnetMappings, and for one subnet that does not exist, with the balancer left on its subnets. - CloudFormationElbV2SubnetUpdateIntegrationTest: an update that keeps the balancer and names one subnet rolls back with that error. - A Network or Gateway Load Balancer is still set onto one subnet, and a move onto no subnets, which a CloudFormation rollback makes for a balancer an earlier version saved without subnets, is still taken. - setSubnetsWithMissingSubnetReturnsSubnetNotFound sends an existing subnet beside the missing one, so it still reaches the lookup. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(elbv2): answer SetSubnets with one ALB subnet with ValidationError SetSubnets on an Application Load Balancer with one subnet now answers ValidationError (400) "At least two subnets in two different Availability Zones must be specified", the answer CreateLoadBalancer gives since #6098, instead of InvalidConfigurationRequest with a message of Floci's own. setSubnets runs requireSubnets once it has looked the balancer up for its type and before any subnet is looked up, so one subnet that does not exist gets the same answer, as on create. One SubnetMappings entry goes through the same check. The answer follows the SetSubnets API reference, which states the two-zone rule for an Application Load Balancer, and the answer AWS gives CreateLoadBalancer; no public report shows what AWS answers SetSubnets with one subnet. AWS does give a Network Load Balancer's SetSubnets with no subnets CreateLoadBalancer's message. A CloudFormation update that keeps an Application Load Balancer and names one subnet moves it through setSubnets, so it now fails with this error and rolls back. A move onto no subnets is not counted, because a CloudFormation rollback moves a balancer an earlier version saved without subnets back onto none. A Network or Gateway Load Balancer can still be set onto one subnet. resolveSubnetVpcId drops its own one-subnet refusal, which neither caller reaches any more; its zone check still refuses an Application Load Balancer whose subnets are all in one Availability Zone. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(elbv2): say where SetSubnets' one-subnet answer comes from Review follow-ups to the SetSubnets one-subnet fix: - The requireSubnets Javadoc scopes what AWS is known to answer to CreateLoadBalancer, and says SetSubnets gets the create message and order because no public report shows what AWS answers there. - The setSubnets comment says an empty list moves the balancer onto no subnets, rather than that the list is left alone. - docs/services/elb.md says the same about the SetSubnets answer, and instead of saying a Gateway Load Balancer can be set onto one subnet, that Floci does not enforce AWS's rule that SetSubnets keeps every subnet a Gateway Load Balancer already has. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): keep the SetSubnets tests to answers ELBv2 gives Review follow-ups to the SetSubnets one-subnet fix: - ElbV2CfnProvisionerTest: the update with a blank SubnetId keeps a Network Load Balancer, for which SubnetNotFound is still the answer ELBv2 gives; an Application Load Balancer now gets the subnet count error first. The move-and-move-back test moves the kept balancer onto two subnets, as ELBv2 refuses an Application Load Balancer on one. - ElbV2ServiceTest: the move onto no subnets follows the rollback it stands for, a balancer saved without subnets moved onto subnets and back onto none. SetSubnets onto one subnet for a balancer that does not exist reports LoadBalancerNotFound before any subnet is looked up. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(elbv2): word the SetSubnets count notes as the rules read Second review round on the SetSubnets one-subnet fix: - docs/services/elb.md no longer says Network and Gateway Load Balancers are not counted: they are, and a list that names a subnet cannot fail the count for them, while a SetSubnets with neither form is refused for every type once #6100 lands. It now says a Network Load Balancer can be set onto one subnet, and that AWS requires a Gateway Load Balancer's SetSubnets to list every subnet it is already on, which Floci does not enforce. - The setSubnets comment says "an earlier Floci version", as the tests do. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): give the blank SubnetId update a typed balancer Second review round on the SetSubnets one-subnet fix: the update with a blank SubnetId in ElbV2CfnProvisionerTest names a Network Load Balancer in its template, and the balancer its describe stub returns is now a network one too, so the template, the stub and the Javadoc agree. The answer the stub gives, SubnetNotFound, is unchanged. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(elbv2): scope the Gateway Load Balancer SetSubnets rule to Subnets Third review round on the SetSubnets one-subnet fix: the SetSubnets API reference states that a Gateway Load Balancer must include every subnet it is already on under Subnets only, not under SubnetMappings, so docs/services/elb.md now says the reference requires it of a Gateway Load Balancer's Subnets, rather than of its SetSubnets as a whole. Floci still does not enforce it. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * chore(elbv2): tidy what #6100 and the SetSubnets count both added With #6100 merged, this branch and it each documented and tested the same SetSubnets paths: - ElbV2ServiceTest keeps aRollbackOntoNoSubnetsIsNotCounted, which models the CloudFormation rollback that needs setSubnets to take an empty list, and drops #6100's aMoveBackOntoNoSubnetsIsStillTaken, which tested the same call on a balancer that still had subnets. The two missing-balancer tests now say which path each pins: the SetSubnets action with neither form, or setSubnets with one subnet. - The requireSubnets Javadoc names setSubnetsFromRequest beside setSubnets, and the setSubnets comment no longer repeats the empty-list reason its Javadoc gives. - docs/services/elb.md has one SetSubnets bullet instead of two. No behaviour changes. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(elbv2): say what requireSubnets checks for SetSubnets Review of the merge with #6100: the requireSubnets Javadoc gave the two-zone rule as the reason setSubnetsFromRequest runs it, but that call refuses a SetSubnets that names no subnets, for every type, and requireSubnets only counts the list. It now says SetSubnets takes the same subnets as CreateLoadBalancer, which of the two methods runs the count on which list, and that the two-zone check comes after the subnets are looked up. Javadoc only. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(elbv2): say what the folded SetSubnets bullet counts like Review of the tidy: once the two SetSubnets bullets in docs/services/elb.md became one, "counted the same way" followed the sentence about a SetSubnets with neither form, so it no longer read as CreateLoadBalancer's count. It now says a SetSubnets that names subnets is counted as CreateLoadBalancer counts them. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
0750128966 |
fix(stepfunctions): authorize nested task credentials (#6084)
Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
fbf3bfff84 |
fix(ec2): refuse key pairs AWS refuses and describe their type, create time and filters (#6093)
* fix(ec2): refuse key pairs AWS refuses and describe their type, create time and filters ImportKeyPair stored whatever material it was given. It now reads the key as AWS documents: RSA or ED25519 as an OpenSSH line, RSA also as RFC 4716 or base64 DER, bare or in PEM armour, and RSA from 1024 to 16384 bits. DSA, ECDSA, security-key and certificate keys, blobs that are incomplete, carry trailing bytes or name another type, and material with more than one key line are refused with InvalidKey.Format. The key is stored as one OpenSSH line, which is what RunInstances writes to authorized_keys. CreateKeyPair and ImportKeyPair take a KeyName of up to 255 ASCII characters with no leading or trailing space, and answer any other with InvalidParameterValue. DescribeKeyPairs now returns keyType and createTime, and honours Filter.N with key-pair-id, key-name, fingerprint, key-type, tag-key and tag:<key>, refusing any other name. Key pairs persisted before this change load as they are: they have no createTime, and their keyType is read from the stored key. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): describe malformed key pairs from saved records, not imports ImportKeyPair now refuses material that is not exactly one whole key and converts RFC 4716, so the IncludePublicKey cases that imported partial or mislabelled blobs, trailing bytes, two key lines or UTF-16 text could no longer create their key pairs. Such material is now held only by key pairs saved by an earlier version, so those cases describe a stored record through the handler instead, and the RFC 4716 case checks that the converted key is described as its OpenSSH line. The handler test stubs the DescribeKeyPairs overload that takes filters, which the handler now calls. The Key Pairs docs and the javadoc of the public-key description say what is stored now and what an older record may still hold. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): refuse a DER key whose bit string declares pad bits A SubjectPublicKeyInfo whose key BIT STRING declares unused bits made Bouncy Castle throw an IllegalStateException, which the key reader did not catch. ImportKeyPair answered such base64 DER or PEM with a 500 instead of InvalidKey.Format, and a key pair saved earlier with that material failed every DescribeKeyPairs in its region, since the key type of an older record is read from its material. The reader now refuses a key bit string with pad bits, and treats Bouncy Castle's IllegalStateException like its other parse errors. A new test sets every byte of each binary form to values that matter to DER and SSH framing and checks that nothing escapes. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): refuse an IncludePublicKey that is neither true nor false DescribeKeyPairs read IncludePublicKey with Boolean.parseBoolean, so a value such as "invalid" or "yes" was taken as false and the key pairs were described without their public keys instead of the request being refused. It now goes through the handler's strict boolean reader, the one the block device mapping and peering options use: true or false in any case, and InvalidParameterValue for anything else. TRUE was already read as true, and still is. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): send each describe filter once and allow clock skew in the SDK check The DescribeKeyPairs integration helper always sent a key-name filter of the test's prefix, so the cases that test key-name itself sent the name twice and Floci kept only the second. A key-name filter under test is now sent alone. The SDK compatibility check gives createTime a minute either side, since Floci may run in a container with another clock. The Key Pairs docs and the RSA length test now say what AWS lists and what Floci takes beyond it, citing the 8192-bit key AWS was seen to import. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): refuse a DER key with no key in its bit string An rsaEncryption SubjectPublicKeyInfo whose key bit string holds no bytes parses to no structure at all, and the reader passed that null on to a NullPointerException: ImportKeyPair answered such DER or PEM with a 500, and a key pair saved earlier with it failed DescribeKeyPairs for every listing that included it. The reader now reads the PKCS#1 sequence itself and refuses anything that is not two integers. It reads those integers signed, as an ssh-rsa blob's are, so a modulus missing its sign byte is refused rather than imported as a different, positive key. And the key type of an older record no longer depends on the reader never failing: if it does, the type is left out and the failure logged, instead of failing the whole description. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(ec2): keep key pair comments and docs true to the new checks SshPublicKeyException's javadoc said EC2 answers an unreadable imported key with no fingerprint; ImportKeyPair now refuses it with InvalidKey.Format. The Key Pairs docs say that an empty IncludePublicKey reads as false. The RSA length test links the report of an 8192-bit import in full, and the describe test says that sending one key-name filter is a Floci limit, not an AWS rule. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): cover the stored key-type guard on its own The stored-record test passed even with the reader broken, because the guard in keyTypeOf turned the reader's exception into the expected missing type. It now checks that the reader refuses each stored material by itself, and a new test makes the reader fail, through an inline static mock as other tests here do, and checks that the record is still described, with no type, and that a key-type filter passes over it. The keyTypeOf javadoc and the docs now mention that case, the docs say a blank IncludePublicKey reads as false and a missing or blank KeyName is MissingParameter, and a comment no longer says every imported key is fingerprinted with MD5. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): make the stored key-type guard test depend on its failing reader The guard test stored text the real reader already refuses without throwing, so it passed even if the failing reader was never consulted. It now stores a valid ed25519 key, whose type would be ed25519 without the failure, checks that the stubbed reader was called, and describes the record through the handler too, where each item's type is read. A comment on the stored-record test no longer says the reader refuses the records it accepts. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): AND a repeated DescribeKeyPairs filter name DescribeKeyPairs read Filter.N into a map keyed by name, so a second filter of one name replaced the first: key-name=X-prod-* with key-name=X-*-web returned X-dev-web too. AWS joins every filter with AND. The handler now passes the filters in request order, as DescribeAvailabilityZones already does, and a key pair has to match each of them, with the values of one filter still ORed. The other EC2 describe actions share the map reader and keep its behaviour; that is for a separate change. The describe test's helper goes back to ANDing a second key-name filter with its prefix filter. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): show the key-type guard covers only key pairs saved without a type With the key reader made to fail, ImportKeyPair still fails with the error, and a key pair whose type was recorded is described and filtered by key-type without the reader being consulted. Only a record saved before the type was recorded goes through the guard that leaves its type out and logs the failure. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): check repeated key pair filters in the service, and route unfiltered calls through them A service test now passes Filter.N with a repeated name to the ordered DescribeKeyPairs overload and checks that the two filters are ANDed, and that a later unknown name is still refused. The unfiltered overload goes through the ordered one too, leaving the map form as a convenience for filters of distinct names, and the docs sentence on filters is split in two. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): pick repeated key pair filters that each match more alone The service check of a repeated key-name filter used `*-rsa` then `g*`, and `g*` alone gives the same answer, so it passed when only the last filter was kept. Each filter now matches two key pairs alone and one together, so keeping either one instead fails the test. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): share one fixture between the key pair tests The import, describe and public-key integration tests each had their own CreateKeyPair, ImportKeyPair and DeleteKeyPair calls, and the same ED25519 key was pasted into five classes. Ec2KeyPairFixtures now holds those calls and the one key, which the handler, service and persistence tests use too. SshKeyBlobs builds the OpenSSH blobs and lines that SshPublicKeysTest, Ec2KeyMaterialTest and Ec2QueryHandlerTest each built and joined themselves, and the import test reads RSA keys with SshPublicKeys.rsaKeyOf instead of its own copy. Test-only: every class runs the same tests as before. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): build key blobs with the SshPublicKeysTest helpers main has SshPublicKeysTest on main already builds OpenSSH blobs with blob and joins bytes with withTrailing. The EC2 key pair tests now call those two, made public for them, instead of the SshKeyBlobs class the previous commit added, which is removed. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): keep the shared throwaway keys in Ec2KeyPairFixtures The pinned RSA key and its fingerprint, the ED25519 fingerprint, the DSA and ECDSA P-256 keys and the truncated ssh-rsa blob were each written out in two to four of the key pair test classes. They now live beside the ED25519 key in Ec2KeyPairFixtures; keys only Ec2KeyMaterialTest uses stay there. The handler test loses a comment and an import the earlier move left behind. The earlier move also switched Ec2KeyPairPublicKeyIntegrationTest and Ec2QueryHandlerTest from the ED25519 key #6055 added to the shared one; no assertion in them depends on which valid key it is. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
f2b62fbbec |
feat(dsql): serve each cluster's database on the DSQL endpoint (#6102)
* feat(dsql): serve each cluster's database on the DSQL endpoint Each Aurora DSQL cluster gets a PostgreSQL 16 database in a Docker container, set up as DSQL's (the role admin owning public, repeatable read), and every cluster is served on one TLS endpoint where the server name picks the cluster. A connection is admitted as DSQL admits it, measured on AWS: an IAM token for the endpoint, DbConnectAdmin for admin, 5 seconds of grace past expiry, a long-term key only in its own account, IAM enforcement with the account's SCPs, and DSQL's SQLSTATE, text and hint for every refusal. A role other than admin is refused as an unmapped one, since role mappings come with AWS IAM GRANT in the next part. The startup is read as DSQL reads it: a dotted parameter is refused, and of options only -c name=value counts, the first for a name. The cluster is CREATING until its database answers; a multi-Region peer is ACTIVE after peering only once its database answers. A start that fails after the container exists removes it, a deletion Docker cannot finish leaves the cluster DELETING for the next start, and whether a cluster is wanted and its route change under one lock, so a deletion racing a start leaves no route. The data plane was first one PR; it is split by layer at the maintainer's request: this part (transport and admin), then AWS IAM GRANT and the other roles, then DSQL's dialect and limits. * refactor(postgres): speak PostgreSQL's wire protocol through one shared helper The DSQL endpoint brought a third copy of the startup parsing, message framing and ErrorResponse building that the RDS proxy's PostgresProtocolHandler and Redshift's PostgresWireDecoder each carried. They now go through core.common.PostgresWire: the startup packet and its parameters, reading and writing a message with its checked length, and the fields of an ErrorResponse or NoticeResponse. The length refusals keep the RDS proxy's wording, which its tests assert; Redshift's oversized-message refusal now reads the same way. Also from the review: the DSQL integration test makes its IAM users with EnforcementFixtures.createUser, which removes them after the test; the service test shares one ready-at-once provision stub; and every exception the endpoint and session swallow is named ignored, with the reason it is safe. |
||
|
|
89317831bb |
feat(ssm): publish parameter change events (#5262)
* feat(ssm): publish parameter change events After a successful PutParameter, DeleteParameter, DeleteParameters, LabelParameterVersion or UnlabelParameterVersion, SsmService publishes the AWS-shaped aws.ssm "Parameter Store Change" event to the default EventBridge bus, with the parameter ARN in resources. A label event carries the type and description of the labelled version; an unlabel event lists the labels it removed. Every event is published after the service lock is released. Failed calls publish nothing, and a delivery failure is logged without failing or undoing the write. CloudFormation managed parameters go through SsmService and publish the same events. * test(cloudformation): move CfnStackWaits into testing CfnStackWaits was package-private in the CloudFormation tests, so the SSM event integration test polled DescribeStacks for CREATE_COMPLETE itself. It now lives in testing with a public API, and that test waits through CfnStackWaits.awaitStatus and builds its CloudFormation requests with CfnRequests.cfn instead of a private copy. * refactor(eventbridge): build service event entries in one place The ECS, Step Functions, Redshift Data, CodePipeline, SES and SSM publishers each built the same Source, DetailType, Detail and Resources entry. EventBridgeService.serviceEventEntry builds it, with Resources always present and empty for a null or blank resource ARN. Each publisher still calls putEvents with its own region and account. The explicit default EventBusName and the Region that repeated putEvents' region argument are gone; putEvents fills both the same way. |
||
|
|
1b15299228 |
feat(ecs): publish Container Insights task counts (#6054)
* feat(ecs): publish Container Insights task counts A service on a cluster whose containerInsights setting is enabled or enhanced publishes RunningTaskCount, PendingTaskCount and DesiredTaskCount to ECS/ContainerInsights once a minute, with ClusterName and ServiceName dimensions, while it has a running task. The AWS::ECS::Cluster provisioner applies ClusterSettings and restores the prior settings when a stack update rolls back. * fix(ecs): resolve ClusterSettings as a whole before reading it A ClusterSettings list wrapped in Fn::If was iterated unresolved and stored a setting with no name or value. Resolve the property node first, as the provisioner does for its other list properties. * fix(ecs): resolve ClusterSettings before creating the cluster A ClusterSettings value that failed to resolve left a cluster the stack did not track. Resolve first, and skip an entry that resolved to AWS::NoValue. * fix(ecs): date Container Insights counts by the minute they were observed * fix(ecs): count Container Insights tasks when they are published The task counts came from the service's cached runningCount, which the reconcile sets before it scales the service in or out, and from a pendingCount nothing ever sets. They are now counted from the service's own tasks after the tick has started and stopped them, so a scale-in is reported in the tick that stops the task and a PENDING task is counted. A committed in-place cluster update now drops its settings snapshot in completeUpdate: the engine only calls clearUpdate after a replacement, so the snapshot outlived the update it belonged to. * docs(ecs): note that removing ClusterSettings keeps the cluster's settings * test(ecs): cover restoring null cluster settings and read the latest metric bucket A stack update that adds ClusterSettings to a cluster created without any rolls back to null settings, through the JSON null in the snapshot; the rollback test now covers that case alongside a prior disabled setting. The scale-in test reads the latest one-minute bucket, so a minute rollover between its two reconciles no longer splits the samples into two buckets and fails the test. * fix(ecs): log a failed Container Insights write as a warning The publish ran inside the reconcile's catch, which logs only the message at debug level, so a failed metric write left the minute's sample missing without a trace. It now has its own try and logs the exception at warn. * perf(ecs): write a Container Insights sample only when a count changes The reconciler ticks every five seconds and wrote all three counts each time, and a persistent metric store rewrites its file on every put. The last sample written per account and service is kept, and the minute's sample is written again only when a count changes. A reset clears it, since it wipes the samples too. * fix(cloudformation): restore ECS cluster settings when their own update fails A failed provision puts back the resource the stack held before the attempt, which never carried the settings snapshot, so the rollback walker skipped it and the new settings stayed. The provisioner now restores the snapshot itself, as the other in-place provisioners do, and records a restore that fails as a rollback failure. The physical id is set before the settings call, so the restore and a create rollback both find the cluster. * fix(ecs): repeat a Container Insights write that failed partway The last sample written was kept until the next one replaced it, so when one count landed and the next write failed, and the counts then went back to the ones last written, the next tick skipped the minute and left the partial value in place. The record is now dropped before writing and set again only once all three counts are written. * fix(cloudformation): keep an ECS settings snapshot whose restore failed When a cluster's settings update and its own restore both failed, the snapshot stayed on the attempted resource, and the engine put back the prior resource without it. The first rollback reported the failure, and ContinueUpdateRollback then found no snapshot and reported the rollback complete with the new settings still live. The snapshot is now carried onto the restored resource, so the continuation retries the restore. * fix(cloudformation): create an ECS cluster with its settings A new cluster was created and then given its ClusterSettings in a second call. When that call failed, on a stack create or a rename, nothing tracked the cluster: the create rollback skips a CREATE_FAILED resource it does not own, and a rename never reached the replacement record. The settings now go into CreateCluster itself, so a new cluster is never left without them. A cluster the idempotent create returned, which the stack did not create, still has them applied separately and is not deleted when that fails. * fix(cloudformation): set an ECS cluster's id only once its settings apply The physical id was set before the settings call. When an update added a cluster under the name of one created outside the stack, the idempotent create returned that cluster, and if its settings then failed, the update rollback deleted the added resource and with it a cluster the stack never created. The id is set after the settings again; an update of the resource's own cluster already carries its prior id for the restore. * fix(cloudformation): restore the settings of an ECS cluster the stack found Only a resource's own cluster had its prior settings put back when the settings call failed. A cluster the idempotent create returned for a resource the stack creates or adds kept whatever a failed call left on it, while the rollback, which drops the resource, reported a clean finish. A cluster whose settings still differ after CreateCluster existed before, so its prior settings are now captured and restored either way; the snapshot attribute for the rollback walker stays on the resource's own cluster only. * test(ecs): date Container Insights samples by a clock the test pins publishContainerInsights read the minute from the wall clock, so the test of an unchanged sample skipped itself when the minute rolled over between its ticks. The minute now comes from a Clock given to a package-private constructor, which the injected one calls with Clock.systemUTC(); the test pins it and asserts the sample is dated by it. * test(ecs): drive the reconciler instead of waiting on its ticks The CloudFormation integration test waited up to 30 seconds for the background reconciler to launch the task and publish its count. It now calls reconcileServices twice, as the other ECS integration tests do. |
||
|
|
1108bc75dc |
feat(rds): DB proxy endpoints (#6062)
* feat(rds): DB proxy endpoints CreateDBProxyEndpoint, DescribeDBProxyEndpoints, ModifyDBProxyEndpoint and DeleteDBProxyEndpoint store endpoints per account and Region, checked against the service model. Each endpoint reports its proxy's own host, so a client connects through it as through the proxy. DescribeDBProxyEndpoints lists each proxy's default endpoint first; it cannot be modified or deleted. Deleting a proxy deletes its endpoints, and endpoint ARNs take tags. Closes #5805 * fix(rds): report each proxy endpoint at the proxy's current host A custom endpoint kept the proxy's host from when it was created, so after a restore gave the proxy a new host, every custom endpoint still reported the old one while default reported the new one. The host is no longer stored with the endpoint: create, describe, modify and delete take it from the proxy when they answer. A missing DBProxyName, DBProxyEndpointName or VpcSubnetIds is now MissingParameter, checked before the proxy is looked up. * test(rds): import Executable and assertTrue instead of naming them inline |
||
|
|
1dce18e766 |
feat(dynamodb): add point-in-time recovery restores (#6110)
* feat(dynamodb): add point-in-time recovery restores * feat(dynamodb): record a point-in-time change before the write * feat(dynamodb): authorize RestoreTableToPointInTime on its source table * perf(dynamodb): store each point-in-time change on its own * feat(dynamodb): delete system backups that have expired * chore(dynamodb): take point-in-time times from a clock in tests * chore(dynamodb): share the duplicated test helpers and table name pattern |
||
|
|
bf82846971 |
feat(lambdaweb): keep the code a revision was created from (#6113)
* feat(lambdaweb): keep the code a revision was created from A revision reads its code object at creation and keeps its own copy under the Lambda code path. New environments start from that copy, so a later write or delete in the bucket no longer changes what the revision runs. AWS pins the version that was current at creation when the request names none, and serves it after that version is deleted. A versionId that cannot be read gets the AWS wording. A 404 from S3 says the object does not exist with the versionId, and any other error says the object is inaccessible. * fix(lambdaweb): start environments only from the kept code Lambda Web is in no release yet, so every stored revision has its copy and the S3 fallback could only run changed code. A missing copy is now an error. At start the copies that no stored revision names are removed, such as those a restart in memory mode or a failed delete left behind. A failed write removes its partial file. Path segments escape every byte but letters, digits, - and _, so two region names never share a directory. * fix(lambdaweb): stream the code copy instead of holding it in memory A revision now streams its code object from S3 into its copy, and an environment opens that copy in place through a new ZipExtractor overload. Neither step loads the object into the heap, and a start no longer writes the archive to disk again before unpacking it. * chore: share one recursive delete across services FileTrees.delete replaces the copies in Lambda Web, ZipExtractor, CodeStore, Lambda layers, CodeBuild, S3 and CodeArtifact. Each caller keeps its own log message and level. A failure no longer stops the rest of the tree, and the walk stream is always closed. |
||
|
|
03836d5244 | fix(codebuild): honor project listing sort options (#6120) | ||
|
|
883cd4f1c2 |
fix(elbv2): refuse SetSubnets with neither Subnets nor SubnetMappings (#6100)
* test(elbv2): cover SetSubnets with neither Subnets nor SubnetMappings SetSubnets takes Subnets or SubnetMappings, and AWS refuses a request with neither. These tests pin that answer, which Floci does not give yet: a ValidationError with the CreateLoadBalancer message for the balancer's type, with the balancer left on its subnets and in its VPC, whether the two lists are left out or sent empty. They fail until the fix that follows. They also pin the paths that must keep working: a balancer that does not exist is reported first, a CloudFormation update that names neither leaves its kept balancer alone, and a rollback can still move a balancer an earlier version saved without subnets back onto none. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(elbv2): refuse SetSubnets with neither Subnets nor SubnetMappings A SetSubnets that named neither Subnets nor SubnetMappings answered success and left the load balancer in no Availability Zone, still in its VPC. The API reference says the request takes one or the other, and AWS answers a Network Load Balancer's with "ValidationError: At least one subnet must be specified", the message CreateLoadBalancer gives it. SetSubnets with neither now answers ValidationError and leaves the balancer on its subnets, with the message CreateLoadBalancer gives the balancer's type: "At least two subnets in two different Availability Zones must be specified" for an Application Load Balancer, "At least one subnet must be specified" for a Network or Gateway Load Balancer. A balancer that does not exist is still LoadBalancerNotFound, since the message depends on its type, and a request that names subnets is checked as before. The check runs in the new ElbV2Service.setRequestedSubnets, which the Query handler calls. ElbV2Service.setSubnets still takes an empty list: CloudFormation moves a kept balancer through it, never onto none on an update, and onto none on a rollback only for a balancer an earlier version saved without subnets, which rolls back as before. Follow-up to #6087. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(elbv2): keep the SetSubnets action check in the package Review follow-ups, no change in behaviour: - The action's entry point is now the package-private ElbV2Service.setSubnetsFromRequest, which only the Query handler calls; setRequestedSubnets read like a property setter. The CloudFormation provisioner, in another package, cannot reach it and keeps moving balancers through setSubnets. - Its Javadoc says why only an empty list is refused there: a request that names subnets is checked by setSubnets. The setSubnets and test Javadocs speak of a balancer an earlier Floci version saved without subnets. - The provisioner test of an update that names neither says the real reason the update must not call setSubnets: it would move the balancer onto none. - The docs line for SetSubnets gives both messages. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): give the SetSubnets neither test the class's last order #6098 adds a test at @Order(79) earlier in ElbV2IntegrationTest, while this one stays the last method in the file at @Order(78). Once both land, whoever appends a test would read 78 and pick 79, so this one takes 80 and the last method keeps the highest order. The two tests are independent, so the order between them does not matter. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): give the SetSubnets compat test its own order setSubnetsWithoutSubnets and createLoadBalancerWithoutSubnets in the compatibility suite's ElbV2Test both carried @Order(6), so JUnit's order between them was left to its tie-break. The SetSubnets test now has @Order(8), the first value not taken once #6098's @Order(7) test is in the class, so every order in the class is unique. The test stays where it is in the file: moving it below the create test would edit the lines #6098 added on main. The two tests create and delete their own balancers, so neither depends on running before the other. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
0dab646373 |
fix(emr): reject steps after cluster termination (#6115)
* fix(emr): reject steps after cluster termination * docs(emr): document terminated cluster step rejection |
||
|
|
03f87285a0 |
fix(emr-serverless): retain deleted applications for waiters (#6103)
* fix(emr-serverless): retain deleted applications for waiters * fix(emr-serverless): reject tag access after application deletion |
||
|
|
e5591dda32 |
feat(ec2): page and filter DescribeTags as AWS does (#6109)
* feat(ec2): page and filter DescribeTags as AWS does DescribeTags ignored MaxResults and NextToken, so SDK paginators got a single page, and matched filter values exactly: tag:<key> was dropped, the * and ? wildcards matched literally, and a filter name given twice kept only the last one. It now pages with MaxResults (5 to 1000, InvalidMaxResults otherwise) and NextToken, takes tag:<key> as the documented alternate spelling of a key filter plus a value filter, honours wildcards, ORs the values of one filter and ANDs separate filters. Results are ordered by resource id so a page boundary stays put while no tags change. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(ec2): bound filter wildcards and refuse every out-of-range MaxResults EC2 filter wildcards were translated to a regex, so a caller-supplied pattern of many stars backtracked for seconds against a long value and `*` skipped line terminators. They now use the two-pointer glob IAM and S3 already share, which every EC2 Describe filter goes through. DescribeTags treated MaxResults=0 and negative values as unpaged; any value sent outside 5 to 1000 now answers InvalidMaxResults, and only a missing MaxResults is unpaged. A NextToken whose offset is at or past the end returns an empty last page instead of overflowing into a token that fails on the next call. The compat case moves to its own @Order. Signed-off-by: Hector Ventura <hectorvent@gmail.com> --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
94b09ff46b |
feat(iam): dispatch UpdateRoleDescription, the description half of UpdateRole (#6029)
UpdateRoleDescription answered UnsupportedOperation 400, where the reference publishes it as a role operation of its own: "Use UpdateRole instead", and "modifies only the description of a role. This operation performs the same function as the Description parameter in the UpdateRole operation". So it is that path rather than a second one. updateRole now answers the role it wrote, updateRoleDescription is that call with the session duration left alone, and the roleNameType check comes along rather than being restated. The handler renders the Role the operation answers through the same roleXml fragment GetRole and CreateRole use, detailed, there being no documented exclusion to honour: the page's Response Elements section lists one Role object and says only that it "contains details about the modified role". Both members are required here, where UpdateRole's are optional, and that is the one place this does not simply delegate. Description is read off the request rather than through requireParam, which reads a blank value as an absent member: roleDescriptionType carries a maximum of 1000 and no minimum, so an empty description is a value that clears the description and only a missing one is a refusal. It is rendered the way the handler renders every other missing required member, "Value null at 'description' failed to satisfy constraint: Member must not be null". RoleName is answered for by validateRoleName, which reads a null as "Member must not be null" and a bad shape before any lookup, as the other 21 roleNameType operations have since #5391. A service-linked role takes a description edit, through either action. The user guide says so plainly, "You can edit the description of any role from the IAM console, API, or CLI", its own procedure for editing one is update-role with --description or the UpdateRoleDescription API, and it publishes a policy granting iam:UpdateRoleDescription over arn:aws:iam::*:role/aws-service-role/* for that. Both actions model UnmodifiableEntity, and a modelled error is not a list of what triggers it: the guard now stands on MaxSessionDuration, the only other member UpdateRole takes. So a description-only UpdateRole goes through where it was refused before, a request carrying both is refused whole with neither field written, and the other ten protected role actions are untouched. Authorization needed nothing. AWS gives the action the role resource type in the vendored authorization metadata, NAME_PARAMETERS already maps role to RoleName, and ResourceArnBuilder mints the ARN from the stored role, so the action is authorized against that role rather than against the wildcard. The routing table has carried the name since routing became generated from the model, so what changed there is only that it stops falling through to the unsupported-action arm. A role Description is held to the shape AWS publishes for it, and on every action that takes one rather than only the new one: at most 1000 characters of [\u0009\u000A\u000D -~¡-ÿ], which admits tab, newline and carriage return and no other control character. CreateRole, UpdateRole, UpdateRoleDescription and CreateServiceLinkedRole share one validateRoleDescription, run before the role is looked up or created, so a refused description never reaches a stored role. That is more than strictness. XmlBuilder escapes the five XML entities and passes everything else through, so a control character stored in a description would make the Role these actions and GetRole answer unparsable, which CreateRole could already produce before this. The rendering names neither the offending value nor the set, following the one IAM constraint message a recording covers, which also keeps the refused bytes out of the error body they would otherwise break. Reverting the three call sites fails the maximum, the control character and the sibling cases and nothing else. Sixteen tests. Ten over the wire in IamRoleDescriptionIntegrationTest: the description applied and answered, an empty description clearing it, the session duration and the trust policy untouched, the maximum taken and one character past it refused with the stored description intact, a control character refused while tab and newline are taken, CreateRole and UpdateRole answering the same way with nothing stored, an absent Description refused with the role left as it was, an absent RoleName, a name outside the shape refused ahead of the lookup, and an unknown role answering NoSuchEntity. Four on the service: the role that comes back, the shape across the create and update paths, the name read before the lookup, and a service-linked role taking the edit while refusing the duration. Two in IamServiceLinkedRoleIntegrationTest: that allowance over the wire, and CreateServiceLinkedRole answering ValidationError for a description outside the shape rather than its own InvalidInput. The protected-actions test pins UpdateRole on MaxSessionDuration, which is what AWS protects there. Docs carry the table row, the three ways this differs from UpdateRole, the description constraint and why it matters for the answer, the carve-out in the service-linked section, and the matrix row at 176, which check_service_matrix reads off the handler's own switch rather than taking the number on trust. |
||
|
|
77c5d74a7d |
fix(iam): check the EventBridge Scheduler and Pipes routes (#6044)
Under IAM enforcement no Scheduler or Pipes route was mapped to an IAM action, so every call to either went unchecked, and the roles they take with it. - Every Scheduler and Pipes route is mapped, tagging at /tags as well as /tags/<arn>, and IamRestRouteCoverageTest now checks every operation of both models. Each request is checked against the resource the Service Reference gives: schedule/<group>/<name>, the group read where Scheduler reads it (the body's GroupName on a create or an update, groupName otherwise, else default), schedule-group/<name>, pipe/<name>, the ARN a tagging route names, and * where the request names none. Scheduler and Pipes ARNs are minted in the request's partition, as those services mint theirs. - SchedulerController joins the Scheduler descriptor, so a schedule request is checked as Scheduler whatever scope signs it. Otherwise one signed for another service was checked by that service's rules. - The shared tagging routes, /tags and /v1/tags, hand a request to the service its ARN names, so it is checked as that service, against the ARN the controller acts on: the body's resourceArn on POST /tags, the query's on the other bare routes. Otherwise a Pipes grant could tag a schedule group, a scope with no tagging rule went unchecked, and a query ARN could stand in for the body's. - iam:PassRole: CreateSchedule and UpdateSchedule pass the target's RoleArn to scheduler.amazonaws.com, and CreatePipe and UpdatePipe their RoleArn to pipes.amazonaws.com, as the Scheduler user guide's example policies and the EventBridge user guide say. |
||
|
|
50e515f17a |
fix(ec2): give RunInstances the private address it asks for (#6099)
RunInstances ignored the private address it was given, so every instance got the subnet's next free address. It now reads PrivateIpAddress, NetworkInterface.1.PrivateIpAddress (Terraform), the primary NetworkInterface.1.PrivateIpAddresses entry (AWS CLI) and a launch template's primary interface address. The address is validated (inside the subnet, not reserved, not in use, including by another account's instance, interface or NAT gateway on a shared default VPC network, single instance with its own interface, no instance-level address with network interfaces), leased on the VPC's Docker network, and assigned to the instance and its primary interface. A CloudFormation AWS::EC2::Instance now launches at its declared PrivateIpAddress too. Closes #5830 |
||
|
|
61a42591a9 |
fix(elbv2): answer a single-subnet ALB with ValidationError (#6098)
* test(elbv2): expect ValidationError for a single-subnet ALB AWS answers a CreateLoadBalancer for an Application Load Balancer with one subnet with ValidationError (400) "At least two subnets in two different Availability Zones must be specified", the answer it gives one with none, and it counts the subnets before it looks them up. Floci answers InvalidConfigurationRequest with a message of its own. - ElbV2ServiceTest, ElbV2IntegrationTest (Query protocol), CloudFormationElbV2SubnetMappingsIntegrationTest and the compatibility suite's ElbV2Test expect that error, and no balancer, for one subnet in Subnets or SubnetMappings, with or without Type, and for one subnet that does not exist. A Network or Gateway Load Balancer on one subnet is still created. - The tests that sent an Application Load Balancer one missing subnet to get SubnetNotFound now send it an existing subnet as well, or ask for a Network Load Balancer, so they still reach the subnet lookup. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(elbv2): answer a single-subnet ALB with ValidationError CreateLoadBalancer for an Application Load Balancer with one subnet now answers ValidationError (400) "At least two subnets in two different Availability Zones must be specified", as AWS does, instead of InvalidConfigurationRequest with a message of Floci's own. requireSubnets, which already refused a balancer with no subnets this way, now refuses an Application Load Balancer with fewer than two. It runs before any subnet is looked up, so one subnet that does not exist gets the same answer, as on AWS. One SubnetMappings entry goes through the same check, following the rule the API reference states for both fields. CloudFormation creates and replacements go through it too. A Network or Gateway Load Balancer on one subnet is still created. SetSubnets with one subnet and two subnets in one Availability Zone keep their InvalidConfigurationRequest answers. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): cover a one-subnet ALB replacement Review follow-ups: - CloudFormationElbV2ReplacementIntegrationTest renames an Application Load Balancer onto one subnet: the update rolls back with CreateLoadBalancer's ValidationError, no balancer gets the new name, and the one it was to replace keeps both subnets. - ElbV2CfnProvisioner's Javadoc no longer says a blank SubnetId is refused as an unknown subnet, since an Application Load Balancer with only that mapping now gets the subnet count error first. - ElbV2ServiceTest says why its one-subnet test stubs a lookup that it then expects never to happen. - Ec2DescribeSubnetsNotFoundTest says the missing subnet is sent alongside an existing one, rather than that its position matters. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): give the one-subnet NLB and GWLB test its own order Review follow-up: the test createLoadBalancerOnOneSubnetIsAllowedForNetworkAndGatewayLoadBalancers shared @Order(12) with createLoadBalancerWithOneSubnetIsAValidationError, so JUnit ran the two in no defined order. It now runs at @Order(78), after the other load balancer subnet tests. Neither test depends on the other: each uses its own load balancer names, and the network and gateway one deletes the balancers it creates. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): move the one-subnet NLB and GWLB test to order 79 The draft #6100 adds setSubnetsWithNeitherSubnetsNorSubnetMappingsIsRefused at @Order(78) in the same class, and the two branches merge without a conflict, so whichever lands second would bring back a shared order. 79 is unused on main and on both branches; no other order changes. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
73e890dbc7 | fix(logs): require the policy type's read permission for DescribeAccountPolicies (#6097) | ||
|
|
5fa67625c1 |
fix(cloudformation): refuse a template that holds a null value (#6071)
* fix(cloudformation): refuse a template that holds a null value
CloudFormation refuses a template with a null anywhere in it when
ValidateTemplate, CreateStack, UpdateStack or CreateChangeSet is
requested, before anything is created: 400 ValidationError
"[<path>] 'null' values are not allowed in templates". Floci accepted
such a template and provisioned it, so a template AWS rejects deployed
locally, and ValidateTemplate answered success without reading it.
The check runs where a change set is created, which CreateStack,
UpdateStack and CreateChangeSet share, and in ValidateTemplate. The
path is the one AWS names, measured on eu-west-1 on 2026-10-20: the
first null in document order, Type in place of a resource's Properties
below them, a null Properties named as is, list entries by index and
an intrinsic's arguments included. JSON null, YAML ~ and a YAML key
with no value are all null there.
A template that does not parse is left to the parser's error where it
is processed, as the other request-time checks do.
CognitoResourceServerCfnIntegrationTest's null Scopes cases sent such
a template and expected the resource to fail. They now expect the
request refused, as on AWS, and keep what they checked: no server is
created, and a refused update leaves the server as it was.
* fix(cloudformation): refuse null templates in stack sets and answer missing template objects
A review of the null-value check found four gaps, each measured on
CloudFormation (eu-west-1, 2026-10-20) before the fix.
- A template that is null as a whole ("null", "~", "---", a comment
alone) parsed to no root
and the check failed with a 500. AWS answers "Template format error:
At least one Resources member must be defined.", which it does now.
- CreateStackSet and UpdateStackSet stored a null-valued template and
only each instance's deployment refused it. AWS refuses the request
and keeps the previous template, with CloudFormation's message
followed by the service exception's details. Both now check the
template they would keep before storing it or reserving an operation.
- ValidateTemplate reading TemplateURL reached the shared S3 fetch,
whose failures were a 500, as they already were for CreateStack and
GetTemplateSummary. A missing object or bucket now answers AWS's
ValidationError texts for all three. AWS also refuses a URL that is
not an S3 one; Floci keeps reading any host as S3, so a local URL can
name Floci by whatever host reaches it.
- The compatibility test's cleanup swallowed every exception; DeleteStack
of a stack that does not exist succeeds, so it no longer catches any.
CloudFormationS3VectorsTest and CloudFormationCognitoResourceServerTest
in sdk-test-java sent null values and expected them to reach the
resource. AWS refuses those templates when the operation is requested,
so the S3 Vectors cases that cannot be deployed there are dropped and
the Cognito update case now expects the request refused, with the
server left as it was.
* refactor(cloudformation): build the stack-set null refusal with sdkErrorMessage
A review pointed out that the suffix StackSets adds to CloudFormation's
message was built by hand while CloudFormationTemplateEngine.sdkErrorMessage
already builds it for this package, and that updateStackSet wrote the
template it would keep twice. The refusal now uses sdkErrorMessage, and
the kept template is one local both checks read; the answers are the
same.
|
||
|
|
2c6f2118e8 |
fix(stepfunctions): reject reserved API headers in definitions (#6082)
Reject the live-AWS-verified reserved names and hyphenated prefixes before state-machine creation or update, including JSONata and nested workflows. Share the existing exact-name policy with the invoker, preserve nearby accepted header names and keep the current response parser behavior. Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
a578bb0811 |
fix(emr): release instance capacity when clusters terminate (#6095)
* fix(emr): release instance capacity when clusters terminate I mark instance groups and fleets TERMINATED and clear their active capacity on automatic and manual cluster termination. I preserve requested and target capacity and cover both paths through HTTP regressions. * fix(emr): retain terminated instances and reject capacity changes |
||
|
|
95bf6df474 |
feat(dsql): add Aurora DSQL's control plane and AWS::DSQL::Cluster (#6048)
* feat(dsql): add Aurora DSQL's control plane and AWS::DSQL::Cluster The first half of #6014. Aurora DSQL's REST JSON control plane, with the answers measured on AWS (eu-west-1): CreateCluster, GetCluster, ListClusters, UpdateCluster, DeleteCluster, GetVpcEndpointServiceName, the cluster policy calls and tagging on cluster ARNs. Identifiers are 26 characters of lowercase base32 as DSQL's are, and malformed or unknown ones are refused with DSQL's messages; a cluster created without deletionProtectionEnabled is protected, and deleting a protected one is refused. CreateCluster answers CREATING and the cluster is ACTIVE right after. AWS::DSQL::Cluster waits for ACTIVE, returns the identifier from Ref and Identifier, ResourceArn, Status, CreationTime, Endpoint, VpcEndpoint and VpcEndpointServiceName through Fn::GetAtt, and a protected cluster makes the stack's deletion fail, as on AWS. A cluster has no database behind it here: its endpoint is named as on AWS, <id>.dsql.<region>.localhost.floci.io, but not served. Serving it is the second half of #6014, its own pull request. * fix(dsql): answer the control plane's edge cases as DSQL does Review of #6048, each answer measured on DSQL (eu-west-1) first: - ListClusters carries on from a page token whose cluster was deleted in between, as AWS does: the token now holds the sort position of the next page's first cluster rather than its identifier. - deletionProtectionEnabled is read as DSQL reads it: text is false when it spells false in any case and true otherwise; empty text, a number, an object and a list fail with SerializationException. - The tag calls refuse another account's cluster ARN with 403 AccessDeniedException instead of reading it in the caller's account. - A client token reused with other parameters answers 409 ConflictException; with the same ones, the earlier cluster. - AWS_OWNED_KMS_KEY names AWS's own key on create and update. AWS::DSQL::Cluster reads DeletionProtectionEnabled and PolicyDocument with AWS::NoValue as left out, and an update that drops the multi-Region properties clears them, as it already reset the key and deletion protection. ListTagsForResource copies the tags under the cluster's lock, and a cluster's lock goes with the cluster. * fix(dsql): answer errors, policies, updates and multi-Region clusters as DSQL does A review asked for the attribute coverage, the reason ValidationException carries, a real untag assertion and tests of the stack-update path. Measuring them on DSQL (eu-west-1, 2026-10-20) found more that did not match, fixed here too. - Attributes are written with resource.getAttributes().put, which the schema coverage test reads; EncryptionDetails, an object an output refuses on AWS, is recorded as a gap. - DSQL leaves reason out of its model-validation errors. Only the page token's refusal carries it, with fieldList naming next-token and its own text. maxResults no longer quotes the value. - Tag calls answer what DSQL answers: 403 for an ARN that is not a cluster ARN, 400 BadRequestException for another Region's, 404 NotFoundException for no cluster. The 403s name the caller. - Policy versions are epoch milliseconds, DeleteClusterPolicy answers the deleted version, and the missing-policy and stale-version errors carry DSQL's texts and resourceType. - Policies are checked and kept as DSQL does: its three refusal texts, a service principal, a principal that names no one, a public grant, and the lockout check when both policy actions are denied to the caller, unless bypassPolicyLockoutSafetyCheck. The kept form is Jackson's pretty printer in DSQL's element order, with condition operators and keys in HashMap order, as measured. - The public check shares its condition keys with Lambda web functions through PublicAccessConditions, and S3 now takes its fixed-value and SourceIp range tests from there. Sharing the whole rule was tried and dropped: DSQL was measured to treat some operators otherwise than LambdaWeb's and S3's rules do (ForAnyValue:, ArnLike "*", StringEquals "*"), so the operator rules stay per service. The lockout check is IamPolicyEvaluator's. - A multi-Region cluster is PENDING_SETUP and lists itself until it and each peer name one another, then ACTIVE; its deletion answers PENDING_DELETE. - AWS::DSQL::Cluster reads its properties through CfnPropertyTypes, so a PolicyDocument object or DeletionProtectionEnabled "yes" fails as on AWS, where Boolean.valueOf made "yes" false. An update leaves a property the template no longer sets as it was, deletion protection, KMS key and multi-Region alike, and removes only the tags and the policy; an earlier change put them back to their defaults, which was not measured and is not what CloudFormation does. A policy the template does not change keeps its version, and create settles on PENDING_SETUP too. DsqlServiceTest, DsqlClusterPoliciesTest and DsqlCfnProvisionerTest cover these in isolation, the integration tests over the wire. * fix(dsql): keep the public access rule to DSQL and forget a deleted policy's version A review asked to leave S3 and Lambda web functions out of this change, and pointed at DSQL's own block public access page. The shared helper is dropped and S3 and Lambda web functions are as on main; folding their copies into one helper belongs to a separate change. DSQL now has its own keys: the trusted ones its page lists, and aws:SourceIp, aws:SourceVpcArn and the three aws:Vpce* keys, which the page leaves out but DSQL accepts (measured, eu-west-1, 2026-10-20). As the page says, a policy variable never restricts: StringEquals with ${aws:PrincipalArn}, ${aws:SourceVpc} or a role/${aws:username} ARN is public on DSQL. ArnEquals reads like ArnLike, as IAM matches both the same way, so a value that is no ARN, ${aws:SourceArn} among them, matches nothing and restricts, as measured. DeleteClusterPolicy left the deleted version on the cluster, so a put naming it went through; it is now cleared, and a put that names a version on a cluster with no policy is refused as not found. |
||
|
|
67e4bfec1c |
fix(emr): terminate transient clusters after steps (#6085)
* fix(emr): terminate transient clusters after steps * fix(emr): I preserve terminal state on later requests |
||
|
|
5aaa37284c |
feat(lambdaweb): refuse a long request head as AWS does (#6083)
A head past 128 KiB gets the AWS edge page 431 Platform.HeaderTooLarge before every other check. A URI of 65,535 bytes or more gets an empty 414. The HTTP server now reads heads up to 256 KiB so the data plane can answer them. Every other host keeps the Quarkus defaults of 4096 bytes for the request line and 20 KiB for the headers. |
||
|
|
a434e52892 |
fix(elbv2): refuse CreateLoadBalancer with neither Subnets nor SubnetMappings (#6087)
* test(elbv2): give the tests' subnetless load balancers subnets CreateLoadBalancer takes Subnets or SubnetMappings for every load balancer type, and AWS refuses a request with neither. Tests that created a balancer with neither, to exercise listeners, the data plane, CodeDeploy, API Gateway or CloudFormation, now give it two default subnets: the src/test classes through Ec2Service.defaultSubnetId, the Java compatibility suite through a new TestFixtures.defaultVpcSubnets. setSubnetsAfterSubnetlessCreateCanAdoptCustomVpc becomes setSubnetsInAnotherVpcIsRefused, since a balancer created with subnets keeps its VPC. The adoption it covered still applies to a balancer an earlier version saved without subnets, and ElbV2ServiceTest now covers that. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(elbv2): refuse CreateLoadBalancer with neither Subnets nor SubnetMappings A CreateLoadBalancer that named neither Subnets nor SubnetMappings made a load balancer with no Availability Zone and no VPC, where the API reference says every type takes one or the other. It now answers ValidationError and creates nothing, with the message AWS gives for the type: "At least two subnets in two different Availability Zones must be specified" for an Application Load Balancer, "At least one subnet must be specified" for a Network or Gateway Load Balancer. A CloudFormation load balancer with neither fails its stack the same way. The check runs after the duplicate-name check, because a stack update finds the balancer it keeps through DuplicateLoadBalancerName whatever subnets its template names. A balancer an earlier version saved without subnets still works, and its first SetSubnets still gives it a VPC. Follow-up to the review of #5881. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(elbv2): take a request's Subnets or SubnetMappings from ElbV2Service The rule that Subnets and SubnetMappings are alternatives, and its ValidationError, was written out three times: in the Query handler's CreateLoadBalancer and SetSubnets, and in the CloudFormation provisioner. ElbV2Service.requestedSubnets now holds it, and all three take the request's subnets from there. Valid requests resolve the same subnets as before, and both together are still refused with the same error. A new test pins the SetSubnets path, which had none. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(elbv2): say when CloudFormation refuses a load balancer without subnets The behaviour note said a CloudFormation load balancer with neither Subnets nor SubnetMappings fails its stack the same way as the API does. That holds when the stack creates or replaces the balancer. An update that keeps the balancer finds it by its taken name before the subnet check, so it leaves the balancer on its subnets, as before. The note now says so. The requireSubnets Javadoc no longer presents the Gateway Load Balancer message as AWS's own. No public record of it was found; it is the Network Load Balancer one, since a Gateway Load Balancer takes subnets the same way. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): give the remaining subnetless test requests subnets Review follow-ups: - The two duplicate-name tests, ElbV2IntegrationTest and the compatibility suite's ElbV2Test, sent a create with no subnets, so they passed only because the name is checked first. They now name subnets. The compatibility one also changes the scheme, because AWS answers a create that repeats a balancer's settings with success. - ElbV2CfnProvisionerTest's successful creates and replacements now provision templates with two subnets and match them, rather than a subnetless create the real service refuses. The kept-balancer updates keep their subnetless templates. - The CloudFormation case that leaves both properties out checks that its template really has no SubnetMappings, so a reformatted template cannot quietly turn it into the empty-list case. - TestFixtures.defaultVpcSubnets() fails with a message when the region has no default VPC or fewer than two default subnets. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): say which subnet messages are AWS's in the test docs Second-round review follow-ups, wording only: - The ELBv2 unit and Query-protocol tests of a create with neither Subnets nor SubnetMappings now say the messages are the ones AWS gives an Application or a Network Load Balancer, and that a Gateway Load Balancer gets the Network one, as the service's Javadoc does. - The provisioner test's onTwoSubnets builds its list from TWO_SUBNETS, the list its stubs match, and its Javadoc no longer reads as two subnets for every type. - TestFixtures.defaultVpcSubnets() says an Application Load Balancer needs two zones, not every load balancer. - The ELBv2 docs say a CloudFormation update moves a balancer when it names other subnets, since one that names none leaves it in place. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
484255871e |
feat(firehose): accept a Redshift destination on create, update and describe (#6004)
* feat(firehose): accept a Redshift destination on create, update and describe Adds RedshiftDestinationConfiguration to CreateDeliveryStream and RedshiftDestinationUpdate to UpdateDestination, validated against the Firehose API model. DescribeDeliveryStream returns RedshiftDestinationDescription without Password. A batch is staged in the intermediate S3 location like an S3 destination; the COPY delivery follows in a separate change. * fix(firehose): close review gaps in the Redshift destination API Require BucketARN and RoleARN on the intermediate and backup S3 configurations, validate the Secrets Manager RoleARN, apply the paired buffering-hints rule to the backup location, recognise dollar-quote tags with digits or non-ASCII letters in CopyOptions, and take the update lock in DeleteDeliveryStream so a concurrent update cannot revive a deleted stream. Rejected requests are now asserted to leave the stream unchanged. * fix(firehose): refuse any dollar sign outside a quoted CopyOptions literal A dollar-quote tag can hold any non-ASCII character, including code points outside the basic plane that a Java character-class range does not cover, so a tag pattern could hide a second statement. CopyOptions never need dollar quoting, so the separator check now refuses a dollar sign outside a quoted literal instead of parsing the tag. * docs(firehose): list every refused CopyOptions token in the docs and validation message |
||
|
|
645c97c803 |
fix(cognito): return USER_ID_FOR_SRP in the SOFTWARE_TOKEN_MFA challenge (#6086)
* fix(cognito): return USER_ID_FOR_SRP in the SOFTWARE_TOKEN_MFA challenge The SOFTWARE_TOKEN_MFA challenge carried the canonical username under USERNAME. AWS returns it as USER_ID_FOR_SRP, the key clients read to build USERNAME and SECRET_HASH for the challenge response, so they could not answer the challenge. The challenge now carries USER_ID_FOR_SRP (the sub in a pool with UsernameAttributes) and FRIENDLY_DEVICE_NAME when one was set, matching the InitiateAuth API reference example. VerifySoftwareToken keeps the FriendlyDeviceName on the user and replaces it with each newly verified authenticator. Every flow that ends in SOFTWARE_TOKEN_MFA shares the same builder, so password, admin password, SRP, USER_AUTH, NEW_PASSWORD_REQUIRED and SELECT_MFA_TYPE all get the new parameters. MFA_SETUP is unchanged. Fixes #6074 * fix(cognito): reject an over-long FriendlyDeviceName in VerifySoftwareToken VerifySoftwareToken stored a FriendlyDeviceName of any length and later returned it in the SOFTWARE_TOKEN_MFA challenge. The service model caps the member at 131072 characters, and AWS rejects a longer value during request validation, before the code is checked. A longer name now fails with InvalidParameterException and the Smithy length-constraint message, before any session, token or code is looked at, so the user's authenticator, pending association and remaining attempts are left as they were. The length counts Unicode code points, as Smithy's length trait does, so a name of supplementary characters such as emoji is measured in characters rather than UTF-16 units. An absent or empty name is unchanged. |
||
|
|
17f32c9d04 |
fix(ecs): retry FireLens configuration uploads (#6075)
* fix(ecs): retry FireLens configuration archive uploads * test(ecs): cover FireLens upload failure boundaries * perf(ecs): avoid streaming pipes for prebuilt FireLens archives Reuse byte-backed archive retries without the 16 MiB pipe and writer thread per attempt. Preserve exact archive bytes and the shared retry policy. Warmed launch measurements dropped from 17.3 MB to 0.5-0.6 MB on the caller thread, with zero new writer threads. Add regression coverage for allocation path, consumed streams and failure boundaries. * test(ecs): make FireLens retry regressions sleep-free Add a package-private task-launch overload for the FireLens upload delay. The public entry point retains six attempts and the shared 500 ms initial backoff. Preserve real replay and cleanup assertions, and verify default, zero and nonzero delay selection. The expanded 32-case class runs in 0.54-0.68 seconds instead of 22.19 seconds. |
||
|
|
d09b3215d5 |
fix(cloudformation): carry EC2 MetadataOptions from templates and instances (#6050)
* fix(cloudformation): carry EC2 MetadataOptions from templates and instances AWS::EC2::LaunchTemplate dropped LaunchTemplateData.MetadataOptions, and AWS::EC2::Instance read only the image, type and key from its launch template and ignored its own MetadataOptions. A CDK instance with requireImdsv2 therefore launched with HttpTokens=optional, and DescribeInstances reported that whatever the template declared. The template now stores the block, the instance launches with its own options over its template's, and an update that changes them applies them in place with ModifyInstanceMetadataOptions, as the property's "No interruption" update behavior allows. A hop limit that is not an integer fails the resource. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): check MetadataOptions first and reset dropped ones An update that keeps an AWS::EC2::Instance applied its MetadataOptions last, after resizing it and rewriting its security groups, user data and profile, so a bad value failed the update with the instance half changed while the stack reported a rollback. The options are now checked with EC2's own rules before anything changes, which needs Ec2Service.validateMetadataOptions to be public. An update that stopped declaring an option, its own or through its launch template (CDK's requireImdsv2 turned off), left the instance with it. The provisioner now records what it declared and returns an option it no longer declares to the launch default, as it already does for an instance profile it stops declaring. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): replace an instance whose launch template changes LaunchTemplate is a replacement property of AWS::EC2::Instance, and Floci's change-set preview already says so, but an update kept the instance whatever happened to it: removing the template (CDK's requireImdsv2 turned off) reset the instance's options in place where AWS launches a new instance. The provisioner now records which template it declared and replaces the instance when the update names another one, adds one or drops it. A new version of the same template is still applied in place, because Floci's AWS::EC2::LaunchTemplate publishes a version on every stack update. The record of declared MetadataOptions now keeps only the member names, which is all the reset needs, instead of a serialized model object. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): track template versions and roll records back The previous commit left a new version of the same launch template in place, on the grounds that the template's provisioner publishes a version on every stack update. It publishes one only when the template itself changes, so an instance naming Fn::GetAtt LatestVersionNumber sees its LaunchTemplate change exactly when AWS replaces it. The recorded spec now includes the version, and the change-set preview and the update agree: another template or version, or none, replaces the instance; one added to an instance launched without one keeps it, and an instance launched without one now carries no record at all. When a later resource failed a replacing update, the rollback restored the prior instance but kept the attempt's __FlociDeclared records, so a retry compared against the wrong declaration (a retried template drop kept the instance requiring tokens). The records as they stood before the replacement are saved and put back by rollbackUpdate, and cleared when the update completes. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): keep an instance whose launch template changes Replacing an instance on another launch template, version or none could not be made to agree with the change-set preview: a Version given by Fn::GetAtt LatestVersionNumber previews no replacement, and the template publishes a new, identical version for a Metadata-only change. Keep the instance in place, as upstream does, and reconcile what the template declares; the docs state this as a deviation from AWS. A rollback whose delete of the replacement throws has already named the prior instance again, and a rollback that then skips the resource never calls back, so put the prior instance's declared records back before rethrowing. A saved copy that cannot be read now fails the rollback. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): keep a rollback's delete failure over a bad record When the replacement's delete fails and the saved declarations cannot be read, report the delete failure with the read failure suppressed, rather than replacing it. The docs and the provisioner comment said every launch template change keeps the instance; an ImageId or KeyName the template supplies still replaces it, and a change set still previews a literal LaunchTemplate change as a replacement. Tests pin the replacement and a retried rollback. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * chore(cloudformation): vendor EC2 instance and launch template property types AWS::EC2::Instance and AWS::EC2::LaunchTemplate are to read their MetadataOptions through CfnPropertyTypes, so the generator lists them and checks the MetadataOptions members they rely on. Only their entries are added to the vendored file: a fresh generation also carries new AWS::ECS::TaskDefinition members AWS has published since, which belong to their own sync. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): refuse EC2 MetadataOptions of the wrong type AWS::EC2::Instance and AWS::EC2::LaunchTemplate read a MetadataOptions member given as a list or an object, such as HttpTokens: [required], as absent, so the instance launched with HttpTokens=optional; a block that was not an object was dropped the same way. Read the block through CfnPropertyTypes against the shape each resource schema declares, as AWS::AutoScaling::LaunchConfiguration is: a block or member of the wrong type now fails the resource with CloudFormation's template validation error, and a hop limit that is not a whole number says what it is ("found: Float") rather than a message Floci made up. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): let AWS::NoValue omit launch template metadata options The launch template read its MetadataOptions from LaunchTemplateData after resolving it, which turns AWS::NoValue into an empty string, so since the previous commit a block or hop limit left out with Fn::If and AWS::NoValue failed the template as the wrong type. Read the block as the template writes it, with AWS::NoValue already left out, as the instance does. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(cloudformation): drop the launch template's unreachable options fallback When LaunchTemplateData is absent or an intrinsic call, its resolved form has no MetadataOptions member either, so the fallback to it always gave null. Say so and use null. A test row also covers a launch template whose MetadataOptions is a string. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): put back metadata options a stack rollback undoes An update that kept the instance and changed its MetadataOptions left them changed when a later resource failed and the stack rolled back: rollbackUpdate undid replacements only, so the instance kept options the stack no longer declared, and the stack reported that the update could not be rolled back. The update now saves the options it replaces, with their region and the instance's __FlociDeclared records, and changes them last, after the tags, so nothing else in the step can fail after them. rollbackUpdate puts both back. The rollback counts as done only when the update changed nothing else on the instance; the instance type, groups, user data, profile and tags still have no rollback, so the stack keeps saying so for them, with the options put back all the same. Ec2Tags.reconcile now reports whether it changed anything, so a tag change counts. A committed or cleared update drops the saved copy. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(ec2): describe CloudFormation MetadataOptions and launch template updates The EC2 notes now say that AWS::EC2::LaunchTemplate stores MetadataOptions and AWS::EC2::Instance launches with its own over its template's, what a wrong type and AWS::NoValue do, that an update applies and resets options in place and a rollback puts them back, and that a changed or dropped LaunchTemplate keeps the instance where AWS replaces it, unless the ImageId or KeyName it supplies changed. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin the tag change and order in an options rollback A tag change in the same in-place update makes a rollback put the MetadataOptions back but report the update undone, and a tag failure leaves the options unchanged, since they are the update's last change. The validation comment now lists tags among what runs before them. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): roll back declaration-only updates and refuse blank options An update that kept the instance saved a rollback record only when it changed the instance's MetadataOptions. One that changed only what was declared, such as declaring a default the instance already had, left rollbackUpdate nothing to restore, so a later resource's failure ended the stack with "Rollback is not implemented". Every update that keeps the instance now saves its __FlociDeclared records, with the prior options only when it changes them, and a rollback restores what was saved and counts as done when nothing else on the instance changed. A MetadataOptions member given as an empty or padded string read as absent, so HttpTokens: "" launched with the default. The text is now kept as written and EC2's checks refuse it, as EC2 does; AWS::NoValue still leaves a member out. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * chore(cloudformation): sync the vendored property types with AWS The vendored file lacked the AWS::ECS::TaskDefinition SharingStrategy and NvidiaMpsAllocation members AWS has published since it was last generated, so the drift check, which runs when a change touches the file, failed. This is make cfn-property-types-sync, and the file now matches AWS's schemas. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): cover tag-only and declaration-only rollbacks A rolled-back update that changed only tags puts the declarations back and reports that it could not undo the update, without touching the options. A stack whose update only declares the default HttpTokens the instance already has ends UPDATE_ROLLBACK_COMPLETE when a later resource fails, and a string member left out with Fn::If and AWS::NoValue keeps its default. The ec2 notes say that a blank member is refused and that an update that changed no EC2 setting rolls back in full, which covers any property Floci does not apply, not only MetadataOptions. A stale test name and comment are corrected. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * revert(cloudformation): leave AWS's ECS schema change to its own sync The drift check fails on main as well: AWS has added SharingStrategy and NvidiaMpsAllocation to AWS::ECS::TaskDefinition since main vendored the file, and a fresh generation from main's own tree shows the same three ECS shapes. The AWS::EC2::Instance and AWS::EC2::LaunchTemplate entries this PR vendors already match AWS. The resync is an unrelated change, so the vendored file goes back to this PR's EC2-only addition; the check stays red until main syncs. This reverts commit |
||
|
|
e14e5433ab | fix(emr-serverless): isolate applications by request region (#6078) | ||
|
|
d1a2708634 |
fix(cognito): keep the sign-in's auth_time across managed login sessions and refresh (#5157)
The tokens an authorization code redeems for were stamped with the time of the redemption, so an authorize that a managed login session let skip the form reported a fresh sign-in, and so did every refresh of those tokens. The managed login session now records when the user signed in, the authorization code carries that time (or the identity provider callback's for federated sign-in), and the token endpoint mints with it. Refresh tokens carry it too, so REFRESH_TOKEN_AUTH, GetTokensFromRefreshToken and the token endpoint's refresh_token grant keep the original auth_time, as AWS documents: "Refreshing a token doesn't reset the auth_time claim." The sign-in time is a tagged auth_time= field after the family id, ahead of the scope field. Refresh tokens minted before keep working and fall back to the time they were issued. A pre token generation trigger can no longer suppress or override auth_time, which AWS lists among the claims a trigger cannot add, modify or suppress. |
||
|
|
0ebcf84653 |
fix(config): store PutConfigRule tags and drop them on DeleteConfigRule (#6080)
* fix(config): store PutConfigRule tags and drop them on DeleteConfigRule
PutConfigRule accepted a top-level Tags list but never stored it, so
ListTagsForResource on the new rule's ARN returned an empty list and a
tagged aws_config_config_rule drifted on every plan. DeleteConfigRule
also left any tags behind under the removed rule's ARN.
Tags are now applied when PutConfigRule creates the rule, and ignored
when it updates an existing one, as the PutConfigRule model documents
("Tags are added at creation and cannot be updated with this
operation"). The get-then-put now runs under the lock DeleteConfigRule
takes, and DeleteConfigRule removes the rule's tags inside that lock,
matching conformance packs and aggregation authorizations.
* fix(config): validate creation tags and write them before the rule
PutConfigRule and PutAggregationAuthorization now check their TagsList
against the config/2014-11-12 model (at most 50 tags, Key 1-128
characters, optional Value of at most 256) and reject with the modelled
InvalidParameterValueException before anything is stored. A tag with no
Value stays accepted, as the model makes Value optional.
PutConfigRule writes the creation tags before the rule. Tags are applied
only when the Put creates the rule, so a rule stored ahead of a failed
tag write could never get its tags back from a retry; now the failed
write leaves no rule and the retry creates both.
|
||
|
|
a899318862 |
feat(stepfunctions): invoke regional API Gateway tasks with IAM (#6043)
Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
1f96bf42f1 |
feat(ecr): registry policy, replication and scanning configuration (#5817)
* feat(ecr): registry policy, replication and scanning configuration PutRegistryPolicy, GetRegistryPolicy, DeleteRegistryPolicy, PutReplicationConfiguration, DescribeRegistry, PutRegistryScanningConfiguration and GetRegistryScanningConfiguration store the registry's own settings per account and Region and return them as written. Floci does not replicate or scan images or evaluate the policy, as with repository policies. - The policy must be a JSON object; a missing one is RegistryPolicyNotFoundException. - Replication destinations, filters and rule counts are checked against the service model, and an empty rules list clears the configuration. - Scanning defaults to BASIC with no rules, and CONTINUOUS_SCAN is refused with BASIC. Closes #5803 * fix(ecr): put the registry setting writes under one lock PutRegistryPolicy, DeleteRegistryPolicy, PutReplicationConfiguration and PutRegistryScanningConfiguration read the registry's one settings record, change a field and write it back. Terraform applies the three resources in parallel, so two writers could start from the same record and the later write dropped the other's setting. The read, change and write now happen under a lock per account and Region. * refactor(ecr): check registry setting requests against the vendored model The Resource Groups request walker moves to core.common as RequestConstraintCheck, so a service can check a JSON request against botocore's constraints: member types, required members, lengths and counts, number ranges, patterns and enums, each answered in the service's own words. Resource Groups keeps its BadRequestException messages. - tools/aws/request_shapes.py gains build_constraints, which regen_resource_groups_shapes.py now calls; its vendored file is unchanged. - tools/aws/regen_ecr_shapes.py vendors ecr-request-shapes.json for the seven registry setting actions, and aws-data-sync and aws-data-check run it. - EcrJsonHandler checks those requests first, answering InvalidParameterException in ECR's form. The hand-written checks the model states are gone; a policy that is not a JSON object and CONTINUOUS_SCAN with BASIC stay, as the model cannot say them. |
||
|
|
c4a2c0a4f6 | docs(ec2): clarify opt-in vCPU quota checks (#6076) | ||
|
|
9f9c16a181 |
fix(ec2): honor IncludePublicKey when describing key pairs (#6055)
* fix(ec2): honor IncludePublicKey when describing key pairs DescribeKeyPairs ignored IncludePublicKey. With IncludePublicKey=true each key pair now carries its OpenSSH public key, with the key-pair name as the comment in place of any comment an imported key had; omitted or false leaves it out. Imported material that is not a whole OpenSSH key, such as PEM or RFC 4716 text, a blob missing a field its type needs, a line that names another type than its blob, or a key type other than RSA, ED25519, ECDSA and their security-key forms, is kept as given and described without a public key. SshPublicKeys.carriesAKey checks the fields each type needs. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): describe a key pair's key only when it is exactly one key DescribeKeyPairs with IncludePublicKey=true still described a blob with bytes after its key, which OpenSSH and Go's ssh package refuse, and the first of several key lines, although an instance launched with the key pair trusts every line. Both are now described without a public key. A key pair stored before KeyName was required gets no comment instead of "null". carriesAKey reads the RSA fields once through the reader. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): leave a key-pair name that cannot be a comment off the key ImportKeyPair accepts a key-pair name with a line break, and as the comment of the described key such a name split it into lines that authorized_keys reads as further keys. A name holding a control character is now left off. carriesAKey names each ECDSA curve's coordinate size and reads a security key's application field directly, and its docs say it checks the format only. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(ec2): name the key types and formats a described key pair needs The Key Pairs section now names DER beside PEM and RFC 4716, and the two security-key types OpenSSH has, instead of a security-key form for every type. The SshPublicKeys class comment covers the whole-key check, and a test comment no longer says a tab would split the described key. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(ec2): list the described key types by their wire names The Key Pairs section lists the key types a key pair is described with by their OpenSSH names, which reads one way only, and the SshPublicKeys comments name the two security-key types instead of implying a security-key form for every key type. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
689201122f |
fix(ec2): add opt-in Standard On-Demand vCPU admission (#6058)
* feat(ec2): enforce Standard On-Demand vCPU limits Keep EC2 launches and restarts within regional account limits. * fix(ec2): preserve quota lifecycle and launch semantics Keep Spot launches independent and pending restarts recoverable. Report incomplete CloudFormation restoration accurately. * fix(ec2): make vCPU admission opt-in and running-only |
||
|
|
8bff1ba0f3 |
feat(cloudfront): sign requests to a Lambda Web Function origin under OAC (#6037)
* feat(cloudfront): sign requests to a Lambda Web Function origin under OAC CreateOriginAccessControl now takes always-amz-auth for the lambda origin type and sigv4a for s3 and lambda, with the AWS validation messages. Distributions check the origin access control of a Lambda origin as AWS does, and refuse a Lambda@Edge origin trigger in front of an origin signed with always-amz-auth or sigv4a. Under always-amz-auth, CloudFront signs its requests to a Web Function endpoint of this Floci for the distribution. An IamAuth endpoint lets them through, or under IAM enforcement evaluates the function policy for cloudfront.amazonaws.com with aws:SourceArn and aws:SourceAccount. * fix(cloudfront): refuse unknown and in-use OAC changes as AWS does A distribution naming an origin access control that does not exist is InvalidOriginAccessControl. A control an origin uses can no longer change its origin type, its signing protocol, or whether it is always-amz-auth, which AWS answers with IllegalUpdate. * fix(cloudfront): match a Lambda origin by the end of its hostname CloudFront takes a Lambda origin only from a hostname under on.aws, and it matches the fixed labels case sensitively. Floci also takes one under its own host. The CloudFront check and the caller check now share the endpoint condition keys. The docs say when CloudFront forwards the viewer Authorization. * fix(cloudfront): read the Floci host for Lambda origins from the authority URI.getHost is null for a host with an underscore, such as a Compose service name, which broke CloudFront at startup. The Web Function endpoints are named from the authority, so the match reads it the same way. |
||
|
|
1a598b7f0c |
fix(rds): retry grant and snapshot archive uploads (#6069)
* fix(rds): retry master grant archive uploads * fix(rds): retry snapshot restore archive uploads |
||
|
|
08d5a9c742 |
fix(rds): retain requested storage types (#6057)
* fix(rds): retain requested storage types Keep database storage settings across updates, copies and restarts. * fix(rds): retain Provisioned IOPS storage types |
||
|
|
ae53c4b352 |
fix(emr): preserve request-level step execution role (#6061)
* fix(emr): preserve request-level step execution role * test(emr): keep integration test order unique * fix(emr): align step roles with AWS response shapes |
||
|
|
c6551a47bc |
feat(ecr): PutImage and the layer API (#5784)
* feat(ecr): PutImage and the layer API PutImage, BatchCheckLayerAvailability, GetDownloadUrlForLayer, InitiateLayerUpload, UploadLayerPart and CompleteLayerUpload now go through the registry:2 container that docker push already writes to, so an image written through the API is the image docker pull and BatchGetImage return. - PutImage writes the manifest under its tag, or under its digest. It answers ImageDigestDoesNotMatchException, ImageAlreadyExistsException, ImageTagAlreadyExistsException and LayersNotFoundException as the model lists them. - Layer uploads map onto registry upload sessions, held in memory. Parts must follow each other, be at most 20 MiB, and all but the last at least 5 MiB. - GetDownloadUrlForLayer returns the blob's address on Floci's registry endpoint. - The immutable-tag guard moves into EcrService, so a docker push and a PutImage of one tag cannot both succeed. Closes #5735 * fix(ecr): refuse mixed layer digests, keep push time on retag, expire idle uploads CompleteLayerUpload refuses a second, different layer digest instead of ignoring it. PutImage keeps an image's first push time when it retags it. A layer upload idle for a day is refused even when no other upload opens, and dropping one cancels its registry upload session. * fix(ecr): check PutImage tags, require a manifest media type, share registry error handling - PutImage checks imageTag against the OCI tag grammar and answers InvalidParameterException otherwise. The tag goes into the registry's manifest URL, so v1?x wrote v1 and a slash wrote into another repository. - A manifest with no mediaType needs imageManifestMediaType, as on AWS, instead of Floci guessing one from the manifest's shape. - PutImage and the layer API reach the registry through one helper, callRegistry, in place of five copies of the same failure handling. * fix(ecr): answer ECR's own message for a tag outside its rule PutImage refuses a tag outside ECR's rule, [a-zA-Z0-9-_.]+ up to 300 characters, with ECR's message. A tag ECR takes but the backing registry cannot hold, one starting with '.' or '-' or longer than 128 characters, is refused with a message naming that limit, which docs/services/ecr.md now notes. |
||
|
|
d0dac9814f | fix(redshift): check the extra IAM actions GetClusterCredentials needs (#6067) | ||
|
|
fa4bacd0d1 |
fix(timestream-influxdb): retry restore archive uploads (#6064)
Reopen each backup tar for transient Docker upload retries without wrapping or buffering it. Keep restore commands outside the retry boundary and preserve cleanup on failure. Refs #5096. |
||
|
|
9b59b8997e |
feat(dynamodb): add on-demand backups (#6052)
* feat(dynamodb): add on-demand backups Add CreateBackup, DescribeBackup, ListBackups, DeleteBackup and RestoreTableFromBackup. A backup keeps a copy of the table settings and items from the time of the call, and it outlives the table. The restored table keeps the keys, indexes, billing mode, throughput and encryption. It drops the stream, TTL, point-in-time recovery, tags, deletion protection and table class, as on AWS. A GSI or LSI override must match a source index by key schema and projection, and a vector index override must match one by name. Error wording and check order follow AWS. A restore finishes before the response is sent. The response still says CREATING with RestoreInProgress true, as on AWS. Part of #4521. * feat(dynamodb): check the throughput members of a restore override * test(dynamodb): tolerate only missing resources in the backup test cleanup * feat(dynamodb): follow the AWS rules for on-demand restore overrides |
||
|
|
35ddd5c59d |
fix(redshift): retry snapshot and catalog uploads (#6065)
Rebuild host-resource uploads and catalog tar streams for transient Docker I/O retries. Keep SQL outside the retry boundary and preserve snapshot failure and optional bootstrap behavior. Refs #5096. |
||
|
|
9f99c7c2c2 |
fix(ec2): report image creation provenance and its three filters (#6059)
* fix(ec2): report image creation provenance and its three filters DescribeImages never returned SourceImageId, SourceImageRegion or SourceInstanceId, and the source-image-id, source-image-region and source-instance-id filters matched every image. - A CreateImage AMI reports the instance it captured, and the AMI that instance was launched from with its region. - A CopyImage AMI reports the AMI it copied and its SourceRegion, and no instance. - Both name the source by its AMI id, also when the request used a catalog alias, and keep naming it after the source is deregistered. - Registered and catalog AMIs report none. The filters match only images that carry the field, so the image DescribeImages makes up for a CDK lookup or an unknown launchable id no longer passes them. The fields are stored apart from the flattened ancestor Floci launches from, so a copy of a copy names its immediate source and still boots the right base image. Images saved before this change load without provenance. Split out of #5663 at review. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): accept a catalog alias in the source-image-id filter An instance launched by a catalog alias such as ami-amazonlinux2 keeps the alias as its ImageId, while the AMI captured from it records the AMI id the alias names. Filtering on the instance's ImageId therefore found nothing, where on AWS the two are always the same id. source-image-id now matches the recorded id or any alias of it, as image-id already does for catalog images. Review follow-ups in the same area: - a test pins the catalog branch of source-image-region, and the restart test names the flattened ancestor it expects; - the detached-storage test double copies the provenance fields; - the provenance test cleans up each resource independently, and the compatibility test deletes the copy's snapshot; - the AMI docs list CopyImage and DeregisterImage and say the filter takes an alias. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): pin wildcard alias matching in source-image-id The provenance test now checks that a wildcard on a catalog alias finds a capture, as it does for image-id, and reads the source-image-region result once. The DeregisterImage row in the AMI docs says a snapshot another AMI still uses is kept even with DeleteAssociatedSnapshots. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |