docs(infra): 踏み台越し migration の手順を実地に合わせる - #111
Closed
yook11 wants to merge 1 commit into
Closed
Conversation
RDS 移行後に 2 点ズレていた。 TLS: 手順 4/5 の URL が host=127.0.0.1 だった。sslmode を省くと asyncpg 既定の prefer に落ち、検証なしの TLS で繋がる (rds.force_ssl は満たすので気づけない)。 sslmode=require を付けると db_ssl が verify-full に格上げするため CN 不一致で 落ちる。hosts で RDS のホスト名を 127.0.0.1 へ向け、名前解決で解く形に直す。 db_ssl が「検証なし TLS は持たない」と宣言している以上、抜け道は手順書に残さない。 profile: 踏み台の生成・接続・撤去はいずれも admin が要る。role に boundary を 付けられず (boundary が ssmmessages:* を Deny)、boundary 無しの role 作成は terraform-apply が拒否する。ssm:StartSession も持たない。bastion.tf の注記には あるが手順書側に無く、deploy 用 profile で試して 3 回失敗した。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Owner
Author
|
運用手順を公開 README に厚く書き足す方向だったため取り下げる。Public Repository Hygiene に沿って private runbook へ移す形に作り直した (後継 PR)。 |
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.
背景
本番へ z10 / z11 を適用する作業で、
infra/aws/README.mdの記述が現状と 2 点ズレていることが分かった。どちらも RDS 移行後に生じたもので、実際に手が止まった箇所。1. TLS の指定
手順 4 / 5 の URL が
host=127.0.0.1になっていた。この形は 2 つの経路のどちらも塞がっている。sslmodeを省く → asyncpg 既定のpreferに落ちる。preferはcheck_hostname=False/verify_mode=CERT_NONEなので、検証なしの TLS で接続が成立する。rds.force_ssl=1は満たすため気づけないsslmode=requireを付ける →db_ssl.pyが require を verify-full に格上げするため、CN 不一致で落ちるdb_ssl.pyは「検証なし TLS というモードは持たない」と宣言している (sslmode抜きの ssl 系 param をValueErrorで弾く設計) ので、その抜け道を手順書に残さない。hosts で RDS のホスト名を 127.0.0.1 へ向け、名前解決で解く形に直した。あわせて「libpq は host / hostaddr の分離指定で保てるが、asyncpg / pg にその分離は無い」を明記した。psql と backend で解き方が違うことが読み取れなかったのが元の混乱の原因。
2. 踏み台に使う権限
「生やす / 繋ぐ / 消す」の 3 つはいずれも admin が要るが、手順書に profile の記載が無かった。deploy 用の profile で試して 3 回失敗した。
理由は
bastion.tfの注記のとおりで、ssmmessages:*を Deny)terraform-apply側のDenyRoleCreationWithoutBoundaryが拒否するssm:StartSessionもterraform-applyは持たない踏み台が admin 専用なのは設計であって権限不足ではない、と読める形で手順書側にも書いた。
公開範囲
実 endpoint 名は
<RDS endpoint>の placeholder のまま。アカウント ID・ホスト名・実 profile 値は含まない。🤖 Generated with Claude Code