Commit Graph
104 Commits
Author SHA1 Message Date
rajp33 3f51fdec34 feat(rds): honor DeletionProtection on cluster restores and AWS::RDS::DBCluster (#9057)
RestoreDBClusterFromSnapshot and RestoreDBClusterToPointInTime now read
DeletionProtection and set it on the new cluster before it is stored.

The AWS::RDS::DBCluster provisioner reads DeletionProtection, creates the
cluster with it, and applies a changed value on stack update. A stack
delete of a protected cluster is refused by DeleteDBCluster and reported
as the resource's DELETE_FAILED, as on AWS.

A restore, or a CloudFormation role attach, that fails after creating the
cluster goes through one cleanup that clears the flag and always attempts
the delete, adding any failure to the original error.

Closes #9056
2026-11-19 20:56:18 -04:00
rajp33 30503c4c2e fix(rds): persist DB cluster DeletionProtection and refuse to delete a protected cluster (#8985) 2026-11-19 19:53:59 -04:00
Allen Sanborn 079d4a2813 fix(rds): store and describe Iops and StorageThroughput on DB instances (#8777)
CreateDBInstance and ModifyDBInstance accepted Iops and StorageThroughput but dropped them, and DescribeDBInstances returned neither, so a Terraform aws_db_instance that set iops or storage_throughput never converged. Both are now stored from Create and Modify. Describe reports Iops on io1, io2 and gp3 and StorageThroughput on gp3, with the RDS User Guide's gp3 baseline when an instance named neither (12,000 IOPS and 500 MiB/s from 400 GiB, 200 GiB for Oracle, never for SQL Server; 3,000 and 125 otherwise), and StorageThroughput 0 on every other type. Iops on a type without provisioned IOPS, Iops=0 aside, and StorageThroughput off gp3 are refused with InvalidParameterCombination, a create naming Iops and no type defaults to io1, and a type switch drops values the new type does not carry.
2026-11-19 13:02:39 -04:00
rajp33 4d12c76411 fix(rds): refuse plaintext PostgreSQL connections when rds.force_ssl is 1 (#8663)
With rds.force_ssl set to 1 in a PostgreSQL instance's DB parameter group, or in an Aurora PostgreSQL cluster's DB cluster parameter group, the RDS auth proxy refuses a startup that did not negotiate TLS with FATAL "no pg_hba.conf entry for host ..., no encryption" (SQLSTATE 28000), before the password exchange and without opening a backend connection. The value is read from the current parameter group on every new connection, as the parameter is dynamic on AWS. On Aurora it comes from the cluster parameter group only, looked up in the account and Region the relay ARN names, for the cluster endpoint and member endpoints. RdsRequests.createPostgresInstance takes an optional DB parameter group, and the docs give the RDS and Aurora PostgreSQL versions whose default groups force SSL.

Closes #8641
2026-11-19 07:52:07 -04:00
luiseterc 72b746be13 fix(rds): retain cluster settings and member promotion tiers (#8849)
RDS accepted a cluster's CopyTagsToSnapshot and CloudWatch log exports and an Aurora member's PromotionTier but returned none of them, so Terraform planned changes right after a successful apply. CreateDBCluster and ModifyDBCluster now keep CopyTagsToSnapshot, an explicit false included, and the enabled log exports, with a modify applying CloudwatchLogsExportConfiguration as enable and disable deltas and leaving omitted fields alone. PromotionTier is kept from CreateDBInstance and ModifyDBInstance, defaults to 1 and is refused outside 0 to 15 before anything changes, and both the instance and the cluster member list report it. The new fields persist, and state saved before them loads with the defaults.

Closes #8418
2026-11-18 13:17:50 -04:00
Joaquín Gamboa 1942378624 feat(dsql): answer a PostgreSQL server's password challenge (#8690)
* feat(dsql): answer a PostgreSQL server's password challenge
* refactor(dsql): move BackendAuthenticator beside PostgresWire
* test(dsql): run the AuthenticationOk checks over both SCRAM modes
* fix(dsql): refuse an empty SCRAM salt
* fix(dsql): refuse a SCRAM mandatory extension and repeated attributes
* fix(dsql): refuse a password request once the authentication started
* fix(dsql): allow one SASL exchange per connection
* fix(dsql): require the server nonce to extend the client nonce
* fix(dsql): bound the SCRAM messages and salt a backend sends
* fix(dsql): prepare a SCRAM password with SASLprep as PostgreSQL does
* refactor(rds): log the proxy in to its backend through BackendAuthenticator
* fix(dsql): check a SCRAM password before NFKC, as PostgreSQL does
* test(rds): take the mock MD5 backend's expected answer from BackendAuthenticator
2026-11-17 19:03:32 -04:00
rajp33 d7c2616c72 fix(rds): accept IAM auth for PostgreSQL logical replication connections (#8671) 2026-11-17 17:00:09 -04:00
Priamo GermosenandAllen Sanborn d1d03a4ad8 feat(rds): report the requested Port in Describe* behind an opt-in setting (#8760)
Floci serves each RDS database through a proxy in the 7001-7099 range,
and Endpoint.Port and DBCluster.Port reported that proxy port even when
the request set Port=5432. The Terraform AWS provider sets port from
those fields, so every aws_db_instance and aws_rds_cluster with a
conventional port planned port 7001 -> 5432 on each run.

floci.services.rds.advertise-requested-port
(FLOCI_SERVICES_RDS_ADVERTISE_REQUESTED_PORT), off by default, makes
DBInstance.Endpoint.Port and DBCluster.Port report the requested Port,
while the proxy keeps listening in its range. A cluster member without
its own Port reports its cluster's. The managed master-user secret and a
CloudFormation secret target attachment keep the connectable proxy (or
published) port. The requested port is stored, so a restart or a backend
retry rebuilds the same advertised endpoint, a stopped database follows
the setting if it changed across a restart, and a blue/green switchover
moves the requested port with the endpoint it belongs to.

Closes #4575

Co-authored-by: Allen Sanborn <allen.sanborn@gmail.com>
2026-11-17 12:50:42 -04:00
Allen Sanborn bda82cc98d fix(rds): accept SessionPinningFilters on non-MySQL DB proxies (#8606) 2026-11-16 17:10:52 -04:00
rajp33 7872ef9c51 fix(rds): start PostgreSQL with wal_level=logical when rds.logical_replication=1 (#8619) 2026-11-16 16:37:04 -04:00
Priamo Germosen 16b0b516a0 fix(rds): accept a ModifyDBSnapshot that names nothing to change (#8633)
ModifyDBSnapshot refused a request naming neither EngineVersion nor
OptionGroupName with InvalidParameterCombination, "At least one snapshot
attribute must be specified.", a message AWS does not use. The model
requires only DBSnapshotIdentifier, and neither the API reference nor the
User Guide's snapshot upgrade pages tie any error to a request with nothing
to change, so such a request now returns the snapshot unchanged. A missing
snapshot and one that is not available are still refused as before.

The RDS docs record this as Floci's reading of an undocumented case.

Closes #4083
2026-11-16 15:41:03 -04:00
jwoa95 7331a6b1ce feat(rds): publish native stop and start lifecycle events (#8614) (#8622) 2026-11-16 15:34:03 -04:00
Allen Sanborn 39f2426ba2 fix(rds): accept MySQL and MariaDB sources in CreateDBInstanceReadReplica (#7857)
CreateDBInstanceReadReplica now accepts MySQL and MariaDB sources and initialises the replica from a mysqldump or mariadb-dump copy of the source, the same copy CreateDBSnapshot uses. One engine set gates both the replica check and the SupportsReadReplica flag DescribeDBEngineVersions reports.

The copy passes MYSQL_PWD in the exec's environment rather than its command, uploads the dump readable by root only and removes it after the restore, keeps a name containing a newline whole, and replays each SHOW GRANTS row as one statement, so MariaDB's SET DEFAULT ROLE and MySQL's partial revokes restore. Other engines are still refused with InvalidDBInstanceState.
2026-11-16 14:50:00 -04:00
luiseterc 2cbdef4b23 fix(rds): enforce lifecycle resource scopes and tags (#8401)
IAM enforcement now reads RDS requests from the generated
request-resources table: all 168 RDS operations are checked on the
resources they name, from the Service Reference and pinned botocore,
so a policy scoped to a DB parameter group, proxy, snapshot or other
RDS resource applies. Stored tags of RDS and DocumentDB resources come
from the existing tag lookups for aws:ResourceTag conditions, read
only, in the ARN's own account.

Closes #8396
2026-11-16 08:09:35 -04:00
Suja Shaj 93da7a6c26 fix(rds): check that a DB instance's security groups exist and sit in its VPC (#8258)
CreateDBInstance and ModifyDBInstance now check that every security
group a request names exists in the caller's account and Region and sits
in the instance's VPC, refusing an unknown id with InvalidParameterValue
and a group of another VPC with InvalidParameterCombination. Restores,
read replicas, Blue/Green deployments and CloudFormation go through the
same check, and DocumentDB shares it. An instance whose request names no
groups gets its VPC's default security group, as RDS documents, and
describe reports that group for an instance that keeps none.
2026-11-16 07:09:37 -04:00
Jimmy Liu Jia 6ef4ad536b docs(rds): clarify zstd IAM DDL passthrough (#8155) 2026-11-12 20:54:16 -04:00
David 654473f754 feat(rds): add blue/green deployments for DB instances (#8104)
CreateBlueGreenDeployment stages a green copy of a PostgreSQL, MySQL or
MariaDB instance with the target engine version, parameter group, class
and storage, linked to the blue instance as a read replica and loaded
from a dump of it. SwitchoverBlueGreenDeployment gives green the blue
identifier, ARN, endpoint and tags and renames blue to <name>-old<n>;
the container manager moves each running container to its new ARN so
stop and delete still find it. DescribeBlueGreenDeployments supports the
four documented filters and paging, and reports INVALID_CONFIGURATION
when a member is gone. DeleteBlueGreenDeployment honours DeleteTarget
before switchover. Deployments are taggable by their deployment ARN.

Closes #8069
2026-11-12 11:10:15 -04:00
jwoa95 df1d850d71 fix(rds): apply minor engine upgrades to backing databases (#8089)
Closes floci-io/floci#8007

Persist whether a standalone instance has never initialized its database. Protect engine versions before backend startup so runtime loss and proxy failures cannot expose existing storage to a metadata-only version change. Update SDK compatibility assertions to reject unsupported upgrades and verify resizing separately.

Apply supported minor upgrades using the version-specific image on the existing volume and endpoint. Keep major upgrades, downgrades, and pinned-image changes blocked before mutation. Preserve the never-started case, report failed restarts honestly, and restore successful minor-upgrade coverage in the Java SDK compatibility suite.
2026-11-12 09:37:43 -04:00
Andre Kurait 4512de1402 fix(rds): omit empty terminal pagination markers (#7900) 2026-11-10 09:16:40 -04:00
jibin-jusdb 46f0d91716 feat(rds): CreateDBSnapshot and RestoreDBInstanceFromDBSnapshot for MySQL and MariaDB (#7747)
* feat(rds): CreateDBSnapshot and RestoreDBInstanceFromDBSnapshot for MySQL and MariaDB

A snapshot of a MySQL or MariaDB instance is a mysqldump (mariadb-dump) of
every user schema, with routines, triggers and events, taken as the master
user, followed by every non-system account recreated from SHOW CREATE USER
and SHOW GRANTS. Restoring replays it into the new instance once its server
accepts the master user over TCP, so the copy is never loaded into the
image's initializing server. SQL Server is still refused.

* fix(rds): copy roles and names with spaces in MySQL and MariaDB snapshots

Roles are now part of a MySQL or MariaDB snapshot: MariaDB roles are
recreated with CREATE ROLE, and MySQL accounts used as roles are created
first, since SHOW CREATE USER names an account's default roles. Every role
and account exists before any grant is replayed, so a user granted a role
restores. Schema and account names are read one per line, so names with
spaces stay one argument. The integration test retries through one
Awaitility helper and covers a role and a schema name with a space.

* fix(rds): wait for the server before a MySQL dump, and share the snapshot script runner

CreateDBSnapshot straight after CreateDBInstance failed: Floci reports the
instance available while the image still initializes it on a server that
does not listen on TCP. The dump script now exits 2 until the master user
can log in over TCP and is run again, as the restore is; past that probe
any failure, mysqldump's own exit 2 included, exits 1 so it is not retried.

The PostgreSQL restore, the MySQL dump and the MySQL restore now share one
runner for the upload, the exit-2 retry and the error handling.
2026-11-08 18:18:55 -04:00
Hector Ventura 364d7662a7 docs: use the floci-aws- prefix for container and volume names (#7379) 2026-11-03 21:04:28 -04:00
Simon Claessens b65755da3a feat(rds): export DB snapshots to S3 as Parquet (#7289) 2026-11-02 08:34:19 -04:00
jwoa95andPriamo Germosen 83ec0b82c3 fix(rds): rotate cluster managed credentials and secret versions together (#7003)
* fix(rds): rotate cluster managed credentials and secret versions together

* test(rds): load the PostgreSQL driver before the first DriverManager call

DriverManager only offers drivers the caller's class loader can see. After a
Quarkus restart, the first getConnection in
RdsPostgresStartupParametersIntegrationTest found none ("No suitable driver
found"), which has been failing CI shard 1 on main. Load PgJDBC through the
test's own loader first, as RdsBackendEndpointRefreshIntegrationTest already
does, and do the same in the new managed-password rotation Docker test.

---------

Co-authored-by: Priamo Germosen <priamo.germosen@starling.co>
2026-10-30 15:18:32 -04:00
David e29b1d884c feat(rds): automated backups, kept after a delete and restored from (#6996)
* feat(rds): automated backups, kept after a delete and restored from

DescribeDBInstanceAutomatedBackups, DeleteDBInstanceAutomatedBackup,
DescribeDBClusterAutomatedBackups, DeleteDBClusterAutomatedBackup,
StartDBInstanceAutomatedBackupsReplication and
StopDBInstanceAutomatedBackupsReplication answered UnsupportedOperation, and
DeleteDBInstance and DeleteDBCluster ignored DeleteAutomatedBackups, so a
deleted database could not be restored to a point in time.

A live standalone instance with backups on now reports an active automated
backup. A delete with DeleteAutomatedBackups=false keeps a retained one, with
the PostgreSQL data saved outside mock mode, and RestoreDBInstanceToPointInTime
(by DbiResourceId or backups ARN) and RestoreDBClusterToPointInTime (by
DbClusterResourceId) restore from it. Replication to another Region is
metadata only: the replica is listed as replicating, the source lists it under
DBInstanceAutomatedBackupsReplications, and a stop or the source's delete keeps
it as retained.

Closes #6828

* fix(rds): restart stopped replication, use the replica's window, match the source ARN

A stopped replica kept as retained refused a second start of replication to
its Region; only a replica that is still replicating refuses it now, and a
retained one is replaced. A restore from a replicating backup checked the
time against the live source's window; it checks the replica's own window
now and still copies the live source. A replication source ARN naming
another account or service found this account's instance by identifier; the
whole ARN must now match the instance's.

The RDS count in the docs service matrix is 117, for the six new actions.
2026-10-30 11:07:13 -04:00
Mohith 628beeef85 fix(rds): report the RDS hosted zone id on clusters and instances (#6826)
* fix(rds): report the RDS hosted zone id on clusters and instances

DescribeDBClusters omitted HostedZoneId and DB instance endpoints omitted
Endpoint.HostedZoneId, so Terraform's aws_rds_cluster.hosted_zone_id was
empty and Route 53 alias records pointing at RDS endpoints failed.

Add a per-region rdsHostedZoneId fact to region-facts.json through the
generator, with the us-east-1 value from the AWS CLI RDS documentation,
and read it through AwsRegionFacts.rdsHostedZoneId. Regions without a
captured value fall back to the us-east-1 zone; Floci's Route 53 resolves
alias targets by DNS name, so the fallback does not affect resolution.
The value is looked up when the response is built, so existing clusters
and instances report it too.

Closes #6778

* fix(rds): read the RDS hosted zone from the CLI example and keep the fallback in RDS

AwsRegionFacts.rdsHostedZoneId now returns an Optional like every other
accessor there, and RdsQueryHandler owns the fallback zone for regions with
no captured value, the way API Gateway keeps its own placeholder. A missing
us-east-1 entry can no longer break a describe call.

The generator reads the us-east-1 zone from a snapshot of the AWS CLI
describe-db-instances example under aws-docs/partition-guides, as the
GovCloud API Gateway zones come from the GovCloud guide, instead of a
typed-in constant. The parse is required and fails on a missing,
wrong-region or ambiguous example. Adding another region is now a data
change.
2026-10-30 07:05:41 -04:00
David ec21cf38c7 feat(rds): DescribeCertificates, ModifyCertificates and an instance's CA certificate (#6106)
* feat(rds): DescribeCertificates, ModifyCertificates and an instance's CA certificate

DescribeCertificates lists the Region's RDS certificate authorities with the
thumbprint and validity AWS reports, vendored from the certificate bundles AWS
publishes by tools/aws/regen_rds_ca_certificates.py, and pages them.
ModifyCertificates sets or removes the account's default for new instances.
CreateDBInstance, ModifyDBInstance, the two instance restores and
CreateDBInstanceReadReplica take CACertificateIdentifier, and instances report
it with CertificateDetails. AWS::RDS::DBInstance takes the property and
resolves the two CertificateDetails attributes. The identifier is metadata:
the auth proxy keeps presenting Floci's own CA.

Closes #5806

* fix(rds): follow the user guide on CAs and leave a blank CA alone

- An instance stored without a CA reports rds-ca-rsa2048-g1, since an
  override applies only to instances created after it.
- ap-south-1, ap-southeast-4, ca-west-1, eu-central-2, eu-south-2 and
  il-central-1 offer only rds-ca-rsa2048-g1, as the user guide says.
- A blank CACertificateIdentifier on modify leaves the instance's CA.
- --download skips a Region only on 403 or 404 and exits 1 on other
  failures.
- Reuse regionFromArn, add a createDbInstance stub helper and import
  Executable in the tests.
2026-10-26 09:29:56 -04:00
jwoa95 5f63ffb761 fix(rds): terminate target sessions during PostgreSQL restore (#6550) 2026-10-25 17:29:09 -04:00
Younes BerianeandPriamo 16c159e5b2 fix(rds): run MySQL and MariaDB with their parameter group values (#5981)
* fix(rds): run MySQL and MariaDB with their parameter group values

A DB cluster parameter group or DB parameter group was stored but never
reached the engine: the container started with only the authentication
option, so the database kept MySQL's built-in defaults.

Every container start (create, reboot, stop and start, emulator restart)
now passes the group's overrides as --loose-<name>=<value> server options:
the cluster parameter group for a cluster, the DB parameter group for a
standalone instance. The loose prefix makes the server skip an Aurora-only
parameter with a warning. Formula values and the parameters that decide
where the server listens and keeps its data are left out, and Floci's
authentication options come last so the proxy keeps working.

DescribeDBClusters now reports DBClusterParameterGroup.

Fixes #5946

* fix(rds): layer the Aurora writer's parameter group and switch groups on modify

Review follow-up:

- require_secure_transport and skip_grant_tables are no longer passed to
  the server, like port and socket: Floci's proxy talks to MySQL without
  TLS, and skip_grant_tables turns networking off, so either would lock
  every client out.
- An Aurora cluster's engine now runs with its DB cluster parameter group
  and the writer instance's DB parameter group on top, so an
  instance-level value such as max_connections reaches the database.
  Creating the writer restarts the cluster's container when its group
  changes the engine's options; every later start reads the writer's
  group too.
- ModifyDBCluster takes DBClusterParameterGroupName and ModifyDBInstance
  takes DBParameterGroupName. The group is checked against the engine
  before anything else in the request is applied, recorded at once, and
  used from the database's next start (a reboot), as on AWS.

* fix(rds): apply Aurora groups on a writer reboot and report incompatible-parameters

Review follow-up:

- RebootDBInstance on an Aurora cluster's writer restarts the database the
  cluster's members share, which is how AWS applies a changed DB cluster
  parameter group or writer DB parameter group. A reader's reboot still
  only restarts its endpoint.
- time_zone reaches the server as --default-time-zone, since MySQL has no
  time_zone option, and Aurora's binlog_format=OFF, which turns binary
  logging off and which MySQL refuses as a value, as --skip-log-bin.
- A server that stops while starting with its parameter group's options
  leaves no container, and its instance, or every member of its cluster,
  reports incompatible-parameters until a reboot starts it with values the
  server accepts. Floci logs the server's error lines.
- DescribeDBClusters names a default DB cluster parameter group only when
  DescribeDBClusterParameterGroups lists it.
- The integration test reboots the writer rather than the cluster, checks
  that binary logging is off, covers a refused value, and skips through
  RdsRequests.assumeDocker.

---------

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-10-23 23:15:19 -04:00
Aniket Shukla 133ad743ae fix(rds): include ARNs for default cluster parameter groups (#6287)
* fix(rds): include ARNs for default cluster parameter groups

* test(rds): share SDK client fixture
2026-10-22 21:15:50 -04:00
David 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
2026-10-21 06:47:06 -04:00
Aniket Shukla 1a598b7f0c fix(rds): retry grant and snapshot archive uploads (#6069)
* fix(rds): retry master grant archive uploads

* fix(rds): retry snapshot restore archive uploads
2026-10-20 08:25:52 -04:00
David Phillips 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
2026-10-20 08:22:19 -04:00
Aniket Shukla 83147f204e fix(rds): buffer PostgreSQL login responses for PgBouncer (#6005) 2026-10-19 11:48:34 -04:00
David Phillips 678c5b82a6 fix(rds): require database role grants for PostgreSQL IAM login (#5945)
* fix(rds): require database role grants for PostgreSQL IAM login

* fix(rds): preserve standard proxy IAM authentication

* fix(rds): report PAM refusal for IAM member passwords
2026-10-18 20:44:10 -04:00
David Phillips 043b919e85 fix(rds): require headroom for enabled storage autoscaling (#5863)
* fix(rds): require headroom for enabled storage autoscaling

* fix(rds): retain autoscaling headroom during storage growth

* fix(rds): check thresholds against current storage
2026-10-17 12:40:31 -04:00
Simon Claessens 772ec8d0c9 feat(rds): add the snapshot export task API (#5787)
* feat(rds): add StartExportTask, DescribeExportTasks and CancelExportTask with the export task lifecycle

* docs(rds): document the snapshot export task API

* fix(rds): route the export task actions to RDS when a request has no signing scope

* fix(rds): refuse an export to a bucket outside the snapshot's region

* fix(rds): answer export task calls with a copy of the task taken under the lock

* fix(rds): refuse an unknown DescribeExportTasks filter name before matching any task

* fix(rds): fail an export to a bucket in another region as a task, as RDS does, rather than refuse it

* docs(rds): say that a bucket in another region fails an export in mock mode too
2026-10-16 12:03:50 -04:00
Aniket Shukla e3442de5bd fix(rds): serve a CA-signed proxy TLS leaf certificate (#5700)
* fix(rds): serve a CA-signed proxy TLS leaf certificate

* fix(rds): renew proxy TLS leaves before expiry

* fix(rds): sign proxy leaves with the shared Floci CA

Reuse the canonical CA and preserve legacy SAN metadata without loading or modifying the old RDS-only certificate and key. Keep leaf renewal and expiry rejection unchanged.

* fix(rds): preserve legacy CA certificate paths

Refresh rds-ca.crt from the shared Floci root and remove the unused RDS-only key. Replace the certificate path atomically so legacy links cannot overwrite shared key material, and leave failed initialization retryable.
2026-10-16 07:19:23 -04:00
David 4353e4232b feat(rds): DescribeDBLogFiles and DownloadDBLogFilePortion (#5741)
* feat(rds): DescribeDBLogFiles and DownloadDBLogFilePortion

Both answered UnsupportedOperation, so an instance's log could only be
read with docker logs, outside the AWS API.

An instance's log is now read from its database container and cut into
files the way RDS names them: hourly error/postgresql.log.* files for
PostgreSQL, error/mysql-error.log for MySQL and MariaDB, and log/ERROR
for SQL Server. DescribeDBLogFiles filters and pages them, and
DownloadDBLogFilePortion follows the API reference's marker rules with
a 1 MB block cap. Control characters XML cannot carry come back as
U+FFFD. In mock RDS mode an instance has no log files.

Closes #5733

* fix(rds): bound and validate log file reads

A log read now takes the most recent 100,000 lines instead of the whole
history, fails when Docker does not finish in time instead of returning
part of the log, and, when Docker no longer knows the container, finds
or starts the backend once before answering DBInstanceNotReady rather
than an empty log. A single line over 1 MB is cut at 1 MB like the rest
of the block. Negative FileSize, FileLastWritten and Marker values are
InvalidParameterValue; the shared offset paging refuses a negative
marker instead of starting over.

* fix(rds): close the Docker log stream when a log read times out

A timed-out read now closes its callback before failing, so the stream
stops and nothing writes into the buffer after the read gives up; the
buffer is also written and read under one lock.

* refactor(rds): keep portion's Javadoc on portion

truncateUtf8 had landed between portion's comment and portion itself. It now follows portion.

* test(rds): read log files on the first call, and import class names

CreateDBInstance returns once the database accepts connections, so the startup log is already in the container's output. The Docker and SDK log tests now assert on the first DescribeDBLogFiles and DownloadDBLogFilePortion call instead of polling. The timeout test and RdsLogFilesTest import the classes they had written out in full.
2026-10-16 07:16:10 -04:00
David 9cd9002e73 feat(rds): EnableHttpEndpoint, DisableHttpEndpoint and HttpEndpointEnabled (#5736)
* feat(rds): EnableHttpEndpoint, DisableHttpEndpoint and HttpEndpointEnabled

EnableHttpEndpoint and DisableHttpEndpoint answered UnsupportedOperation
and DBCluster carried no HttpEndpointEnabled, so Terraform's
enable_http_endpoint and CDK's enableDataApi never read back what they
set.

Clusters now record the flag and report it. The two actions take the
cluster's ARN and raise ResourceNotFoundFault and
InvalidResourceStateFault as the model lists them; CreateDBCluster,
ModifyDBCluster and the AWS::RDS::DBCluster EnableHttpEndpoint property
set it too. Turning it on is refused for engines other than Aurora
PostgreSQL and Aurora MySQL. The Data API itself does not check the
flag, so existing callers keep working.

Closes #5732

* refactor(rds): one cluster ARN parser, and stricter Data API inputs

clusterForResourceArn repeated the ARN parsing, cluster: prefix and
account and Region check of clusterIdentifierFromArnOrName; both now
call clusterIdFromArn, each raising the error its API documents.

The Data API engine check takes aurora-postgresql, aurora-mysql and the
older aurora name exactly instead of any name starting with aurora, and
the AWS::RDS::DBCluster EnableHttpEndpoint property accepts true or
false only, so a malformed value fails instead of turning the endpoint
off.

* fix(rds): take only aurora-mysql and aurora-postgresql for the Data API

The API reference lists those two engines, and new clusters cannot carry
the bare aurora name, so the check no longer accepts it.
2026-10-15 16:49:23 -04:00
David Phillips 430af5fce7 fix(rds): keep Aurora member passwords owned by their cluster (#5685)
* fix(rds): keep Aurora passwords owned by the cluster

* test(rds): cover member changes across regions
2026-10-14 20:43:53 -04:00
David Phillips 92b2cf74f7 fix(rds): inherit Aurora member master credentials (#5667)
* fix(rds): inherit Aurora member master credentials

* fix(rds): retain defaults for incomplete cluster credentials

* test(rds): keep credential checks compatible with Java 17

* fix(rds): keep Aurora managed secrets on the cluster

* fix(rds): reject member credentials and publish offline changes

* fix(rds): match the member username error message

* fix(rds): release proxy listeners before reboot

* test(rds): shorten listener retirement failure checks
2026-10-14 19:31:42 -04:00
David ff32bae98c feat(rds): refuse role feature names the engine does not support (#5637)
* feat(rds): refuse role feature names the engine does not support

AddRoleToDBInstance, AddRoleToDBCluster and CreateDBCluster
AssociatedRoles stored any FeatureName, so Lambda on a MySQL instance
was accepted although MySQL supports no role features.

A FeatureName now has to be one the engine lists in
SupportedFeatureNames, matched without regard to case, or the call is
InvalidParameterValue; CreateDBCluster refuses before any cluster
exists. A cluster role with no feature, and an engine the catalogue
does not list, are left alone. Aurora PostgreSQL also lists Bedrock,
which the Aurora user guide offers next to Comprehend and SageMaker.

Closes #5631

* refactor(rds): keep the two-argument cluster role check

Callers that check an AssociatedRoles list without knowing the engine,
such as the CloudFormation provisioner in #5656, keep the signature they
compile against; it runs the same checks without the feature check.

* fix(rds): match feature names without regard to case in every role check

The supported-feature check matched without regard to case, but the
instance duplicate check and both removal lookups compared exactly, so
an instance could take s3Import and then s3import as two roles. All of
them now match the same way. The two-argument cluster role check, which
nothing here calls, is removed.
2026-10-14 16:59:28 -04:00
David Phillips 12c8f969af fix(rds): inherit cluster IAM settings for new members (#5653)
* fix(rds): inherit cluster IAM settings for new members

* fix(rds): keep new member authentication in step with cluster changes

* fix(rds): allow metadata reads during member creation

* fix(rds): keep member creation consistent with lifecycle changes

* fix(rds): preserve metadata access during instance reboot

* fix(rds): use one cluster state for member creation

* test(rds): check IAM authentication consistently
2026-10-14 13:36:57 -04:00
David Phillips 966da1d7fa fix(rds): apply Aurora IAM changes to existing members (#5608)
* fix(rds): apply Aurora IAM changes to existing members

* fix(rds): apply cluster settings to every stored member
2026-10-14 07:18:57 -04:00
David Phillips 2aca536bec fix(rds): use cluster IAM policies for Aurora members (#5605) 2026-10-13 21:51:57 -04:00
David 5e48cbb80b feat(rds): IAM role associations for DB clusters and instances (#5367)
* feat(rds): IAM role associations for DB clusters and instances

AddRoleToDBCluster, RemoveRoleFromDBCluster, AddRoleToDBInstance and
RemoveRoleFromDBInstance answered UnsupportedOperation, and DBCluster
and DBInstance carried no AssociatedRoles, so Terraform's
aws_rds_cluster_role_association and aws_db_instance_role_association
could not apply.

Clusters and instances now keep their associated roles and report them
as AssociatedRoles, ACTIVE as soon as they are added. The four actions
raise the faults the API model lists, and CreateDBCluster accepts
AssociatedRoles, checked before the cluster is created. Feature names
are not yet validated against the engine.

Closes #5343

* fix(rds): route the instance role actions, and refuse only a repeated cluster role

AddRoleToDBInstance and RemoveRoleFromDBInstance were missing from
RDS_ACTIONS, so a request with no credential scope reached SQS.

DBClusterRoleAlreadyExists covers the role ARN only, so a cluster now
takes a second role for a feature that already has one. Instances keep
refusing a repeated role or feature, as their fault documents.

CreateDBCluster reads every AssociatedRoles index, gaps included, and
refuses an entry without a RoleArn. It associates the roles in one step
and deletes the new cluster if that is refused.

* refactor(rds): import the types parseAssociatedRoles uses

The regex and sorted-set types were written with their packages inline;
AGENTS.md asks for imports. The role association compat test gains a
DisplayName like the others in its class.

* docs(rds): count the role association actions alongside the catalogue reads

#5196 and this branch each added four RDS actions, so the service matrix
count is 98.
2026-10-13 17:07:33 -04:00
David 890b8eca51 feat(rds): engine versions, engine defaults and valid modifications (#5196)
* feat(rds): engine versions, engine defaults and valid modifications

Serve DescribeDBEngineVersions, DescribeEngineDefaultParameters,
DescribeEngineDefaultClusterParameters and
DescribeValidDBInstanceModifications.

A curated engine catalogue lists one representative version per major
version Floci knows through its managed parameter and option groups.
Each version carries the parameter group family the create path computes
for it, its major version and its upgrade targets; each engine's default
is the version Floci creates when a request names none.
DescribeDBEngineVersions serves it with Engine, EngineVersion (exact or
major), DBParameterGroupFamily, DefaultOnly, the documented filters and
paging, and DescribeOrderableDBInstanceOptions now reads the same
catalogue.

The engine default calls check the family against the catalogue and
return an empty list, as Floci's default parameter groups hold no
parameters. DescribeValidDBInstanceModifications reports the instance's
storage type with a range from its current allocation to the engine's
maximum, and nothing for an Aurora instance.

Closes #5186

* feat(rds): one source for engine defaults, and engine version capabilities

Create paths, the cluster parameter group family check and global
clusters each kept their own default engine version, and Aurora MySQL's
disagreed with the catalogue: 8.0.36 against 8.0.mysql_aurora.3.05.2.
All four now read the catalogue's default, so a create that names no
version gets what DescribeDBEngineVersions reports with DefaultOnly.

DescribeDBEngineVersions and DescribeDBClusterEndpoints share one
offset paging helper and one MaxRecords check, which
DescribeEventSubscriptions also uses.

Each engine version now reports ExportableLogTypes,
SupportsLogExportsToCloudwatchLogs, SupportsReadReplica,
SupportedFeatureNames, SupportsParallelQuery, SupportsGlobalDatabases
and SupportsBabelfish, following what Floci supports.

* fix(rds): route the catalogue reads to RDS without a credential scope

DescribeDBEngineVersions, DescribeEngineDefaultParameters,
DescribeEngineDefaultClusterParameters and
DescribeValidDBInstanceModifications were missing from RDS_ACTIONS, so a
request with no credential scope reached SQS.
2026-10-13 10:25:21 -04:00
David Phillips 2927a4520e fix(rds): preserve credentials when managed-secret opt-out is refused (#5553)
* fix(rds): retain managed credentials while secret replicas exist

* fix(secretsmanager): keep released managed secrets deleted

* fix(secretsmanager): keep removed replicas from returning

* fix(rds): reject opt-out without Secrets Manager support

* fix(secretsmanager): keep unrelated secrets available during release
2026-10-13 09:31:41 -04:00
David Wooldridge e61b66fb22 fix(rds): load the token role's ALTER ROLE defaults into IAM sessions (#5344)
* fix(rds): load the token role's ALTER ROLE defaults into IAM sessions

* fix(rds): open IAM sessions with the role's defaults as startup options so RESET keeps them
2026-10-12 10:28:06 -04:00
David Phillips 03a0dfefdd fix(rds): honor restore IAM flags and reject malformed booleans (#5473)
* fix(rds): reject malformed restore flags

* fix(rds): disable IAM authentication by default on restore

* fix(rds): honor IAM settings on instance snapshot restore
2026-10-11 23:25:34 -04:00