diff --git a/command/push.go b/command/push.go index 67cac6740..1abe13e0b 100644 --- a/command/push.go +++ b/command/push.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/atlas-go/archive" "github.com/hashicorp/atlas-go/v1" + "github.com/hashicorp/terraform/terraform" ) type PushCommand struct { @@ -126,6 +127,8 @@ func (c *PushCommand) Run(args []string) int { } } + client.DefaultHeader.Set(terraform.VersionHeader, terraform.Version) + if atlasToken != "" { client.Token = atlasToken } diff --git a/terraform/version.go b/terraform/version.go index e781d9c25..7462a3c67 100644 --- a/terraform/version.go +++ b/terraform/version.go @@ -16,3 +16,7 @@ const VersionPrerelease = "dev" // benefit of verifying during tests and init time that our version is a // proper semantic version, which should always be the case. var SemVersion = version.Must(version.NewVersion(Version)) + +// VersionHeader is the header name used to send the current terraform version +// in http requests. +const VersionHeader = "Terraform-Version"