github.com/eliastor/durgaform@v0.0.0-20220816172711-d0ab2d17673e/website/docs/language/settings/backends/swift.mdx (about)

     1  ---
     2  page_title: 'Backend Type: swift'
     3  description: Terraform can store state remotely in Swift.
     4  ---
     5  
     6  # swift (deprecated)
     7  
     8  -> **Note:** The `swift` backend is deprecated and will be removed in a future Terraform release.
     9  
    10  Stores the state as an artifact in [Swift](http://docs.openstack.org/developer/swift/latest/).
    11  
    12  This backend supports [state locking](/language/state/locking).
    13  
    14  ~> 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`](/language/settings/backends/swift#archive_container) configuration. This allows for state recovery in the case of accidental deletions and human error.
    15  
    16  ## Example Configuration
    17  
    18  ```hcl
    19  terraform {
    20    backend "swift" {
    21      container         = "terraform-state"
    22      archive_container = "terraform-state-archive"
    23    }
    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  For the access credentials we recommend using a
    30  [partial configuration](/language/settings/backends/configuration#partial-configuration).
    31  
    32  ## Data Source Configuration
    33  
    34  ```hcl
    35  data "terraform_remote_state" "foo" {
    36    backend = "swift"
    37    config = {
    38      container         = "terraform_state"
    39      archive_container = "terraform_state-archive"
    40    }
    41  }
    42  ```
    43  
    44  ## Configuration Variables
    45  
    46  !> **Warning:**  We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, Terraform will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
    47  
    48  The following configuration options are supported:
    49  
    50  * `auth_url` - (Optional) The Identity authentication URL. If omitted, the
    51    `OS_AUTH_URL` environment variable is used.
    52  
    53  * `cloud` - (Optional; required if `auth_url` is not specified) An entry in a
    54    `clouds.yaml` file. See the OpenStack `os-client-config`
    55    [documentation](https://docs.openstack.org/os-client-config/latest/user/configuration.html)
    56    for more information about `clouds.yaml` files. If omitted, the `OS_CLOUD`
    57    environment variable is used.
    58  
    59  * `region_name` - (Optional) - The region in which to store `terraform.tfstate`. If
    60    omitted, the `OS_REGION_NAME` environment variable is used.
    61  
    62  * `container` - (Required) The name of the container to create for storing
    63    the Terraform state file.
    64  
    65  * `state_name` - (Optional) The name of the state file in the container.
    66    Defaults to `tfstate.tf`.
    67  
    68  * `path` - (Optional) DEPRECATED: Use `container` instead.
    69    The name of the container to create in order to store the state file.
    70  
    71  * `user_name` - (Optional) The Username to login with. If omitted, the
    72    `OS_USERNAME` environment variable is used.
    73  
    74  * `user_id` - (Optional) The User ID to login with. If omitted, the
    75    `OS_USER_ID` environment variable is used.
    76  
    77  * `application_credential_id` - (Optional) (Identity v3 only) The ID of an
    78    application credential to authenticate with. An
    79    `application_credential_secret` has to bet set along with this parameter.
    80  
    81  * `application_credential_name` - (Optional) (Identity v3 only) The name of an
    82    application credential to authenticate with. Requires `user_id`, or
    83    `user_name` and `user_domain_name` (or `user_domain_id`) to be set.
    84  
    85  * `application_credential_secret` - (Optional) (Identity v3 only) The secret of an
    86    application credential to authenticate with. Required by
    87    `application_credential_id` or `application_credential_name`.
    88  
    89  * `tenant_id` - (Optional) The ID of the Tenant (Identity v2) or Project
    90    (Identity v3) to login with. If omitted, the `OS_TENANT_ID` or
    91    `OS_PROJECT_ID` environment variables are used.
    92  
    93  * `tenant_name` - (Optional) The Name of the Tenant (Identity v2) or Project
    94    (Identity v3) to login with. If omitted, the `OS_TENANT_NAME` or
    95    `OS_PROJECT_NAME` environment variable are used.
    96  
    97  * `password` - (Optional) The Password to login with. If omitted, the
    98    `OS_PASSWORD` environment variable is used.
    99  
   100  * `token` - (Optional; Required if not using `user_name` and `password`)
   101    A token is an expiring, temporary means of access issued via the Keystone
   102    service. By specifying a token, you do not have to specify a username/password
   103    combination, since the token was already created by a username/password out of
   104    band of Terraform. If omitted, the `OS_TOKEN` or `OS_AUTH_TOKEN` environment
   105    variables are used.
   106  
   107  * `user_domain_name` - (Optional) The domain name where the user is located. If
   108    omitted, the `OS_USER_DOMAIN_NAME` environment variable is checked.
   109  
   110  * `user_domain_id` - (Optional) The domain ID where the user is located. If
   111    omitted, the `OS_USER_DOMAIN_ID` environment variable is checked.
   112  
   113  * `project_domain_name` - (Optional) The domain name where the project is
   114    located. If omitted, the `OS_PROJECT_DOMAIN_NAME` environment variable is
   115    checked.
   116  
   117  * `project_domain_id` - (Optional) The domain ID where the project is located
   118    If omitted, the `OS_PROJECT_DOMAIN_ID` environment variable is checked.
   119  
   120  * `domain_id` - (Optional) The ID of the Domain to scope to (Identity v3). If
   121    omitted, the following environment variables are checked (in this order):
   122    `OS_USER_DOMAIN_ID`, `OS_PROJECT_DOMAIN_ID`, `OS_DOMAIN_ID`.
   123  
   124  * `domain_name` - (Optional) The Name of the Domain to scope to (Identity v3).
   125    If omitted, the following environment variables are checked (in this order):
   126    `OS_USER_DOMAIN_NAME`, `OS_PROJECT_DOMAIN_NAME`, `OS_DOMAIN_NAME`,
   127    `DEFAULT_DOMAIN`.
   128  
   129  * `default_domain` - (Optional) The ID of the Domain to scope to if no other
   130    domain is specified (Identity v3). If omitted, the environment variable
   131    `OS_DEFAULT_DOMAIN` is checked or a default value of "default" will be
   132    used.
   133  
   134  * `insecure` - (Optional) Trust self-signed SSL certificates. If omitted, the
   135    `OS_INSECURE` environment variable is used.
   136  
   137  * `cacert_file` - (Optional) Specify a custom CA certificate when communicating
   138    over SSL. You can specify either a path to the file or the contents of the
   139    certificate. If omitted, the `OS_CACERT` environment variable is used.
   140  
   141  * `cert` - (Optional) Specify client certificate file for SSL client authentication.
   142    If omitted the `OS_CERT` environment variable is used.
   143  
   144  * `key` - (Optional) Specify client private key file for SSL client authentication.
   145    If omitted the `OS_KEY` environment variable is used.
   146  
   147  * `endpoint_type` - (Optional) Specify which type of endpoint to use from the
   148    service catalog. It can be set using the OS_ENDPOINT_TYPE environment
   149    variable. If not set, public endpoints is used.
   150  
   151  * `swauth` - (Optional) Set to `true` to authenticate against Swauth, a
   152    Swift-native authentication system. If omitted, the `OS_SWAUTH` environment
   153    variable is used. You must also set `username` to the Swauth/Swift username
   154    such as `username:project`. Set the `password` to the Swauth/Swift key. This feature supports v1.0 of the Swauth system.
   155    Finally, set `auth_url` as the location of the Swift service.
   156  
   157  * `disable_no_cache_header` - (Optional) If set to `true`, the HTTP
   158    `Cache-Control: no-cache` header will not be added by default to all API requests.
   159    If omitted this header is added to all API requests to force HTTP caches (if any)
   160    to go upstream instead of serving cached responses.
   161  
   162  * `allow_reauth` - (Optional) If set to `true`, OpenStack authorization will be
   163    perfomed automatically, if the initial auth token get expired. This is useful,
   164    when the token TTL is low or the overall Terraform provider execution time
   165    expected to be greater than the initial token TTL.
   166  
   167  * `archive_container` - (Optional) The container to create to store archived copies
   168    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`.
   169  
   170  * `archive_path` - (Optional) DEPRECATED: Use `archive_container` instead.
   171    The path to store archived copied of `terraform.tfstate`. If specified,
   172    Swift [object versioning](https://docs.openstack.org/developer/swift/latest/overview_object_versioning.html) is enabled on the container created at `path`.
   173  
   174  * `expire_after` - (Optional) How long should the `terraform.tfstate` created at `container`
   175    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.
   176    ~> **NOTE:** Since Terraform is inherently stateful - we'd strongly recommend against auto-expiring Statefiles.