Cloud Build substitutions による環境別設定の管理
Terraform
インフラ
Cloud Build
知識
運用
置換変数を使用した環境別設定の管理方法:
yaml
substitutions:
_SERVICE_NAME: paput-front
_REGION: asia-northeast1
_ENV: dev
_NODE_ENV: production
_NEXT_PUBLIC_BASE_URL: https://dev.paput.example.com
_NEXT_PUBLIC_BASE_API_URL: https://api-dev.paput.example.com
_NEXT_PUBLIC_GOOGLE_CLIENT_ID: your-google-client-id
_NEXT_PUBLIC_GOOGLE_REDIRECT_URI: https://dev.paput.example.com/api/auth/callback/googleこれらのデフォルト値は Terraform から環境に応じて上書きされる。 変数名は _ (アンダースコア) で始まる規則を使用。