Loading...
Loading...
Configure Azure Storage, S3, or Terraform Cloud for remote state
Remote state enables team collaboration with locking:
Azure Storage:
terraform {
backend "azurerm" {
storage_account_name = "mytfstate"
container_name = "tfstate"
key = "prod.tfstate"
}
}S3 with DynamoDB locking:
terraform {
backend "s3" {
bucket = "my-tfstate-bucket"
key = "prod/tfstate"
region = "us-east-1"
dynamodb_table = "terraform-locks"
encrypt = true
}
}terraform {
backend "s3" {
bucket = "my-tfstate-bucket"
key = "prod/main.tfstate"
region = "us-east-1"
dynamodb_table = "terraform-locks"
encrypt = true
}
}