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

provider: Add terraform-provider-aws/VERSION to User-Agent header #17486

Merged
merged 2 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/17486.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
provider: Add terraform-provider-aws version to HTTP User-Agent header
```
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builds:
- goarch: '386'
goos: darwin
ldflags:
- -s -w -X aws/version.ProviderVersion={{.Version}}
- -s -w -X version.ProviderVersion={{.Version}}
mod_timestamp: '{{ .CommitTimestamp }}'
changelog:
skip: true
Expand Down
5 changes: 3 additions & 2 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ import (
"github.com/hashicorp/aws-sdk-go-base/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
"github.com/terraform-providers/terraform-provider-aws/version"
)

type Config struct {
Expand Down Expand Up @@ -425,8 +426,8 @@ func (c *Config) Client() (interface{}, error) {
UserAgentProducts: []*awsbase.UserAgentProduct{
{Name: "APN", Version: "1.0"},
{Name: "HashiCorp", Version: "1.0"},
{Name: "Terraform", Version: c.terraformVersion,
Extra: []string{"+https://www.terraform.io"}},
{Name: "Terraform", Version: c.terraformVersion, Extra: []string{"+https://www.terraform.io"}},
{Name: "terraform-provider-aws", Version: version.ProviderVersion, Extra: []string{"+https://registry.terraform.io/providers/hashicorp/aws"}},
},
}

Expand Down
4 changes: 4 additions & 0 deletions version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package version

// ProviderVersion is set during the release process to the release version of the binary
var ProviderVersion = "dev"