Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows AWS provider shared credential file default documented incorrectly, and unsuccessfully from root drive #14778

Closed
zmarois opened this issue May 23, 2017 · 2 comments

Comments

@zmarois
Copy link

zmarois commented May 23, 2017

Terraform Version

Terraform v0.9.5

Affected Resource(s)

  • aws_provider

Terraform Configuration Files

provider "aws" {
  region = "eu-west-1"
  profile = "myprofile"
}

# Could by anything at all that uses the provider
data "aws_vpc" "vpc" {
}

Debug Output

https://gist.github.com/zmarois/2edc76ea0a48551f65660e14c8edc0d9

Expected Behavior

  • Should have read credentials from %USERPROFILE%.aws\credentials, not %HOME%.aws\credentials, per these docs
  • Should successfully read from C:.aws\credentials

Actual Behavior

Attempted to read from %HOME%/.aws/credentials. Considering that HOME was set to C:, failed to read from C:.aws/credentials

Steps to Reproduce

  • Set an environment variable HOME to C: (or any drive)
  • Create a shared credential file with profile "myprofile" for an AWS account at %USERPROFILE%.aws\credentials
  • Run terraform plan
  • See the error
  • Copy that shared credential file to C:.aws\credentials
  • Run terraform plan
  • Still see the error
  • Set environment variable HOME to "C:"
  • Run terraform plan
  • See successful result
  • Delete environment variable HOME
  • Run terraform plan
  • See successful result (now using USERPROFILE because HOME is not set)

Important Factoids

I filed this PR to aws-sdk-go to (I think, I'm pretty new to go, but my local manual tests confirm it does catch "am I windows") vary environment variable by OS, not existence of one or the other. Again, new to GO, but as I understand this dependency, if that is merged to the master branch of aws-sdk-go, the next release of terraform will pick it up. If I am incorrect and there is still a change on the terraform side to consume that, let me know.

I did not fix the issue regarding if USERPROFILE (or HOME right now where HOME beats out USERPROFILE) is set to a drive without a "" that the ini file is not read correctly, as I don't really need to handle that case if I can get USERPROFILE read instead of HOME, but I figured I'd report it...

References

@zmarois
Copy link
Author

zmarois commented May 31, 2017

A generous maintainer of the aws-sdk found that this was an issue in a couple places and consolidated the fix in his own PR, so that should be followed instead of my PR. Added as a reference to the description.

@ghost
Copy link

ghost commented Apr 9, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants