Terraform: backends not working on 0.13.X or syntax is changed

Created on 23 Sep 2020  ยท  2Comments  ยท  Source: hashicorp/terraform

I can't manage to make a backend works with 0.13.X terraform version.
Works well on 0.12.29

โฏ terraform --version
Terraform v0.13.3

Terraform Configuration Files

**backend.tf**
terraform {
  backend "s3" {
    bucket  = "REMOVED"
    key     = "backend.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

I also used:

terraform {
  backend "kubernetes" {
    secret_suffix    = "state"
    load_config_file = true
  }
}

Debug Output

Crash Output

2020/09/23 10:05:49 [INFO] Terraform version: 0.13.3  
2020/09/23 10:05:49 [INFO] Go runtime version: go1.14.7
2020/09/23 10:05:49 [INFO] CLI args: []string{"/home/maathor/bin/.tfenv/versions/0.13.3/terraform", "init", "-backend-config=backend.tf"}
2020/09/23 10:05:49 [DEBUG] Attempting to open CLI config file: /home/maathor/.terraformrc
2020/09/23 10:05:49 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/09/23 10:05:49 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/09/23 10:05:49 [DEBUG] ignoring non-existing provider search directory /home/maathor/.terraform.d/plugins
2020/09/23 10:05:49 [DEBUG] ignoring non-existing provider search directory /home/maathor/.local/share/terraform/plugins
2020/09/23 10:05:49 [DEBUG] ignoring non-existing provider search directory /usr/share/plasma/terraform/plugins
2020/09/23 10:05:49 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2020/09/23 10:05:49 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2020/09/23 10:05:49 [INFO] CLI command args: []string{"init", "-backend-config=backend.tf"}

Expected Behavior

Init should be well.

Actual Behavior

Terrafom can't initialize my project, get tfstates

Steps to Reproduce

1. `terraform init -backend-config=backend.tf`

Asciinema

asciinema demo

bug new

Most helpful comment

Hi @maathor

The backend configuration file should only contain the backend key value pairs, not the entire terraform block.

We use GitHub issues for tracking bugs and enhancements, rather than for questions. While we can sometimes help with certain simple problems here, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by our few core maintainers.

Based on the information you've provided, it looks like this doesn't represent a specific bug or feature request, even though I understand that Terraform isn't doing what you expect it to, and so I'm going to close it. Please do feel free to ask your question in the community forum. Thanks!

All 2 comments

Hi @maathor

The backend configuration file should only contain the backend key value pairs, not the entire terraform block.

We use GitHub issues for tracking bugs and enhancements, rather than for questions. While we can sometimes help with certain simple problems here, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by our few core maintainers.

Based on the information you've provided, it looks like this doesn't represent a specific bug or feature request, even though I understand that Terraform isn't doing what you expect it to, and so I'm going to close it. Please do feel free to ask your question in the community forum. Thanks!

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rnowosielski picture rnowosielski  ยท  3Comments

ketzacoatl picture ketzacoatl  ยท  3Comments

shanmugakarna picture shanmugakarna  ยท  3Comments

rkulagowski picture rkulagowski  ยท  3Comments

rjinski picture rjinski  ยท  3Comments