Difference between revisions of "Terraform backends"
Jump to navigation
Jump to search
↑ https://www.terraform.io/docs/language/settings/backends/s3.html#key
Line 63: | Line 63: | ||
== See also == | == See also == | ||
* {{Terraform backends}} | * {{Terraform backends}} | ||
− | |||
[[Category:Terraform]] | [[Category:Terraform]] |
Revision as of 07:21, 20 September 2022
https://www.terraform.io/language/settings/backends
https://www.terraform.io/language/settings/backends/configuration#available-backends
- Terraform S3 backend
- Terraform S3 backend: dynamodb table
- gcs
- local
- consul
- remote
- COS: Tencent Cloud Object Storage (COS)
- Kubernetes
- pg (PostgreSQL)
- azurerm
Deprecated:
https://www.terraform.io/language/settings/backends/s3
S3 Example with DynamoDB
terraform { backend "s3" { bucket = "your-terraform-states" key[1] = "terraform.tfstate" 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
terraform workspace
terraform state [pull | push]
AWS_PROFILE
profile
https://www.terraform.io/docs/language/settings/backends/s3.html#profileaws s3api create-bucket
andaws s3 mb
- Terraform providers:
provider.tf
- Terraform Associate: Handle backend authentication methods
local
backend- Workspaces and locking
- Remote state backends to manage Terraform state
Terraform has been successfully initialized!
See also
Advertising: