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

Automatically Handle Shared Credentials Filename Home Directory Expansion #30

Closed
bflad opened this issue Jun 1, 2020 · 0 comments · Fixed by #40
Closed

Automatically Handle Shared Credentials Filename Home Directory Expansion #30

bflad opened this issue Jun 1, 2020 · 0 comments · Fixed by #40
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Jun 1, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently there is a discrepancy between the Terraform AWS Provider and Terraform S3 Backend with respects to Config.CredsFilename. The AWS Provider automatically expands the home directory configuration provided:

https://github.com/terraform-providers/terraform-provider-aws/blob/934b07ac2dc27a97e041e5f8558d2dd3bf369ae1/aws/provider.go#L1172-L1177

While the S3 Backend does not. Let's move this handling into this library so its consistent and should be considered a bug fix for there due to the potentially confusing behavior.

Potential Library Implementation

import (
  homedir "github.com/mitchellh/go-homedir"
)

// GetCredentials()
sharedCredentialsFile, err := homedir.Expand(c.CredsFilename)

if err != nil {
  return nil, err
}

Potential Terraform Backend/Provider Configuration

(Already existing)

terraform {
  backend "s3" {
    shared_credentials_file = "..."
  }
}

provider "aws" {
  shared_credentials_file = "..."
}

References

@bflad bflad added the enhancement New feature or request label Jun 1, 2020
@bflad bflad added this to the v0.6.0 milestone Jun 1, 2020
@bflad bflad self-assigned this Jun 1, 2020
bflad added a commit that referenced this issue Jun 2, 2020
…sion

Reference: #30

For consistency, adding the capability for the Terraform S3 Backend and allowing the Terraform AWS Provider to remove this code.
@bflad bflad closed this as completed in #40 Jun 3, 2020
bflad added a commit that referenced this issue Jun 3, 2020
…sion (#40)

Reference: #30

For consistency, adding the capability for the Terraform S3 Backend and allowing the Terraform AWS Provider to remove this code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant