stage safe bootstrap - #366
Merged
Merged
Conversation
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.
Description
Safety layers for the first stage ECS deployment. Ensures zero tasks run and zero database writes are possible on
pulumi up, even if individual layers fail.Safety is achieved even if CI pushes a new image: desired counts remain 0, autoscaling suspended, schedules disabled.
Safety layers
desired_count: 0on all 3 servicessuspend: true,min_capacity: 0on all 3 servicesDISABLEDBOOTSTRAP_SAFE=trueuses RO DB secret (atn/stage/mysql_ro); missing secret fails fast rather than falling back to RWFiles changed (4)
infra/pulumi/config.stage.yamldesired_count: 0,suspend: true,min_capacity: 0,BOOTSTRAP_SAFE=trueenv var on all services,force_delete: falseon ECRinfra/pulumi/__main__.pyDISABLED, cron task definition usessettings_local_stage,BOOTSTRAP_SAFE=truesettings_local_stage.pyBOOTSTRAP_SAFEtoggle: picksatn/stage/mysql_rowhen true, sets DjangoREAD_ONLY.gitignorepreview-*.txtpatternPulumi state imports (not in code -- cloud side state only)
The following AWS resources were imported into the Pulumi stack so the ECR publishing path (OIDC role, policy, and repo) is managed declaratively:
atn-stage-addons-server(imported under Pulumi resourcethunderbird-addons-stage-addons-server)thunderbird-addons-stage-gha-ecr-publish(imported under Pulumi resourcethunderbird-addons-stage-gha-ecr-publish)addons-stage-ci-ecr-push(imported under Pulumi resourcethunderbird-addons-stage-gha-ecr-push-policy)thunderbird-addons-stage-gha-ecr-policy-attachment)On next
pulumi up, Pulumi will normalise these resources (ECR IMMUTABLE -> MUTABLE, trust policy hardening withjob_workflow_ref, tag standardisation) -- confirmed inpulumi previewoutput.Scale-up sequence (after deploy)
min_capacity: 1(read-heavy, safest first)Only after prerequisites are met and we explicitly flip desired counts/schedules.
Prerequisites before scaling services above 0
atn_stage_ro@10.100.%with SELECT only) -- request madeatn/stage/mysql_rosecret in Secrets Manager with RO credentialsChecklist
pulumi previewpasses with all safety layers verified)