diff --git a/terraform/user_agent.go b/terraform/user_agent.go new file mode 100644 index 000000000000..700be2ae202b --- /dev/null +++ b/terraform/user_agent.go @@ -0,0 +1,14 @@ +package terraform + +import ( + "fmt" + "runtime" +) + +// The standard Terraform User-Agent format +const UserAgent = "Terraform %s (%s)" + +// Generate a UserAgent string +func UserAgentString() string { + return fmt.Sprintf(UserAgent, VersionString(), runtime.Version()) +}