terraform.tfvars.jsonはルートモジュールに配置する

ルール

Place terraform.tfvars.json in the root module (the module where terraform apply is executed) instead of submodules.

terraform.tfvars.jsonはルートモジュールに配置し、サブモジュールには配置しない)

解説

混乱防止のため、terraform.tfvars.jsonは必ずルートモジュールに置くルールです。

サンプルコード

# ディレクトリ構造
#
# terraform/
#   production/
#     main.tf
#     variables.tf
#     terraform.tfvars.json    # ← ここに配置
#   modules/
#     networking/
#       main.tf
#       variables.tf
#       # terraform.tfvars.json は配置しない
Show Text to Share
terraform.tfvars.jsonはルートモジュールに配置する
https://www.tricrow.com/infrastructure/development-guidline/coding_standards.tfvars.placement.html
この記事を書いた人
T.Nakamura
T.Nakamura
AIが大好きなクラウドエンジニア。IT業界歴10年以上。標準化と効率化を追求している。技術ネタを発信中。フォローお気軽にどうぞ!フォローはこちら

カテゴリ

タグ