feat(scripts): make tenant id more prominent and improve logging in setup scripts - #2280
Merged
Merged
Conversation
MarcoDN
previously approved these changes
Sep 8, 2026
jefchien
reviewed
Sep 8, 2026
EduVencovsky
force-pushed
the
feat/aws-setup-role-arn
branch
from
September 9, 2026 19:14
64e7565 to
778a087
Compare
MarcoDN
reviewed
Sep 10, 2026
EduVencovsky
force-pushed
the
feat/aws-setup-role-arn
branch
from
September 10, 2026 15:10
0fb3f90 to
c1be627
Compare
jefchien
previously approved these changes
Sep 10, 2026
EduVencovsky
force-pushed
the
feat/aws-setup-role-arn
branch
from
September 10, 2026 15:30
c1be627 to
762ec35
Compare
jefchien
approved these changes
Sep 10, 2026
MarcoDN
approved these changes
Sep 10, 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.
Description of the issue
The onboarding setup scripts (
scripts/) had two usability gaps in the Azure-to-AWS flow:Wrong-account failure mode. The Azure-side setup takes the full IAM role ARN, but
aws/setup.shonly took a role name and trusted whatever account the shell was authenticated against. Running it in the wrong account's credential context created the role and trust there, and the failure only surfaced later — silently — on the assume-role side.Buried tenant ID. In the Azure VM flow, the tenant ID (the value the AWS trust step needs) was logged mid-output, after the minutes-long identity assignment, making it easy to miss and hard to copy. A mistyped VM name was also only discovered mid-run, via a raw CLI error from the identity step.
Description of changes
aws/setup.shnow also acceptsCWAGENT_AWS_ROLE_ARN. When set, it validates the ARN format, fails fast when the ARN's partition or account does not match the shell's credentials (sts get-caller-identity), and derives the role name from the ARN. ACWAGENT_AWS_ROLE_NAMEthat disagrees with the ARN is rejected; an agreeing or default-valued one is allowed (the dispatcher always exports the default). The interactive prompt now asks for an ARN, still accepting a plain role name or empty input for the default. A warning is printed if the resulting role differs from the provided ARN (e.g. an existing EC2 instance-profile role takes precedence). Validation runs before any IAM mutation.azure/setup.sh(azure_vm flow): theaz vm showprobe now fails fast with a clear message when the VM cannot be found (az's own stderr is preserved so permission or throttling errors are not misread as not-found); the tenant ID is emitted before the slow identity and install steps, so the user can start the AWS side in parallel; and it is repeated at the very end for easy copying — in the install-success message ("Agent installed on in tenant ") and above the next-steps text of the identity-only flow.README.md:CWAGENT_AWS_ROLE_ARNdocumented in the common environment variable table.No breaking changes: all existing inputs and flows behave as before when the new variable is unset.
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
make fmtandmake fmt-shmake lint