Repository navigation
fix(cfn): retire the CloudFormation install stack - #1577
Conversation
The CloudFormation install stack (cloudformation/stacks/CUDly) still created six DynamoDB tables and passed their *_TABLE names to the Lambda, but set no DB_HOST and created no Postgres database. The server is Postgres-only, so initConfigStore failed at startup and the stack could not serve any request or scheduled task. Per the acting owner's decision, delete the stack instead of rebuilding it on Postgres, and remove every reference to it: the deployment guide, README, CONTRIBUTING, CLAUDE.md, the cfn-lint hook comment, the CI parity job comment, the AWS IAM parity script and its self-tests (the YAML bare "*" cases now inject into the federation cross-account CloudFormation template), the Lambda timeout helper, and the Terraform module tests that read it. Readers are pointed at the Terraform AWS install. The target-account role templates (cloudformation/stacks/CUDly-CrossAccount and iac/federation/**) are unchanged. New guards: no shipped IaC may provision a DynamoDB table, and no current file may point at the retired stack directory. Closes LeanerCloud#1432 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): VERDICT: APPROVE Blocking:
Non-blocking:
Attacked:
Body-stale:
Reviewer: rM1. Bar while the maintainers are away (set by IAmJSD as acting owner): one approving independent review on the head, two for money, auth and security paths. |
|
Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): VERDICT: APPROVE Blocking:
Non-blocking:
Attacked:
Body-stale:
Reviewer: rM2. Bar while the maintainers are away (set by IAmJSD as acting owner): one approving independent review on the head, two for money, auth and security paths. |
|
Local verification at |
|
Merged by IAmJSD's agent at IAmJSD's request (IAmJSD is acting owner while the maintainers are away), under the bar IAmJSD set: 2 approving independent review(s) on |
Root cause
cloudformation/stacks/CUDly/template.yamlwas written for the old DynamoDB backend. It still created sixAWS::DynamoDB::Tableresources and passedCONFIG_TABLE…SESSIONS_TABLEto the Lambda. It set noDB_HOSTand created no Postgres database, credentials secret or VPC access. The server is Postgres-only:initConfigStorereturnsdatabase configuration required: DB_HOST must be set. A stack deployed from this template therefore failed every request and every scheduled task.Fix (owner decision D29, option 2: retire the stack)
cloudformation/stacks/CUDly/(the whole template).docs/DEPLOYMENT.mdnow says there is no CloudFormation install, explains why, and points toterraform/environments/aws(Lambda or Fargate). The CloudFormation bullets in the cleanup and finalize-revocations schedule lists and the CloudFormation row in the cross-account table are gone.README.md,CONTRIBUTING.mdandCLAUDE.mddescribeterraform/as the only install path andcloudformation/,arm/andiac/as target-account role templates.CHANGELOG.mdhas a new Removed entry under Unreleased. The live status lines inknown_issues/33_executions_retention_cleanup.mdno longer list CloudFormation, and its CloudFormation bullet is struck through with a pointer to this issue, following the file's existing style.scripts/check-aws-iam-parity.sh: the runtime comparison is now TF Lambda vs TF Fargate. The CFN stack is removed from the required-actions and runtime-organizations loops.scripts/test-aws-iam-parity.sh: the stack is out of the fixture seed and out of cases 2, 11 and 16. The YAML bare-*cases (17, 18, 19, 24, 26, 28) inject intoiac/federation/aws-cross-account/cloudformation/template.yaml, which is read only and never edited. That file is in a parity group and has the same- Sid: CostExploreranchor at the same indentation, so the YAML parsing paths stay covered.terraform/modules/compute/scheduled_task_cfn_test.go: deleted. It only tested this template.scheduled_task_coverage_test.go: thecloudformationplatform is gone, along with the CFN-onlycfnRulescope, the"action":Input-JSON pattern and the two CFN negative cases. No.tffile uses that JSON form; I checked with grep.function_url_cors_test.go: the CFN test is removed.runtime_iam_coverage_test.goandcross_account_sts_guard_test.go: the stack is removed from the file and site lists.internal/testutil/lambdatimeout: the CFNTimeoutcheck is removed..pre-commit-config.yamland theaws-iam-parityjob comment inci.yml. The hook'sfiles:pattern and the job name are unchanged. The pattern still coversCUDly-CrossAccountand the federation templates.terraform/modules/compute/aws/retired_cfn_stack_test.go:TestNoIaCProvisionsDynamoDBwalksterraform/,cloudformation/,iac/,arm/andinternal/iacfiles/templates/. It fails on anyAWS::DynamoDB::Tableoraws_dynamodb_table, and on a root where it read no files.TestRetiredCloudFormationStackIsNotReferencedfails if the directory comes back or if any current file (all files outsidefrontend/,docs/audits/,known_issues/andCHANGELOG.md) namescloudformation/stacks/CUDly.CUDly-CrossAccountpaths do not match.Closes #1432
Verification
Unit, script and fixture evidence only. Nothing was deployed and no
terraform planorapplywas run.Fail-before: the new guard file, copied into a clean
origin/main(3ec21a0) worktree:Pass-after on this branch: both tests
PASS.Commands run on this branch (with
AWS_CONFIG_FILE=/dev/null AWS_SHARED_CREDENTIALS_FILE=/dev/null AWS_EC2_METADATA_DISABLED=true):go build ./...,go vet ./...,go vet -tags integration ./...: clean.go test -count=1 ./terraform/modules/compute/...: ok (compute, aws, azure, gcp).go test -count=1 -run TestLambdaTimeoutCovers ./internal/api/ ./internal/purchase/: all threelambdatimeoutconsumers pass.go test -count=1 ./internal/mocks/ ./internal/iacfiles/ ./iac/: ok.golangci-lint run --allow-parallel-runners ./terraform/modules/compute/... ./internal/testutil/lambdatimeout/(v2.10.1): 0 issues.gocyclo -over 10 -ignore "_test\.go" internal/testutil/lambdatimeout/lambdatimeout.go: clean.bash scripts/check-aws-iam-parity.sh: OK.bash scripts/test-aws-iam-parity.sh: 28 passed, 0 failed.bare_star_actiondisabled (END { }), cases 14, 17, 18, 19, 20, 21, 22, 23 and 28 fail as expected (19 passed, 9 failed), so the YAML cases still exercise the extractor.shellcheckon both parity scripts andactionlint .github/workflows/ci.yml: clean.pre-commit runfor cfn-lint (onCUDly-CrossAccountand both federation templates; only the known W3005 warning), markdownlint, check-yaml, trailing-whitespace, end-of-file-fixer, go-mod-tidy and check-merge-conflict on the changed files: all pass.Combined-tree verification. Tested on a local, never-pushed tree:
queue/platform@40dbbdaf= origin/main6e2033cdplus:Linux, Go 1.26.9,
AWS_CONFIG_FILE=/dev/null AWS_SHARED_CREDENTIALS_FILE=/dev/null AWS_EC2_METADATA_DISABLED=true; Docker Postgres via testcontainers.go build ./...,go vet ./...,go vet -tags integration ./...and the fullgo test -race -short -count=1 ./....--build-tags integration.gocyclo -over 10is silent on the changed non-test files.-tags integration -count=1, one package at a time):internal/api,internal/database/postgres/migrations,internal/purchaseandinternal/serverpass.internal/confighad one failure, which comes from the fix(marketplace): close RI Marketplace poller gaps (pending rows with a listing id, superseded listings, deployment coverage) #1494 branch (a mid-claim listing gets settled); that branch is being fixed and isn't opened yet.scripts/test-git-secrets-allowlist.shpasses.Out of scope / left as is
iac/federation/*/cloudformation/,internal/iacfiles/templates/*cfn*,handler_federation) are unchanged.cloudformation/stacks/CUDly-CrossAccount/template.yamlstays. It is a target-account role, not an install. ItsPrimaryRoleNamedefault (CUDly-LambdaRole) and description still assume a hub deployed from the retired stack under the name "CUDly". Terraform users already have to override it. Changing the default is a behavior change for existing users of that template, so it is left for a follow-up.cross_account_sts_guard_test.gostill acceptsCrossAccountTargetAccountIdsinaccountSourceRefsand still walkscloudformation/stacks/. That keeps the guard working for YAML if a grant ever shows up there again.docs/audits/), the older known-issues entries and the existing CHANGELOG Notices still mention the stack as it was, on purpose.Maintainer: please mirror the issue's triage labels onto this PR:
priority/p2,severity/high,urgency/this-quarter,impact/few,effort/l,type/bug,triaged. The issue also carriesstatus/needs-info. The owner decision now answers it, so that label can come off the issue.🤖 Generated with Claude Code