feat(aws): storage.rds DatabaseInstance — instance.ts + attach() protocol [stacked on #146] - #147
Open
so0k wants to merge 1 commit into
Open
feat(aws): storage.rds DatabaseInstance — instance.ts + attach() protocol [stacked on #146]#147so0k wants to merge 1 commit into
so0k wants to merge 1 commit into
Conversation
RDS PR 2c: DatabaseInstance / DatabaseInstanceFromSnapshot / DatabaseInstanceReadReplica with full upstream test suite (398 rds tests). attach() protocol reference implementation on DatabaseInstanceBase (engine/host/port/dbname/dbInstanceIdentifier — CFN SecretTargetAttachment parity; port intentionally a JSON number as CFN writes it). Secret._generatedPassword internal getter feeds the SAME random-password token into aws_db_instance.password and the secret version, both frozen via accumulated lifecycle.ignore_changes. removalPolicy → skipFinalSnapshot/ finalSnapshotIdentifier/deletionProtection with synth-time Annotations warning (provider default fails destroy). fromLookup + Credentials.fromSecret TODO-omitted. Live integ rds.instance: real Postgres 16 db.t3.micro.
Contributor
Author
Live apply/verify/destroy receipts —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Storage slice PR 4/N —
storage.rdsDatabaseInstance (v2.263.0)Stacked on #146. Lands
instance.ts(the 1,708-LOC upstream file) with the full ported test suite:DatabaseInstance,DatabaseInstanceFromSnapshot,DatabaseInstanceReadReplica, plusinstance-from-snapshottests — 398 rds-suite tests green.The attach() protocol ships for real
DatabaseInstanceBasenow implementsISecretAttachmentTargetproperly — the reference implementation replacing the TEST-ONLY adapters ininteg/aws/encryption/apps/*.asSecretAttachmentTarget()contributesengine/host/port/dbInstanceIdentifier(+dbnamefromDatabaseInstanceSource) as connectionFields thatSecret.attach()merges into the secret value — includingdbInstanceIdentifierfor CloudFormationSecretTargetAttachmentparity.encryption/secret.ts's interface docs updated to point at it.Key deviations (all documented in-code)
secretValueFromJson('password').unsafeUnwrap()), which has no Terraform equivalent. HereSecret._generatedPassword(new@internalgetter) surfaces the sameaws_secretsmanager_random_passwordtoken so the instance'spasswordargument and the stored secret can never diverge — and both sides freeze it (lifecycle.ignore_changesonpassword+secret_string; single accumulated list per resource, mirroringSecret.toTerraform()).skipFinalSnapshot/finalSnapshotIdentifier/deletionProtectionprops. The provider default (skip_final_snapshot: falsewith no identifier) makesterraform destroyfail at apply time — unlike CFN, which auto-names the snapshot — so the constructor emits a synth-timeAnnotationswarning when neither prop is set.manageMasterUserPassword:instance.secretis aSecret.fromSecretAttributeswrapper over the RDS-managedmaster_user_secretcomputed block;grantRead()renders the IAM statement +kms:Decryptwith thekms:ViaServicecondition (fully asserted in tests).Credentials.fromSecret(existing-secret credentials) is TODO-omitted (needssecretValueFromJson); hand-builtCredentialsliterals with asecretare rejected with aValidationErrorrather than silently deploying an unset password.fromLookup(ContextProvider) TODO-omitted; Lambda-backed per-export log retention TODO-omitted (nativeenabled_cloudwatch_logs_exportsis wired).Verification
db-instanceconfig (everyDatabaseInstancePropsmember maps, throws, or is TODO-commented — audited by gates and the adversarial verifier; spot-checks included sentinel-default and token-in-string hazard classes).make rds.instance): a real Postgres 16db.t3.microdeployed through the L2 in an isolated VPC withCredentials.fromGeneratedSecret— validates instance read-back (status/engine/class/endpoint), the attached secret's merged connection fields includingdbInstanceIdentifier, the post-apply drift oracle (proving the doubleignore_changesdesign), and clean destroy viaskipFinalSnapshot. Receipts in thread.