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

Allow for Custom User Agent Info #9149

Closed
hasheddan opened this issue Jun 26, 2019 · 6 comments · Fixed by #14555
Closed

Allow for Custom User Agent Info #9149

hasheddan opened this issue Jun 26, 2019 · 6 comments · Fixed by #14555
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

@hasheddan
Copy link
Contributor

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 "me too" comments, 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

The AWS client is currently configured to send information in API requests via the UserAgent field including Terraform version and HashiCorp indentification. I propose allowing for users to provide additional configuration information, such as a deployment agent and job ID if they are using Jenkins or similar products.

I would be happy to do the work required to implement this feature.

New or Affected Resource(s)

This change will not affect the functionality of any AWS resource types.

References

The User Agent field is currently being configured in config.go

@hasheddan hasheddan added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 26, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 26, 2019
@aeschright aeschright added the provider Pertains to the provider itself, rather than any interaction with AWS. label Jul 5, 2019
@skorfmann
Copy link
Contributor

I found TF_APPEND_USER_AGENT in Terraform itself, and was somehow expecting that this would be reflected in providers as well. But according to TRACE logging output it's not.

Would be nice if appending to the user-agent via config or ENV was possible somehow. Could be very useful for https://github.com/hashicorp/terraform-cdk and similar tooling.

@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label Jul 23, 2020
@paultyng
Copy link
Contributor

TF_APPEND_USER_AGENT is the way to modify user agents. Many other providers do respect it (it varies per provider, as each uses a different SDK and may or may not use an http.Client in a way thats easily extensible). Its integrated in to the Terraform Provider SDK to append it to a consistent User-Agent value you can send in headers.

Unfortunately the AWS SDK does not just take a User-Agent string, but requires a more specific construction, so the implementation will need to do a bit more work and parse the string, etc.

This is planned to follow the 3.0 release.

@skorfmann
Copy link
Contributor

Cool, thanks for elaborating on this 👍

@bflad
Copy link
Contributor

bflad commented Aug 19, 2020

Support for this functionality (using the TF_APPEND_USER_AGENT environment variable) has been merged in both the Terraform S3 Backend and Terraform AWS Provider, releasing in version 0.13.1 and version 3.3.0 respectively. 👍

@ghost
Copy link

ghost commented Aug 20, 2020

This has been released in version 3.3.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 Sep 18, 2020

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 and limited conversation to collaborators Sep 18, 2020
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
6 participants