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 AWS Provider Version to User-Agent Header #17483

Closed
bflad opened this issue Feb 5, 2021 · 2 comments · Fixed by #17486
Closed

provider: Add Terraform AWS Provider Version to User-Agent Header #17483

bflad opened this issue Feb 5, 2021 · 2 comments · Fixed by #17486
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Feb 5, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently the HTTP User-Agent header sent by Terraform AWS Provider requests include the following (plus anything locally added via the TF_APPEND_USER_AGENT environment variable):

User-Agent: aws-sdk-go/1.37.4 (go1.15.7; darwin; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.14.5 (+https://www.terraform.io)

It can be very helpful for troubleshooting to also see the Terraform AWS Provider version as well. This should be filled in with the proper version during releases and use a fallback dev version for local development. The provider implementation will need to match the current TeamCity release injection point LD_FLAGS="-s -w -X $PROVIDER_PACKAGE/version.ProviderVersion=$DEPLOYMENT_TARGET_VERSION -X $PROVIDER_PACKAGE/version.ProtocolVersion=$PROTOCOL_VERSION" (we do not need ProtocolVersion) and will need to be added to the goreleaser handling when it eventually supplants TeamCity.

The proposed User-Agent product and version is:

terraform-provider-aws/3.27.0 (+https://registry.terraform.io/providers/hashicorp/aws/)

Which can be added to aws/config.go:

		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-provider-aws", Version: /* ... */, Extra: []string{"+https://registry.terraform.io/providers/hashicorp/aws/"}},
		},
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. labels Feb 5, 2021
@bflad bflad self-assigned this Feb 5, 2021
bflad added a commit that referenced this issue Feb 5, 2021
Reference: #17483

Filled in during the TeamCity release process and future-proofed with `.goreleaser.yml` update.
bflad added a commit that referenced this issue Feb 8, 2021
…7486)

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

Reference: #17483

Filled in during the TeamCity release process and future-proofed with `.goreleaser.yml` update.

* Update CHANGELOG for #17486
@github-actions github-actions bot added this to the v3.28.0 milestone Feb 8, 2021
@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 11, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant