Repository navigation
Description
Summary
While bootstrapping a brand new Leverage project with CLI 3.0.0 against a standalone AWS account (no AWS Organizations enabled) using mx-central-1 as the primary region, four distinct issues surfaced back-to-back during a single setup session. They block the documented try-leverage flow (Configure Bootstrap Credentials).
Filing as one umbrella issue for context; happy to split into 4 sub-issues if maintainers prefer.
Environment
| Item | Value |
|---|---|
| Leverage CLI | 3.0.0 |
| Toolbox image | binbash/leverage-toolbox:1.9.1-tofu-0.3.0 |
| AWS account type | Standalone, no AWS Organizations enabled (legacy) |
| Primary region | mx-central-1 |
| OS | macOS (Apple Silicon, /opt/homebrew) |
build.env |
PROJECT=<proj> / TERRAFORM_IMAGE_TAG=1.9.1-tofu-0.3.0 |
Identifiers in logs sanitized:
<proj>for the project code,<user>for paths, keys/secrets redacted.
Bug 1 — credentials configure --type BOOTSTRAP fails because the AWS credentials/config files aren't created
Repro
leverage --verbose credentials configure --type BOOTSTRAPObserved
[12:37:01.538] DEBUG Found config file
/Users/<user>/.../<proj>/Infra-aws/build.env
[12:37:01.585] INFO Reading info from project.yaml
[12:37:01.586] INFO Loading configuration file.
[12:37:01.591] INFO Loading project environment configuration file.
INFO Loading tf common configuration.
> Credentials default region: mx-central-1
[12:37:17.141] DEBUG Running command: /opt/homebrew/bin/aws configure list --profile <proj>-bootstrap
[12:37:17.143] DEBUG Working directory: /Users/<user>/.../<proj>/Infra-aws
[12:37:17.144] DEBUG Additional environment variables: {'AWS_SHARED_CREDENTIALS_FILE':
'/Users/<user>/.aws/<proj>/credentials', 'AWS_CONFIG_FILE': '/Users/<user>/.aws/<proj>/config'}
[12:37:17.604] ERROR Command execution failed: The config profile (<proj>-bootstrap) could not be found
Expected
leverage credentials configure --type BOOTSTRAP should bootstrap the AWS credentials and config files at AWS_SHARED_CREDENTIALS_FILE / AWS_CONFIG_FILE paths it points aws configure list at — or fail with a clearer error before invoking the AWS CLI against a profile it has not yet created.
Likely cause
The CLI invokes aws configure list --profile <proj>-bootstrap against ~/.aws/<proj>/credentials and ~/.aws/<proj>/config, but those files don't exist yet (the project directory ~/.aws/<proj>/ itself appears to not be created). The AWS CLI then fails because there is nothing to read.
Workaround (in use)
Manually create the directory and empty files, then set the profile name in credentials:
mkdir -p ~/.aws/<proj>
touch ~/.aws/<proj>/credentials ~/.aws/<proj>/config
# add [<proj>-bootstrap] section to credentials before re-runningBug 2 — leverage credentials configure --type BOOTSTRAP calls organizations:ListAccounts on a standalone account
Repro
After applying the Bug 1 workaround, run:
leverage credentials configure --type BOOTSTRAP
# select "Manually" and paste programmatic key + secretObserved
[12:52:01.458] INFO Backing up credentials file.
[12:52:01.463] DEBUG Running command: /opt/homebrew/bin/aws configure set aws_access_key_id ... --profile <proj>-bootstrap
[12:52:01.908] DEBUG Running command: /opt/homebrew/bin/aws configure set aws_secret_access_key ... --profile <proj>-bootstrap
[12:52:02.201] INFO Bootstrap credentials configured in: /Users/<user>/.aws/<proj>/credentials
[12:52:02.202] DEBUG Running command: /opt/homebrew/bin/aws sts get-caller-identity --profile <proj>-bootstrap
[12:52:05.548] INFO Attempting to fetch organization accounts.
[12:52:05.549] DEBUG Running command: /opt/homebrew/bin/aws organizations list-accounts --output json --profile <proj>-bootstrap
[12:50:58.857] ERROR Command execution failed: An error occurred (AWSOrganizationsNotInUseException) when
calling the ListAccounts operation: Your account is not a member of an organization.
Expected
The bootstrap flow should either:
- detect that the target account is not a member of an AWS Organization (e.g. handle
AWSOrganizationsNotInUseExceptionfromorganizations:DescribeOrganization/ListAccounts) and continue gracefully with a single-account bootstrap path; or - fail early with a clear, actionable message that explains the prerequisite (account must be the management account of an Organization, or pre-create one).
Notes
This came up on a legacy standalone account that has not had AWS Organizations enabled. OJ confirmed in Slack that this case likely isn't covered yet.
Bug 3 — Malformed config.tf file. Unable to parse. on a clean layer
Repro
In <proj>/Infra-aws/management/mx-central-1/base-tf-backend:
leverage -vvvv tf init --skip-validationObserved
[13:47:17.737] DEBUG Found config file
/Users/<user>/.../<proj>/Infra-aws/build.env
[13:47:18.065] DEBUG Checking for layer
/Users/<user>/.../<proj>/Infra-aws/management/mx-central-1/base-tf-backend...
[13:47:18.066] DEBUG Checking layer
/Users/<user>/.../<proj>/Infra-aws/management/mx-central-1/base-tf-backend...
[13:47:18.068] ERROR Malformed config.tf file. Unable to parse.
config.tf (unmodified from the layer template)
#=============================#
# AWS Provider Settings #
#=============================#
provider "aws" {
region = var.region
profile = var.profile
}
provider "aws" {
alias = "main_region"
region = var.region
profile = var.profile
}
provider "aws" {
alias = "secondary_region"
region = var.region_secondary
profile = var.profile
}
terraform {
required_version = "~> 1.2"
required_providers {
aws = "~> 5.0"
}
# # Uncomment after first `apply`
# backend "s3" {
# key = "management/mx-central-1/tf-backend/terraform.tfstate"
# # key = "management/tf-backend/terraform.tfstate"
# }
}Expected
The file is valid HCL — terraform validate / tofu validate parse it without errors, and CLI 2.x parses it fine. CLI 3.0.0's layer parser should accept it as well.
Workaround (in use)
Downgrading the CLI to 2.1.1 removes the error and the layer initializes.
Hypothesis
CLI 3.0.0 introduced a stricter / different config.tf parser that rejects this template. Worth checking whether the parser tolerates:
- multiple
provider "aws"blocks withalias, - a fully commented-out
backend "s3"block, - the
~> 1.2/~> 5.0constraint syntax.
Bug 4 — Toolbox 1.9.1-tofu-0.3.0 rejects mx-central-1 in backend validation
Observed
mx-central-1 is valid AWS, but your binbash/leverage-toolbox:1.9.1-tofu-0.3.0
backend validation is too old to recognize it
Expected
The toolbox region validator should accept any region that is currently valid in AWS, or — at minimum — be configurable to skip validation cleanly without forcing a per-layer override.
Workaround (in use)
Add skip_region_validation = true to backend configs:
management/config/backend.tfvars(line 14)security/config/backend.tfvars(line 14)shared/config/backend.tfvars(line 14)
Note
This is in the toolbox, not the CLI itself, so the fix likely belongs in binbash/leverage-toolbox (and/or whatever pins the AWS provider/SDK version it uses for region validation). Tracking it here so the bootstrap experience is fixed end-to-end.
Suggested next steps
- Bug 1 + Bug 2 — patch the bootstrap flow to (a) ensure
~/.aws/<project>/{credentials,config}are created before anyawsinvocation, and (b) handleAWSOrganizationsNotInUseExceptiongracefully (skip theListAccountsstep on standalone accounts and continue with a single-account bootstrap path). - Bug 3 — diff the CLI 2.1.1 vs 3.0.0 layer /
config.tfparser and add a regression test for the standardbase-tf-backendtemplate. - Bug 4 — bump or relax the toolbox region allow-list so newer regions like
mx-central-1,il-central-1, etc. don't requireskip_region_validation = trueper layer. - Add a short note to the
try-leveragedocs: known limitations on standalone (non-Org) AWS accounts and on regions that the toolbox version may not yet recognize.
References
- Try Leverage docs — Configure Bootstrap Credentials: https://leverage.binbash.co/try-leverage/leverage-project-setup/#configure-bootstrap-credentials
- Originally reported by Matias Rodriguez (binbash) in
#leverageSlack thread, May 2026.
cc: Angelo Fenoglio (CLI), OJ (triage) — please add GitHub handles when assigning.
Activity