From 027b10726853c6f01cb17099c0ff19edb98c7056 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 4 Oct 2018 13:49:43 -0500 Subject: [PATCH 1/6] website: update deprecated backend/swift docs Update the examples and docs to not directly reference deprecated fields. --- website/docs/backends/types/swift.html.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/backends/types/swift.html.md b/website/docs/backends/types/swift.html.md index 192e58529..711ce9943 100644 --- a/website/docs/backends/types/swift.html.md +++ b/website/docs/backends/types/swift.html.md @@ -12,14 +12,14 @@ description: |- Stores the state as an artifact in [Swift](http://docs.openstack.org/developer/swift/). -~> Warning! It is highly recommended that you enable [Object Versioning](https://docs.openstack.org/developer/swift/overview_object_versioning.html) by setting the [`expire_after`](https://www.terraform.io/docs/backends/types/swift.html#archive_path) configuration. This allows for state recovery in the case of accidental deletions and human error. +~> Warning! It is highly recommended that you enable [Object Versioning](https://docs.openstack.org/developer/swift/overview_object_versioning.html) by setting the [`expire_after`](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. ## Example Configuration ```hcl terraform { backend "swift" { - path = "terraform-state" + container = "terraform-state" } } ``` @@ -36,7 +36,7 @@ For the access credentials we recommend using a data "terraform_remote_state" "foo" { backend = "swift" config = { - path = "terraform_state" + container = "terraform_state" } } ``` @@ -105,5 +105,5 @@ The following configuration options are supported: The path to store archived copied of `terraform.tfstate`. If specified, Swift [object versioning](https://docs.openstack.org/developer/swift/overview_object_versioning.html) is enabled on the container created at `path`. - * `expire_after` - (Optional) How long should the `terraform.tfstate` created at `path` + * `expire_after` - (Optional) How long should the `terraform.tfstate` created at `container` be retained for? Supported durations: `m` - Minutes, `h` - Hours, `d` - Days. From b31aab446969213a400a4b37ae7fd1dad401188d Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 4 Oct 2018 13:52:40 -0500 Subject: [PATCH 2/6] website: fix backend/swift links to Swift docs The links to the OpenStack Swift documentation were broken due to changes on the OpenStack website. --- website/docs/backends/types/swift.html.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/backends/types/swift.html.md b/website/docs/backends/types/swift.html.md index 711ce9943..b89702ca3 100644 --- a/website/docs/backends/types/swift.html.md +++ b/website/docs/backends/types/swift.html.md @@ -10,9 +10,9 @@ description: |- **Kind: Standard (with no locking)** -Stores the state as an artifact in [Swift](http://docs.openstack.org/developer/swift/). +Stores the state as an artifact in [Swift](http://docs.openstack.org/developer/swift/latest/). -~> Warning! It is highly recommended that you enable [Object Versioning](https://docs.openstack.org/developer/swift/overview_object_versioning.html) by setting the [`expire_after`](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. +~> Warning! It is highly recommended that you enable [Object Versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) by setting the [`expire_after`](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. ## Example Configuration @@ -99,11 +99,11 @@ The following configuration options are supported: If omitted the `OS_KEY` environment variable is used. * `archive_container` - (Optional) The container to create to store archived copies - of the Terraform state file. If specified, Swift [object versioning](https://docs.openstack.org/developer/swift/overview_object_versioning.html) is enabled on the container created at `container`. + 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`. * `archive_path` - (Optional) DEPRECATED: Use `archive_container` instead. The path to store archived copied of `terraform.tfstate`. If specified, - Swift [object versioning](https://docs.openstack.org/developer/swift/overview_object_versioning.html) is enabled on the container created at `path`. + Swift [object versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) is enabled on the container created at `path`. * `expire_after` - (Optional) How long should the `terraform.tfstate` created at `container` be retained for? Supported durations: `m` - Minutes, `h` - Hours, `d` - Days. From ddc30b6546a91048218638c1a0e81bfb58545fc5 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 4 Oct 2018 14:22:27 -0500 Subject: [PATCH 3/6] website: backend/swift add docs link for expire_after Provide a link to the OpenStack Swift docs for the object expiration feature that is used by the `expire_after` field. --- website/docs/backends/types/swift.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/backends/types/swift.html.md b/website/docs/backends/types/swift.html.md index b89702ca3..afcd9fff7 100644 --- a/website/docs/backends/types/swift.html.md +++ b/website/docs/backends/types/swift.html.md @@ -106,4 +106,4 @@ The following configuration options are supported: Swift [object versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) is enabled on the container created at `path`. * `expire_after` - (Optional) How long should the `terraform.tfstate` created at `container` - be retained for? Supported durations: `m` - Minutes, `h` - Hours, `d` - Days. + 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. From 58cb47d108348dc013b00ece1377aa27597e9a5c Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 4 Oct 2018 14:25:15 -0500 Subject: [PATCH 4/6] website: backend/swift fix bad link for object versioning The displayed link said `expire_after` but really is a link to `archive_container` so update the link to read the right data. fixes #19005 --- website/docs/backends/types/swift.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/backends/types/swift.html.md b/website/docs/backends/types/swift.html.md index afcd9fff7..9e33c276c 100644 --- a/website/docs/backends/types/swift.html.md +++ b/website/docs/backends/types/swift.html.md @@ -12,7 +12,7 @@ description: |- Stores the state as an artifact in [Swift](http://docs.openstack.org/developer/swift/latest/). -~> Warning! It is highly recommended that you enable [Object Versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) by setting the [`expire_after`](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. +~> 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. ## Example Configuration From 817be7b23f230dd4abde3b4a5faaad4c64a7773a Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 4 Oct 2018 14:26:10 -0500 Subject: [PATCH 5/6] website: update backend/swift examples to use versioning Since object versioning is a best practice the docs should have all the examples containing it by default. --- website/docs/backends/types/swift.html.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/docs/backends/types/swift.html.md b/website/docs/backends/types/swift.html.md index 9e33c276c..001dea0a1 100644 --- a/website/docs/backends/types/swift.html.md +++ b/website/docs/backends/types/swift.html.md @@ -19,11 +19,12 @@ Stores the state as an artifact in [Swift](http://docs.openstack.org/developer/s ```hcl terraform { backend "swift" { - container = "terraform-state" + container = "terraform-state" + archive_container = "terraform-state-archive" } } ``` -This will create a container called `terraform-state` and an object within that container called `tfstate.tf`. +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. -> 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. @@ -36,7 +37,8 @@ For the access credentials we recommend using a data "terraform_remote_state" "foo" { backend = "swift" config = { - container = "terraform_state" + container = "terraform_state" + archive_container = "terraform_state-archive" } } ``` From 49c42b98300a8ced3c470ac272ae34b8c8fb679e Mon Sep 17 00:00:00 2001 From: Tom Harvey Date: Mon, 29 Oct 2018 15:08:27 -0500 Subject: [PATCH 6/6] docs: add warning to backend/swift about auto-expire If the user uses the auto-expire value in the backend/swift settings then swift will automatically delete their Statefile which is likely something the user doesn't want given how Terraform works. --- website/docs/backends/types/swift.html.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/backends/types/swift.html.md b/website/docs/backends/types/swift.html.md index 001dea0a1..2e11444c7 100644 --- a/website/docs/backends/types/swift.html.md +++ b/website/docs/backends/types/swift.html.md @@ -109,3 +109,4 @@ The following configuration options are supported: * `expire_after` - (Optional) How long should the `terraform.tfstate` created at `container` 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. + ~> **NOTE:** Since Terraform is inherently stateful - we'd strongly recommend against auto-expiring Statefiles.