Terraform実行時のデータの流れ AWS Lambda Amazon DynamoDB Amazon API Gateway Real World AWS Lambda Amazon DynamoDB Amazon API Gateway State ③read terraform.tfstate ⑤write
State管理ベストプラクティス1 S T A T E フ ァ イ ル は 必 ず リ モ ー ト 管 理 Remote State Local State 必ずリモート管理(≠git) S3を利用する • 以下S3のおすすめ設定 • Stateを配置するS3バケット自体を 同一Terraformで作成しない terraform.tfstate terraform.tfstate terraform.tfstate terraform.tfstate
State管理ベストプラクティス3 S T A T E フ ァ イ ル は 環 境 毎 に 分 け る terraform.tfstate Dev PreProd Prod terraform.tfstate Dev PreProd Prod terraform.tfstate terraform.tfstate • 「開発環境のstate rmしたは ずが誤って本番環境で作業して しまいました」などから守る