Difference between revisions of "Terraform backends"

From wikieduonline
Jump to navigation Jump to search
 
(33 intermediate revisions by 6 users not shown)
Line 2: Line 2:
 
* <code>[[backend.tf]]</code>
 
* <code>[[backend.tf]]</code>
  
* [[Terraform S3 backend]]
+
== Backends ==
* [[Terraform S3 backend: dynamodb table]]
+
https://www.terraform.io/language/settings/backends/configuration#available-backends
* [[artifactory]]
+
* [[Terraform S3 backend]] <ref>https://www.terraform.io/language/settings/backends/s3
* [[local]]
+
</ref>: <code>[[bucket]]</code>
 +
* [[Terraform S3 backend: dynamodb_table]]: <code>[[key]]</code>
 +
* <code>[[gcs]]</code>
 +
* [[Terraform local backend|local]]
 +
* <code>[[Terraform backend: remote|remote]]</code>
 
* [[consul]]
 
* [[consul]]
* [[remote]]
 
 
* [[COS]]: [[Tencent Cloud Object Storage (COS)]]
 
* [[COS]]: [[Tencent Cloud Object Storage (COS)]]
 
* [[Kubernetes]]
 
* [[Kubernetes]]
* [[Manta]]
 
 
* [[pg]] ([[PostgreSQL]])
 
* [[pg]] ([[PostgreSQL]])
 +
* [[azurerm]]
  
https://www.terraform.io/language/settings/backends/s3
+
* [[Remote state backends to manage Terraform state]]
  
== [[Terraform S3 backend|S3]] Example with [[DynamoDB]] ==
+
=== Deprecated ===  
terraform {
+
* [[artifactory]]  
  backend "s3" {
+
* [[etcd]]  
    [[bucket]] = "your-terraform-states"
+
* [[Manta]]
    [[key]]<ref>https://www.terraform.io/docs/language/settings/backends/s3.html#key</ref>    = "[[terraform.tfstate]]"
+
* [[swift]]
    region = "[[us-west-2]]"
 
    [[dynamodb_table]] = "your-terraform-states"
 
    [[profile]] = "your-profile"
 
    [[workspace_key_prefix]] = "your-workspace"
 
  }
 
}
 
 
 
Example using variables:
 
terraform {
 
  backend "s3" {
 
    bucket        =  "$(aws-backend-bucket)"
 
    key            =  "yourkeyname/$(AWS_ACCOUNTNAME)/$(AWS_MYREGION)"
 
    region        =  "$(AWS_MYREGION)"
 
    dynamodb_table =  "$(aws-backend-dynamoDbTable)"
 
    encrypt        =  true
 
    [[role_arn]]       =  "$(aws-cicd-role-arn)"
 
  }
 
}
 
  
 
== Related terms ==
 
== Related terms ==
 
* <code>[[terraform workspace]]</code>
 
* <code>[[terraform workspace]]</code>
 +
* [[Terraform providers]]: <code>[[provider.tf]]</code>
 
* <code>[[terraform state]] [pull | push]</code>
 
* <code>[[terraform state]] [pull | push]</code>
 
* <code>[[AWS_PROFILE]]</code>
 
* <code>[[AWS_PROFILE]]</code>
* <code>[[profile]]</code> https://www.terraform.io/docs/language/settings/backends/s3.html#profile
+
* [[Terraform S3 backend]]: <code>[[profile]]</code> https://www.terraform.io/docs/language/settings/backends/s3.html#profile
* <code>[[aws s3api create-bucket]]</code> and <code>[[aws s3 mb]]</code>
 
* [[Terraform providers]]: <code>[[provider.tf]]</code>
 
 
* [[Terraform Associate]]: Handle backend [[authentication methods]]
 
* [[Terraform Associate]]: Handle backend [[authentication methods]]
 
* <code>[[local]]</code> backend
 
* <code>[[local]]</code> backend
* [[Workspace]] and [[locking]]
+
* [[Workspaces]] and [[locking]]
 +
* <code>[[Terraform has been successfully initialized!]]</code>
 +
* <code>[[terraform init -backend-config]]</code>
 +
* <code>[[.terraform]]</code>
 +
 
 +
== Errors ==
 +
* <code>[[Error: Backend configuration changed]]</code>
  
 
== See also ==
 
== See also ==
 
* {{Terraform backends}}
 
* {{Terraform backends}}
* {{Terraform}}
+
* {{HCP}}
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]

Latest revision as of 15:52, 10 July 2024

Advertising: