github.com/kcburge/terraform@v0.11.12-beta1/website/docs/backends/types/swift.html.md (about) 1 --- 2 layout: "backend-types" 3 page_title: "Backend Type: swift" 4 sidebar_current: "docs-backends-types-standard-swift" 5 description: |- 6 Terraform can store state remotely in Swift. 7 --- 8 9 # swift 10 11 **Kind: Standard (with no locking)** 12 13 Stores the state as an artifact in [Swift](http://docs.openstack.org/developer/swift/latest/). 14 15 ~> Warning! It is highly recommended that you enable [Object Versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) by setting the [`archive_container`](https://www.terraform.io/docs/backends/types/swift.html#archive_container) configuration. This allows for state recovery in the case of accidental deletions and human error. 16 17 ## Example Configuration 18 19 ```hcl 20 terraform { 21 backend "swift" { 22 container = "terraform-state" 23 archive_container = "terraform-state-archive" 24 } 25 } 26 ``` 27 This will create a container called `terraform-state` and an object within that container called `tfstate.tf`. It will enable versioning using the `terraform-state-archive` container to contain the older version. 28 29 -> Note: Currently, the object name is statically defined as 'tfstate.tf'. Therefore Swift [pseudo-folders](https://docs.openstack.org/user-guide/cli-swift-pseudo-hierarchical-folders-directories.html) are not currently supported. 30 31 For the access credentials we recommend using a 32 [partial configuration](/docs/backends/config.html). 33 34 ## Example Referencing 35 36 ```hcl 37 data "terraform_remote_state" "foo" { 38 backend = "swift" 39 config = { 40 container = "terraform_state" 41 archive_container = "terraform_state-archive" 42 } 43 } 44 ``` 45 46 ## Configuration variables 47 48 The following configuration options are supported: 49 50 * `auth_url` - (Required) The Identity authentication URL. If omitted, the 51 `OS_AUTH_URL` environment variable is used. 52 53 * `container` - (Required) The name of the container to create for storing 54 the Terraform state file. 55 56 * `path` - (Optional) DEPRECATED: Use `container` instead. 57 The name of the container to create in order to store the state file. 58 59 * `user_name` - (Optional) The Username to login with. If omitted, the 60 `OS_USERNAME` environment variable is used. 61 62 * `user_id` - (Optional) The User ID to login with. If omitted, the 63 `OS_USER_ID` environment variable is used. 64 65 * `password` - (Optional) The Password to login with. If omitted, the 66 `OS_PASSWORD` environment variable is used. 67 68 * `token` - (Optional) Access token to login with instead of user and password. 69 If omitted, the `OS_AUTH_TOKEN` variable is used. 70 71 * `region_name` (Required) - The region in which to store `terraform.tfstate`. If 72 omitted, the `OS_REGION_NAME` environment variable is used. 73 74 * `tenant_id` (Optional) The ID of the Tenant (Identity v2) or Project 75 (Identity v3) to login with. If omitted, the `OS_TENANT_ID` or 76 `OS_PROJECT_ID` environment variables are used. 77 78 * `tenant_name` - (Optional) The Name of the Tenant (Identity v2) or Project 79 (Identity v3) to login with. If omitted, the `OS_TENANT_NAME` or 80 `OS_PROJECT_NAME` environment variable are used. 81 82 * `domain_id` - (Optional) The ID of the Domain to scope to (Identity v3). If 83 omitted, the following environment variables are checked (in this order): 84 `OS_USER_DOMAIN_ID`, `OS_PROJECT_DOMAIN_ID`, `OS_DOMAIN_ID`. 85 86 * `domain_name` - (Optional) The Name of the Domain to scope to (Identity v3). 87 If omitted, the following environment variables are checked (in this order): 88 `OS_USER_DOMAIN_NAME`, `OS_PROJECT_DOMAIN_NAME`, `OS_DOMAIN_NAME`, 89 `DEFAULT_DOMAIN`. 90 91 * `insecure` - (Optional) Trust self-signed SSL certificates. If omitted, the 92 `OS_INSECURE` environment variable is used. 93 94 * `cacert_file` - (Optional) Specify a custom CA certificate when communicating 95 over SSL. If omitted, the `OS_CACERT` environment variable is used. 96 97 * `cert` - (Optional) Specify client certificate file for SSL client authentication. 98 If omitted the `OS_CERT` environment variable is used. 99 100 * `key` - (Optional) Specify client private key file for SSL client authentication. 101 If omitted the `OS_KEY` environment variable is used. 102 103 * `archive_container` - (Optional) The container to create to store archived copies 104 of the Terraform state file. If specified, Swift [object versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) is enabled on the container created at `container`. 105 106 * `archive_path` - (Optional) DEPRECATED: Use `archive_container` instead. 107 The path to store archived copied of `terraform.tfstate`. If specified, 108 Swift [object versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) is enabled on the container created at `path`. 109 110 * `expire_after` - (Optional) How long should the `terraform.tfstate` created at `container` 111 be retained for? If specified, Swift [expiring object support](https://docs.openstack.org/developer/swift/latest/overview_expiring_objects.html) is enabled on the state. Supported durations: `m` - Minutes, `h` - Hours, `d` - Days. 112 ~> **NOTE:** Since Terraform is inherently stateful - we'd strongly recommend against auto-expiring Statefiles.