hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.76k stars 9.11k forks source link

[Improvement]: Improve error message: configuring Terraform AWS Provider: failed to get shared config profile, private-cloud-seeknow #34444

Open EugenKon opened 10 months ago

EugenKon commented 10 months ago

Terraform Version

Terraform v1.6.4
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v4.67.0
+ provider registry.terraform.io/hashicorp/external v2.3.1
+ provider registry.terraform.io/hashicorp/local v2.3.0
+ provider registry.terraform.io/hashicorp/null v3.2.1

Terraform Configuration Files

$ cat provider.tf
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }

    local = {
      source = "hashicorp/local"
      version = "2.3.0"
    }

    # Needed to upgrade old Portal projects
    null = {
      source = "hashicorp/null"
      version = "~> 3.2"
    }
  }
}

provider "aws" {
  region = var.aws_region
  default_tags {
    tags = {
      Project = var.project_name
    }
  }
}

Debug Output

data.external.get_audit_output: Reading...
data.external.get_audit_output: Read complete after 1s [id=-]

Changes to Outputs:
  + iguides_bucket_name = "-portal-iguides"
  + project_name        = ""
  + user_bucket_name    = "-portal-users"

You can apply this plan to save these new output values to the Terraform state, without
changing any real infrastructure.
╷
│ Error: configuring Terraform AWS Provider: failed to get shared config profile, private-cloud-seeknow
│
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on provider.tf line 21, in provider "aws":
│   21: provider "aws" {
│

Expected Behavior

More clear error message. I do not understand which shared config is requested.

Actual Behavior

Not clear error message

Steps to Reproduce

  1. terraform init
  2. terraform plan

Additional Context

https://github.com/hashicorp/terraform/issues/34256

References

No response

github-actions[bot] commented 10 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

socketbox commented 8 months ago

Not sure how @EugenKon got a stack reference. Even with TF_LOG=trace, I get only this (within a GitHub Actions step):

2024-01-26T15:51:32.335Z [DEBUG] Module installer: s3.s3_policy installed at .terraform/modules/s3.s3_policy
2024-01-26T15:51:32.336Z [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json
╷
│ Error: failed to get shared config profile, test-profile
│ 
│ 
╵

Error: Process completed with exit code 1.
##[debug]Finishing: Copy files to S3

Terraform version 1.7.0 AWS Provider version 5.33.0

mykolaov commented 4 days ago

Have the same problem. I have tried version greater than 1.3.6