You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
spawn dns and spawn cost still sign with the ambient AWS profile, ignoring --profile #967
#966 adds a gate (TestCommandsLoadAWSConfigThroughTheSharedLoader) that forbids package cmd from calling the SDK's config.LoadDefaultConfig directly, and routes every such site through the shared loader. The gate covers cmd only. Two pkg/ constructors that CLI commands call still load the ambient config themselves, so the root --profile (and SPORE_PROFILE) do not reach them:
dns.NewClient (pkg/dns/client.go). spawn dns register and spawn dns deregister (cmd/dns.go) resolve the instance and account ID with a client that honours --profile. They then sign the DNS API request with the ambient credentials. With --profile other-account and a different ambient profile, the record is computed for one account and the request is signed by another. The signing region comes from the endpoint hostname, so region is fine. Only the identity is wrong.
The pkg/cost default on-demand pricer (onDemandPricerOrDefault, pkg/cost/cost.go). spawn cost builds its DynamoDB client through the shared loader since Make spawn burst and every other command honour --region and --profile (#939) #966, but the lazy pricer loads its own ambient config. With only --profile credentials available, compute costs are reported as unpriced.
Not affected: the on-instance callers of dns.NewClient (spored), which have no flags.
Suggested: let both take an aws.Config (or a credentials provider) from the caller, as #966 did for registry.EnsureTable. Then consider extending the gate to pkg/ functions that cmd calls, if that can be discovered rather than listed.
Verified by reading the code only. Nothing was run against AWS.
Activity
fix(dns,cost): honour --profile when signing; blank dns help; dns del…
test(dns): dns delete refuses on an unreadable /spawn/dns/* under --p…
fix(dns,cost): honour --profile when signing; dns help and dns delete…