Skip to content

Commit

Permalink
Support TFE_ADDRESS and TFE_BASEPATH env variables (#89)
Browse files Browse the repository at this point in the history
Needed to support Terraform Enterprise installations
  • Loading branch information
cbowman0 authored Jan 6, 2022
1 parent 6657cf3 commit cf8c21f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tfecli/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@ func getToken(cmd *cobra.Command) (string, error) {

// NewClient prepares a TFE client.
func newClient(token string) (*tfe.Client, error) {

// Read the environment variable as a fallback.
Address := os.Getenv("TFE_ADDRESS")
BasePath := os.Getenv("TFE_BASEPATH")

// Prepare TFE config.
config := &tfe.Config{
Token: token,
Address: Address,
BasePath: BasePath,
}

// Create TFE client.
Expand Down

0 comments on commit cf8c21f

Please sign in to comment.