feat: add AWS PRM user-agent attribution for partner revenue tracking (#23138)#24052
Merged
Conversation
…#23138) Sets `AWS_SDK_UA_APP_ID` in the Terraform provisioner environment so that all AWS API calls made during workspace builds include Coder's AWS Partner Revenue Measurement (PRM) attribution in the user-agent header. This enables AWS to attribute resource usage driven by Coder back to us as an AWS partner across all deployments. ## How it works - `provisionEnv()` now unconditionally sets `AWS_SDK_UA_APP_ID=APN_1.1/pc_cdfmjwn8i6u8l9fwz8h82e4w3$` in the environment passed to `terraform plan` and `terraform apply` - The Terraform AWS provider picks this up and appends it to the user-agent header on every AWS API call - If a customer has already set `AWS_SDK_UA_APP_ID` in their environment (e.g. via `coder.env`), we don't override it - Templates that don't use the AWS provider are unaffected — the env var is simply ignored ## Notes - The product code is hardcoded in the source. It may be worth obfuscating this value (e.g. via `-ldflags -X` at build time) to keep it out of the public repo, though it is technically a public identifier. - This covers user-agent attribution only. Resource-level `aws-apn-id` tags for cost allocation are a separate effort that requires template changes. ## References - [AWS SDK Application ID docs](https://docs.aws.amazon.com/sdkref/latest/guide/feature-appid.html) - [AWS PRM Automated User Agent](https://prm.partner.aws.dev/automated-user-agent.html) (partner login required) --------- Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com> Co-authored-by: DevCats <christofer@coder.com> (cherry picked from commit 5ff1058)
matifali
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #23138
Original PR: #23138 — feat: add AWS PRM user-agent attribution for partner revenue tracking
Merge commit: 5ff1058