Commit 6d9c919f authored by Brandon Croft's avatar Brandon Croft Committed by Chris Arcand
Browse files

adds X-Terraform-Integration header

This can help differentiate cloud integration API requests from normal remote backend requests
parent 3d23a8e0
Showing with 3 additions and 0 deletions
+3 -0
......@@ -36,6 +36,8 @@ const (
defaultHostname = "app.terraform.io"
defaultParallelism = 10
tfeServiceID = "tfe.v2"
headerSourceKey = "X-Terraform-Integration"
headerSourceValue = "cloud"
)
// Cloud is an implementation of EnhancedBackend in service of the Terraform Cloud/Enterprise
......@@ -254,6 +256,7 @@ func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics {
// Set the version header to the current version.
cfg.Headers.Set(tfversion.Header, tfversion.Version)
cfg.Headers.Set(headerSourceKey, headerSourceValue)
// Create the TFC/E API client.
b.client, err = tfe.NewClient(cfg)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment