Loading...
Loading...
<!--- Please note the following potential times when an issue might be in Terraform core: * [Configuration Language](https://www.terraform.io/docs/configuration/index.html) or resource ordering issues * [State](https://www.terraform.io/docs/state/index.html) and [State Backend](https://www.terraform.io/docs/backends/index.html) issues * [Provisioner](https://www.terraform.io/docs/provisioners/index.html) issues * [Registry](https://registry.terraform.io/) issues * Spans resources across multiple providers If you are running into one of these scenarios, we recommend opening an issue in the [Terraform core repository](https://github.com/hashicorp/terraform/) instead. ---> ### Community Note * Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request * Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request * If you are interested in working on this issue or have submitted a pull request, please leave a comment ### Terraform CLI and Terraform AWS Provider Version * Terraform: 0.14.4 * hashicorp/aws: 3.23.0 ### Affected Resource(s) * backend ### Terraform Configuration Files Main configuration: ```hcl terraform { # Fix version to ensure future compatibility if an updates is deployed required_version = "~> 0.14" backend "s3" { } } provider "aws" { region = var.awsResourcesRegion } ``` CLI command: ```bash terraform \ -chdir=./ci/deployment/terraform init \ -upgrade -no-color -lock=true -lock-timeout=10m \ -backend-config="key=default" \ -backend-config="encrypt=true" \ -backend-config="region=eu-central-1" \ -backend-config="bucket=my-tfstate" \ -backend-config="kms_key_id=arn:aws:kms:eu-central-1:my-account-id:alias/my-tfstate" \ -backend-config="dynamodb_table=my-tfstate" \ -backend-config="workspace_key_prefix=backends/infra" ``` Envs: * AWS_EC2_METADATA_DISABLED=true * TF_IN_AUTOMATION=non-null * TF_INPUT=false * TF_DATA_DIR=/tmp/xxx * TF_LOG=TRACE * TF_VAR_awsResourcesRegion=eu-central-1 ### Debug Output https://gist.github.com/instagendleg/2fdc89b09c6165d391e0db27e9c25be8 ### Expected Behavior I defined my `workspace_key_prefix` backend prefix equals to `backends/infra` and my `key` name equals to `default`, my AWS S3 file should be of type `/backends/infra/[workspace]/default`. ### Actual Behavior Instead of, my backend is written at the path `/default`. ### Steps to Reproduce 1. `terraform apply`
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.