feat(aws): storage.backup — aws-backup port (plan/vault/selection) - #154
Open
so0k wants to merge 2 commits into
Open
feat(aws): storage.backup — aws-backup port (plan/vault/selection)#154so0k wants to merge 2 commits into
so0k wants to merge 2 commits into
Conversation
Full file-for-file port of aws-cdk-lib/aws-backup into the storage.backup sub-namespace: BackupPlan (+ static retention factories), BackupPlanRule, BackupResource, BackupSelection, BackupVault, backupable-resources-collector. - plan.ts: rule blocks fed via Lazy.anyValue mapping the addRule() accumulator through backupPlanRuleToTerraform at synth (4th block-typed-Lazy footgun instance — table.ts GSI idiom; regression test proves post-construction addRule() lands in synthesized JSON), omitEmptyArray per house idiom - vault.ts: accessPolicy/notifications/lockConfiguration split onto standalone aws_backup_vault_policy / _notifications / _lock_configuration resources (provider 6.x shape — documented deviations); encryptionKey → kms_key_arn - rule.ts: events.Schedule → notify.Schedule; upstream validation set verbatim - resource.ts: fromDynamoDbTable/fromRdsDatabaseInstance/fromRdsDatabaseCluster/ fromRdsServerlessCluster/fromEc2Instance/fromTag/fromArn/fromConstruct; fromEfsFileSystem TODO-omitted (EFS not ported) - collector adapted from Cfn resource types to TerraformResource types via Aspects; unported types TODO-omitted, none silently dropped - 59 unit tests across plan/vault/selection suites
…oDB table Real BackupVault (force_destroy) + BackupPlan with the daily static-factory rule AND a weekly rule added after construction (live proof of the Lazy.anyValue rule-block design) + BackupSelection over the table ARN and a stage=prod tag condition. Read-backs: GetBackupPlan rules with per-rule retention (Daily 35d / Weekly 90d), DescribeBackupVault, GetBackupSelection resources/tags/role, post-apply drift oracle. Adds aws-sdk-go-v2/service/backup v1.60.0.
Contributor
Author
Live integ 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 11 —
storage.backup: the aws-backup port (v2.263.0)Stacked on #153. The database-backup-management slice: BackupPlan (+ all four static retention factories), BackupPlanRule, BackupResource, BackupSelection, BackupVault, backupable-resources-collector — 59 unit tests across the three upstream suites. Stable
aws-cdk-libmodule (not alpha), so no churn tracker.Mapping notes
aws_backup_plan.ruleis block-typed andaddRule()accumulates rules after construction. The port feedsruleaLazy.anyValuethat maps the accumulator through the provider's ownbackupPlanRuleToTerraformrenderer at synth (thetable.tsGSI idiom), so nested tokens resolve. A dedicated regression test proves a rule added post-construction (with a Lazy-wrappeddeleteAfter) lands in the synthesized JSON — and the live integ proves it against AWS.accessPolicy→ standaloneaws_backup_vault_policy, notifications →aws_backup_vault_notifications,lockConfiguration→aws_backup_vault_lock_configuration. All three documented deviations;blockRecoveryPointDeletion()statement fidelity preserved.encryptionKey→kms_key_arn(id-vs-ARN audit pre-applied).removalPolicy→ Terraform-nativeforceDestroy.TerraformResourcetypes via Aspects (cdktnAspects.add()has no priority arg — documented); every upstream type is mapped or TODO-omitted with a permalink, none silently dropped. EFS (fromEfsFileSystem+ collector match) TODO-omitted — EFS is not ported yet.events.Schedule→ this repo'snotify.Schedule; upstream's full validation set (cold-storage/retention/continuousBackup constraints) verbatim; Durations → provider day/minute numbers per upstream conversion rules.fromRdsDatabaseCluster/fromRdsServerlessClusteruseclusterArndirectly (renders byte-identical to upstream's hand-builtformatArn— documented).Live integ (
make backup.plan) — receipts in threadReal BackupVault + BackupPlan + BackupSelection over a DynamoDB table:
GetBackupPlanreads back both rules —Daily(35d, constructor path) andWeekly(90d, added viaaddRule()after construction — the Lazy rule-block design live-proven), per-rule retention asserted; selection carries the table ARN +stage=prodtag condition + IAM role; drift oracle; clean destroy.