hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.69k stars 9.55k forks source link

Partial Configuration Swift backend not working #20277

Closed Leletir closed 2 years ago

Leletir commented 5 years ago

Hello,

I'm trying to use the partial configuration with swift backend, but impossible to make it works. Terraform still need credentials to use the object storage as a backend.

Terraform Version

v0.11.11
provider.openstack v1.15.0

Terraform Configuration Files

main.tf:

data "terraform_remote_state" "foo" {
  backend = "swift" 
  config = {
    container = "${var.swift_container}"
    auth_url = "${var.swift_auth_url}"
    region_name = "${var.swift_region_name}"
  }
}

vars.tf

variable "swift_container" {
    type = "string"
}
variable "swift_auth_url" {
    type = "string"
}

variable "swift_region_name" {
    type = "string"
}

Debug Output

https://gist.github.com/Leletir/86d6ba1fe7259950d7dcd4c6b88c749a

Crash Output

Expected Behavior

If I have understood the aim of partial configuration, terraform should retrieve this information and merge it. To me, I should not give again my credential to log in to my object storage.

Steps to Reproduce

  1. terraform init

    terraform init -backend-config="container=terraform-tfstate-test-2" \
          -backend-config="auth_url=<my_auth_url>" \
          -backend-config="password=<my_pwd>" \
          -backend-config="user_name=<my_username>" \
          -backend-config="domain_name=<my_domain>" \
          -backend-config="region_name=<my_object_storage_region>" \
          -backend-config="tenant_name=<my_tenant_name>" \
          -backend-config="archive_container=terraform-tfstate-test-2-archive"
  2. terraform apply

What do you guys think, is it a bug or I misunderstood the documentation ? Thank you for your help.

apparentlymart commented 2 years ago

Hello! Thanks for reporting this.

We removed the Swift backend in Terraform v1.3 because it hasn't had a dedicated maintainer for a few versions now and so it was becoming problematic to keep working in newer Terraform versions. Since that backend is no longer present in the Terraform codebase, I'm going to close this issue.

If you're currently using this backend with an older version of Terraform, see Removal of Deprecated State Storage Backends in the Terraform v1.3 upgrade guide for some information on the available options for migration.

Thanks again!

github-actions[bot] commented 2 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.