Skip to content

Use scaling region during AWS config bootstrap - #36

Open
Cool-fire wants to merge 2 commits into
mainfrom
gambits/ses_9b82484895964a30-b9cd2b091524
Open

Use scaling region during AWS config bootstrap#36
Cool-fire wants to merge 2 commits into
mainfrom
gambits/ses_9b82484895964a30-b9cd2b091524

Conversation

@Cool-fire

Copy link
Copy Markdown
Owner

This change fixes startup when the AWS region environment variables are unset.

Why:
pkg/service.NewConfig previously called config.LoadDefaultConfig without a region, then used that config to create the STS client for AssumeRole. When AWS_REGION or AWS_DEFAULT_REGION was missing, the bootstrap path could fail before the per-region config value was applied, even though each scaling target already provides its own region.

What changed:

  • load the default AWS config with config.WithRegion(region) when a scaling region is provided
  • preserve the existing default config/profile behavior when no region is passed
  • add a focused unit test covering missing region env vars

Verification:

  • go test ./... -> could not run in this sandbox because go is not installed (/usr/bin/bash: line 1: go: command not found)
  • make -> could not run in this sandbox because go is not installed (/bin/sh: 1: go: not found)
  • gofmt -w "pkg/service/service.go" "pkg/service/service_test.go" -> could not run in this sandbox because gofmt is not installed (/usr/bin/bash: line 1: gofmt: command not found)

Limitations:
The code and test were updated, but formatting/build/test verification still needs to be run in an environment with the Go toolchain installed.

Files changed

pkg/service/service.go      | 10 +++++++++-
 pkg/service/service_test.go | 21 +++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

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