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

オープン
#1,618 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
aws, python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
0
フォーク
4
平均マージ
5時間 19分
マージ済み PR(30日)
503

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Controlvar/controlvar のほかの issue

Controlvar/controlvar の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。