Directory Structure

1 件の記事

ルール

  • Infrastructure directory structure:
infrastructure/
  scripts/
  terraform/
    development/
    production/
    modules/
      <module_name>/

(インフラストラクチャのディレクトリ構造を定めておく)

解説

ディレクトリ構造はあらかじめ定めておきます。露骨な言い方をすると、生成AIにディレクトリ構造を決めさせてはいけません。

生成AIはランダムな結果を返すものですから、なんのルールもないと、法則も設計もないディレクトリ構造を作成します。ランダムなので法則がなく、したがって理解しようもないディレクトリ構造は、運用を困難にします。

サンプルコード

infrastructure/
  scripts/
    deploy.sh
  terraform/
    development/
      main.tf
      variables.tf
      outputs.tf
      terraform.tfvars.json
    production/
      main.tf
      variables.tf
      outputs.tf
      terraform.tfvars.json
    modules/
      networking/
        main.tf
        variables.tf
        outputs.tf
      database/
        main.tf
        variables.tf
        outputs.tf
      compute/
        main.tf
        variables.tf
        outputs.tf

参考リンク

備考

infrastructure/
  scripts/
  terraform/
    development/
    production/
    modules/
      <module_name>/