浏览代码

Cant use variables in backend

Fred Damstra (Macbook 2015) 2 年之前
父节点
当前提交
cd4a356241
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 2 1
      backend.tf
  2. 1 1
      config.tf

+ 2 - 1
backend.tf

@@ -1,7 +1,8 @@
 terraform {
   backend "s3" {
     bucket  = "terraform-remote-state-20221017144428493300000001"
-    key     = local.unique_id
+    # Key must be unique amongst all projects that use this backend
+    key     = REPLACE ME WITH SOMETHING UNIQUE
     region  = "us-east-2"
     encrypt = true
     profile = "default"

+ 1 - 1
config.tf

@@ -1,5 +1,5 @@
 locals {
-  # unique id is used for terraform backend state storage. Duplicates _will_ be a problem.
+  # I like unique id to match the terraform backend storage, and I use it for various names and prefixes..
   unique_id = REPLACE ME
 
   # Everything here should be self-explanatory