Loading...
Loading...
### Terraform Version ```shell Terraform v1.8.2 on linux_amd64 + provider registry.terraform.io/hashicorp/aws v6.6.0 Your version of Terraform is out of date! The latest version is 1.14.7. You can update by downloading from https://www.terraform.io/downloads.html ``` ### Terraform Configuration Files ```terraform terraform { required_providers { aws = { source = "hashicorp/aws" version = "= 6.6.0" } } backend "s3" { bucket = "tfstate-bugreport" region = "eu-central-1" key = "terraform.tfstate" encrypt = true } required_version = "= 1.8.2" } locals { config = yamldecode(file("./config.yaml"))[terraform.workspace] tags = { Terraform = "true" Environment = terraform.workspace } } # ============================================================================= # Bugreport VPC # ============================================================================= resource "aws_vpc" "bugreport" { cidr_block = local.config.vpc_cidr tags = merge( local.tags, { Name = "${local.config.component_name}-${terraform.workspace}-vpc" } ) } provider "aws" { region = local.config.region } ``` config.yaml ```yaml common: &common region: "eu-central-1" component_name: "bugreport" staging: <<: *common aws_account_id: vpc_cidr: "10.20.0.0/16" ``` ### Debug Output gh gist: [https://gist.github.com/ivan-ivkovic/4185660ad86dbfa6515975920a8796a4](https://gist.github.com/ivan-ivkovic/4185660ad86dbfa6515975920a8796a4) ### Expected Behavior terraform init should run normally ### Actual Behavior terraform init crashes immediately ### Steps to Reproduce ```bash export AWS_ACCESS_KEY_ID= export AWS_SECRET_ACCESS_KEY= credentials_json=`aws sts get-session-token --serial-number $serial_number --token-code $mfa_code` temp_access_key_id=`echo $credentials_json | grep AccessKeyId | sed -r 's/ *"AccessKeyId": "([a-zA-Z0-9+/]+)",/\1/'` temp_secret_access_key=`echo $credentials_json | grep SecretAccessKey | sed -r 's/ *"SecretAccessKey": "([a-zA-Z0-9+/]+)",/\1/'` temp_session_token=`echo $credentials_json | grep SessionToken | sed -r 's/ *"SessionToken": "([a-zA-Z0-9+/]+)",/\1/'` export AWS_ACCESS_KEY_ID=$temp_access_key_id export AWS_SECRET_ACCESS_KEY=$temp_secret_access_key export AWS_SESSION_TOKEN=$temp_session_token terraform init ``` ### Additional Context Works fine in `zsh`, but crashes in `bash` (GNOME terminal used in both cases) on Fedora 43. Works fine in `bash` as well when the terraform state file is stored locally instead of on S3. Haven't tried how it works with other terraform state backends. ### References _No response_ ### Generative AI / LLM assisted development? _No response_
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.