Skip to content

Respect AWS_PROFILE in config loading - #35

Open
Cool-fire wants to merge 1 commit into
mainfrom
gambits/ses_f9668805606f422a-f90431c750c2
Open

Respect AWS_PROFILE in config loading#35
Cool-fire wants to merge 1 commit into
mainfrom
gambits/ses_f9668805606f422a-f90431c750c2

Conversation

@Cool-fire

Copy link
Copy Markdown
Owner

Why
The CLI currently calls config.LoadDefaultConfig without forwarding an explicit shared config profile. In multi-account environments that can cause scale operations to run against the wrong AWS account when operators rely on AWS_PROFILE.

What changed

  • read AWS_PROFILE in pkg/service.NewConfig
  • pass config.WithSharedConfigProfile(profile) only when the env var is non-empty
  • preserve existing default credential-chain behavior when no profile is set
  • add focused regression tests covering both the profile-set and profile-unset paths

Verification

  • Intended command: go test ./...
  • Result in this sandbox: could not run because the environment does not have go or gofmt installed (/usr/bin/bash: go: command not found)

Notes

  • The tests stub the config loader and assume-role provider so they verify profile selection without requiring live AWS credentials or network access.

Files changed

pkg/service/service.go      | 15 ++++++--
 pkg/service/service_test.go | 83 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 2 deletions(-)

Session

View session

Generated by Gambits Staging

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant