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 #799

Closed
hashibot opened this issue Jun 13, 2017 · 4 comments
Labels
bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS. upstream Addresses functionality related to the cloud provider. windows Issues and PRs that relate to using the provider on the Windows operating system.

Comments

@hashibot
Copy link

This issue was originally opened by @zmarois as hashicorp/terraform#14778. It was migrated here as part of the provider split. The original body of the issue is below.


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

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@bflad bflad added windows Issues and PRs that relate to using the provider on the Windows operating system. provider Pertains to the provider itself, rather than any interaction with AWS. labels Jan 29, 2018
@bflad
Copy link
Member

bflad commented Jan 29, 2018

@zmarois have the upstream aws-sdk-go changes been working for you or is additional work needed here?

@bflad bflad added waiting-response Maintainers are waiting on response from community or contributor. upstream Addresses functionality related to the cloud provider. labels Jan 29, 2018
@zmarois
Copy link

zmarois commented Jan 29, 2018

Yes, I believe so. I don't see any reason to keep this open.

@bflad
Copy link
Member

bflad commented Jan 29, 2018

Thanks! Closing this out then.

@bflad bflad closed this as completed Jan 29, 2018
@ghost
Copy link

ghost commented Apr 8, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 8, 2020
@breathingdust breathingdust removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS. upstream Addresses functionality related to the cloud provider. windows Issues and PRs that relate to using the provider on the Windows operating system.
Projects
None yet
Development

No branches or pull requests

4 participants