fix(infra): cdk destroy of the Fargate stack fails when the last blue/green deploy left green live

Aperta
#1,618 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
aws, python

Direzione di ricerca

Start in infrastructure/cdk/stacks/fargate_service_stack.py, where the listener rules (https_listener.add_target_groups(...)) and the TestListener are defined, and check which target groups each one depends on. Make every rule and the TestListener depend on both blue and green target groups using node.add_dependency, then add a synth test that asserts the DependsOn entries. Done when cdk synth shows the dependencies and the docs/self-hosting/cdk.md 'Tearing an environment down' section covers the interim workaround.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

cdk destroy experimentation-fargate-<env> fails with DELETE_FAILED on the green target group ("target group ... is currently in use by a listener") whenever the last blue/green deployment left the live listener rules pointing at green.

Why: CodeDeploy's blue/green deployment moves the HTTPS listener's rules between the blue and green target groups outside CloudFormation. After an odd number of deployments the rules point at green, while the template still describes the rules the stack created. In infrastructure/cdk/stacks/fargate_service_stack.py neither the listener rules (https_listener.add_target_groups(...)) nor the TestListener declare a dependency on both target groups (there is no add_dependency / DependsOn between them), so CloudFormation may delete the green target group before the rules and the listener that still use it. The rest of the stack is deleted; a second cdk destroy then succeeds. This is deterministic, not a race.

Expected: cdk destroy succeeds in one run whatever target group is live.

Fix: make every listener rule and the TestListener depend on BOTH target groups (node.add_dependency on each), so CloudFormation deletes the rules and listeners before either target group; pin it with a synth test that asserts the DependsOn entries. Until it ships, docs/self-hosting/cdk.md's "Tearing an environment down" section should say: if the Fargate stack's delete fails with "in use by a listener", run cdk destroy for that stack again.

Found while tearing down a test environment. Priority is set in the pre-launch bug triage.

Lingua principale
Python
Stelle
0
Fork
4
Merge medio
5h 19m
PR unite (30g)
503

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Controlvar/controlvar

Tutte le issue di Controlvar/controlvar

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.