Skip to content

Add --account flag for account selection in lstk aws - #440

Merged
peter-smith-phd merged 5 commits into
mainfrom
devx-1039-aws-account-option
Aug 10, 2026
Merged

Add --account flag for account selection in lstk aws#440
peter-smith-phd merged 5 commits into
mainfrom
devx-1039-aws-account-option

Conversation

@peter-smith-phd

@peter-smith-phd peter-smith-phd commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Motivation

Prior to this PR, lstk terraform and lstk sam had accepted --account to target a specific LocalStack account, but lstk aws did not support --account. It did support the AWS_ACCESS_KEY_ID environment variable, but that only worked on a fresh machine and then silently stopped once lstk setup aws was run (to create config.toml). This happened because lstk was passing --profile localstack, which caused Botocore to ignore all the environment variables.

Solution

This PR adds lstk aws --account <12 digits>, following the terraform/sam convention.

Also included are some smaller fixes found along the way, thanks for exhaustive manual testing:

  • terraform's S3 backend provisioning had been ignoring the resolved account, creating the state bucket in a different account than the generated backend block addressed.
  • lstk sam --region was silently overridden by a region in samconfig.toml; it is now also passed on sam's command line, and only when explicitly given.
  • lstk's leading flags now parse in any order relative to the wrapped tool's own — lstk aws --region X --account Y … used to leak --account to the AWS CLI, while the reverse order worked.
Docs
  • New lstk aws --account <id> — 12 digits, before the AWS service name, falling back to AWS_ACCESS_KEY_ID then the default 000000000000.
  • lstk sam --region now takes effect over samconfig.toml; without the flag, samconfig.toml still decides.

Help text is updated in place; lstk docs regenerates from it.

Closes DEVX-1039

Co-Authored-By: Claude noreply@anthropic.com

@peter-smith-phd peter-smith-phd added semver: minor docs: needed Pull request requires documentation updates labels Aug 9, 2026
peter-smith-phd and others added 4 commits August 11, 2026 07:10
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@peter-smith-phd
peter-smith-phd force-pushed the devx-1039-aws-account-option branch from 0498527 to ea417bc Compare August 10, 2026 19:11
Co-Authored-By: Claude <noreply@anthropic.com>
@peter-smith-phd
peter-smith-phd marked this pull request as ready for review August 10, 2026 19:23
@peter-smith-phd
peter-smith-phd requested a review from a team as a code owner August 10, 2026 19:23
@peter-smith-phd
peter-smith-phd merged commit 07e27f0 into main Aug 10, 2026
19 checks passed
@peter-smith-phd
peter-smith-phd deleted the devx-1039-aws-account-option branch August 10, 2026 19:33
skyrpex added a commit that referenced this pull request Aug 11, 2026
Comment thread cmd/aws.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: needed Pull request requires documentation updates semver: minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants