{{ message }}
chore(provisioner/terraform): preserve existing AWS_SDK_UA_APP_ID (#24606)#26474
Merged
Conversation
This was referenced Jun 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Backports the Terraform provisioner change to preserve an operator’s pre-existing AWS_SDK_UA_APP_ID by appending Coder’s AWS PRM identifier (space-delimited per AWS guidance), instead of unconditionally overwriting it in the subprocess environment.
Changes:
- Adds helpers/constants to compute an
AWS_SDK_UA_APP_ID=...env entry based on inherited environment state. - Updates Terraform subprocess env construction to use the new logic instead of a hard-coded value.
- Adds unit tests for the new helpers.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+59
to
+67
| func safeEnvironValue(env []string, name string) string { | ||
| prefix := name + "=" | ||
| for _, e := range env { | ||
| if strings.HasPrefix(e, prefix) { | ||
| return strings.TrimPrefix(e, prefix) | ||
| } | ||
| } | ||
| return "" | ||
| } |
Comment on lines
+12
to
+18
matifali
approved these changes
Jun 17, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #24606 to
release/2.29.Original PR: #24606 — chore(provisioner/terraform): preserve existing AWS_SDK_UA_APP_ID
Merge commit: 9d28489
Requested by: @matifali (per Slack thread, ESR 2.29 included)
Stacking
2.29 is outside the auto-backport workflow's scope (latest 3 release branches), so this is cherry-picked manually. Because #24606 builds on #23138 (it replaces the literal
AWS_SDK_UA_APP_ID=...line introduced there), this PR is stacked on top of #26473.Once #26473 merges into
release/2.29, please retarget this PR's base frombackport/23138-to-2.29torelease/2.29.The cherry-pick applied cleanly with no manual conflict resolution needed (
provision.goauto-merged once #23138 was in place;safeenv.goand the newsafeenv_internal_test.gohad no overlap with 2.29).go test -run 'TestProvision_SafeEnv|TestSafeEnvironValue|TestAWSSDKUserAgentEnv' ./provisioner/terraform/passes locally.Cherry-picked by Coder Agents on behalf of @DevelopmentCats.