mirror of
https://github.com/Sea-Haven-Industries/procurement-ingest.git
synced 2026-09-30 17:43:14 +00:00
2 KiB
2 KiB
PLAT-86 CFN dispose runbook (import-in-place)
Prerequisites (already proven 2026-08-07):
- HCP workspace
procurement-ingest-prodManual apply green; verification plan 0/0/0 - Lambdas on
/tf-managed/roles - TF owns
aws_s3_bucket_notificationon both email buckets (*-inboundids) - Soft-freeze replaced by hard-cut (
.github/workflows/deploy.yamlremoved) - Smoke green for
po-email-processor,workorder-email-processor,procurement-api
Rule
Never run cfn-stack-decommission.sh --execute against these stacks. That script purges RETAIN orphans after delete. Here RETAIN orphans are the live TF-owned data plane.
Method
- Retain-all update — for each stack (
po-ingest,WorkorderIngestStack,procurement-api), setDeletionPolicy: RetainandUpdateReplacePolicy: Retainon every resource in the live template, thenupdate-stack. This includesCustom::S3BucketNotificationsso CFN will not invoke the emptyPutBucketNotificationConfigurationdelete handler. - Delete stack —
delete-stackafterUPDATE_COMPLETE. All resources leave CFN without destruction. - Verify immediately —
GetBucketNotificationConfigurationstill lists inbound Lambda triggers; SES receipt rules for PO/WO still present onINBOUND_MAIL; named Lambdas/tables/buckets still exist; smoke script green. - Sweep CDK helpers only — delete orphaned
*BucketNotificationsHandler*Lambda functions and their IAM roles/policies (both stacks). Do not delete TF-owned Lambdas, tables, buckets, API GW, SES rules, or SHOC secret/KMS. - Park
githubdeploy-procurement-ingestfor a separate IAM-reviewed cleanup (do not block dispose). Done (PLAT-88): role andinfra/deploy-role/removed.
Script
scripts/plat86-cfn-dispose.sh implements steps 1–4 with explicit confirms and post-checks.
Retain-all templates exceed the CloudFormation CLI 51KB inline --template-body limit, so the script stages them to s3://procurement-ingest-artifacts-011934824531/plat86-cfn-dispose/ and updates via --template-url.