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

HTTP User-Agent string for AWS API calls #152

Closed
ewbankkit opened this issue Sep 14, 2021 · 2 comments · Fixed by #189
Closed

HTTP User-Agent string for AWS API calls #152

ewbankkit opened this issue Sep 14, 2021 · 2 comments · Fixed by #189
Assignees
Milestone

Comments

@ewbankkit
Copy link
Contributor

ewbankkit commented Sep 14, 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
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the Cloudformation Open Coverage Roadmap.

Description

Determine and set the correct HTTP User-Agent string for AWS API calls.

Related:

@gdavison gdavison self-assigned this Sep 16, 2021
@breathingdust breathingdust added this to the v0.1.0 milestone Sep 17, 2021
@ewbankkit
Copy link
Contributor Author

ewbankkit commented Sep 17, 2021

How do I implement this in my solution?

You need to use a unique UA value to allow the capture of usage data. You should include it in all the API calls you make to AWS Cloud Control API.
The unique UA should use the syntax listed below:

APN/1.0 <PARTNER>/1.0 <SOLUTION>/<VERSION>([0-9]+.[0-9]+)

For example, if your company name is Cloud Corp and you have a product called My Solution that has a current version of 5.0 you can use the UA below:

APN/1.0 cloudcorp/1.0 mysolution/5.0

PARTNER - This should be the name of your company. Please be consistent with the name you use across all products, including case. This can include letters and numbers, avoid spaces and do not use any special characters.
SOLUTION - The product/solution name. This can include letters and numbers, avoid spaces and do not use any special characters. For AWS Marketplace solutions add a space and “MP” after the solution name. As an example: APN/1.0 cloudcorp/1.0 mysolution MP/5.0.
VERSION - This should be the numeric version of the product/solution. APN recommends just using the major and minor version, there is no need to go down to the level of a specific patch or build.

If needed, you can incorporate any additional data such as the normal UA after the APN UA. The APN UA should always be first and you should separate it with a comma. If you append the APN UA after the normal UA it will NOT be captured.
See example below.

APN/1.0 cloudcorp/1.0 mysolution/5.0, curl/7.9.8 (i686-pc-linux-gnu) libcurl 7.9.8 (OpenSSL 0.9.6b)

To test your UA, you should make sure it is able to match the regular expression below.

APN\/1\.0\s([^\/]+)\/[0-9]+\.[0.9]+\s([^\/]+)\/([^\/\,\s]+)

This expression should match three groups with the details specified above.

@gdavison
Copy link
Contributor

gdavison commented Sep 17, 2021

In the Terraform AWS Provider, we're currently using APN/1.0 HashiCorp/1.0 Terraform/<terraform version> (+https://www.terraform.io) terraform-provider-aws/<provider version> (+https://registry.terraform.io/providers/hashicorp/aws).

We should replace the provider clause and leave the rest in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants