Skip to content

[Bug]: credential_process broken in 5.27.0 #34603

Closed
@ryanpodonnell1

Description

Terraform Core Version

Terraform v1.6.2 on darwin_amd64

AWS Provider Version

5.27.0

Affected Resource(s)

aws provider authentication using the credential process on 5.27.0

5.26.0 works as expected

Expected Behavior

should authenticate properly using the credential_process to source credentials

Actual Behavior

fails to source AWS credentials from an external process

Relevant Error/Panic Output Snippet

╷
│ Error: No valid credential sources found
│ 
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on <empty> line 0:
│   (source code not available)
│ 
│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.
│ 
│ Error: failed to refresh cached credentials, operation error STS: AssumeRole, get identity: get credentials: process provider error: error in credential_process: exit status 127
│ 
╵

Terraform Configuration Files

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.27.0"
    }
  }
}
provider "aws" {}

data "aws_caller_identity" "current" {}

output "caller" {
  value = data.aws_caller_identity.current.id
}

Steps to Reproduce

  1. create a config file that uses the credential process (we use something internal but works fine for 5.26.0)
[profile sample]
credential_process = '<some CLI command that generates the expected JSON output (see article above)'
  1. set env variables:
AWS_CONFIG_FILE=<config_file>
AWS_DEFAULT_REGION=us-west-2
AWS_PROFILE=<profile_name that points to a credential process>
AWS_SDK_LOAD_CONFIG=1
  1. terraform apply --auto-approve
  2. error detailing unable to find credentials

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

Metadata

Assignees

No one assigned

    Labels

    authenticationPertains to authentication; to the provider itself of otherwise.bugAddresses a defect in current functionality.upstreamAddresses functionality related to the cloud provider.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions