Difference between revisions of "Remote state backends to manage Terraform state"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
<pre>
+
# stage/frontend-app/main.tf
# stage/frontend-app/main.tf
+
terraform {
terraform {
+
  [[backend]] "s3" {
  backend "s3" {
+
    bucket        = "my-terraform-state"
    bucket        = "my-terraform-state"
+
    key            = "stage/frontend-app/terraform.tfstate"
    key            = "stage/frontend-app/terraform.tfstate"
+
    region        = "us-east-1"
    region        = "us-east-1"
+
    encrypt        = true
    encrypt        = true
+
    dynamodb_table = "my-lock-table"
    dynamodb_table = "my-lock-table"
+
  }
  }
+
}
}
 
</pre>
 
  
  

Revision as of 09:31, 14 September 2021

Advertising: