This repository contains all OpenTofu/Terraform configuration files used to create the Binbash Leverage Reference AWS Cloud Solutions Architecture.
- Binbash Leverage Reference Architecture Official Documentation
- Leverage CLI (PyPI)
- Binbash Module Library
- Leverage CLI (v2.2.0+)
- OpenTofu (>= 1.6)
- AWS SSO access configured for the target accounts
- uv (recommended for Python/Leverage CLI management)
pip install leverageuv provides fast, reproducible Python environments without conflicting with system packages.
# Create a Python 3.12 virtual environment
uv venv --python 3.12 .venv
# Install the latest Leverage CLI release (or a specific version/pre-release)
uv pip install leverage
# For pre-release/release candidates:
# uv pip install --pre leverage==2.2.0rc5
# Activate the environment
source .venv/bin/activate
# Verify
leverage --versionNote: Leverage CLI v2.2.0+ runs OpenTofu natively (no Docker required). You need the
tofubinary installed locally (e.g.,brew install opentofuon macOS).
-
Authenticate with AWS SSO:
leverage aws sso login
-
Navigate to the layer you want to work with:
cd {account}/{region}/{layer} # e.g., security/global/base-identities
-
Follow the standard workflow:
leverage tofu init leverage tofu plan leverage tofu apply
-
Repeat for any desired Reference Architecture layer.
The backend.tfvars injects the AWS profile name with the necessary permissions that OpenTofu uses to make changes on AWS. This profile relies on AWS SSO to assume a cross-account role for each corresponding account (AWS IAM: users, groups, roles & policies).
Configuration files are automatically loaded by the Leverage CLI:
config/common.tfvars- Project-wide variables (project name, account IDs, SSO config){account}/config/account.tfvars- Account-specific variables (environment, SSO role){account}/config/backend.tfvars- Backend configuration (S3 bucket, profile, DynamoDB table)
For more details, see the configuration files documentation and the standard workflow.
This repository includes pre-configured settings for AI-powered development to enhance productivity and maintain consistency across the codebase. Claude Code is the team's standard AI development tool — it is the only AI tooling configuration maintained here.
- Claude Code - Anthropic's AI coding assistant
CLAUDE.md- Project instructions and context for Claude.claude/agents/- Specialized agent definitions (architect, security, terraform-layer, etc.).mcp.json- Root-level MCP server configurations (AWS API, AWS Documentation)
These configurations are discovered when you open the project in Claude Code. CLAUDE.md and
.claude/agents/ load automatically, but the project-scoped MCP servers in .mcp.json
require explicit approval before first use — until approved they show as pending in
claude mcp list. The aws-api server additionally needs valid credentials for the
bb-shared-devops profile (leverage aws sso login), and is restricted to read-only AWS
operations via READ_OPERATIONS_ONLY.
They provide:
- Context-aware code suggestions aligned with Leverage best practices
- AWS- and OpenTofu/Terraform-specific assistance
- Consistent code formatting and structure guidelines
- Direct access to AWS documentation and the AWS API
Every PR is reviewed by CodeRabbit AI and Gemini Code Assist (both
auto-trigger on open / sync), gated by CI checks (Test and Lint, Infracost,
GitGuardian), and can be inspected on demand by @claude — which routes
through Amazon Bedrock (Anthropic Claude Sonnet 4.6) rather than the public
Anthropic API, so prompts and code stay inside our apps-prd AWS account.
See docs/ai-sdlc/ for the full workflow, configuration knobs,
and architecture diagrams.
Local Claude Code sessions can also route through Amazon Bedrock in the
data-science account on demand — via a claude-bedrock launcher that flips a
single session to Bedrock while plain claude keeps using the native Anthropic
API. Setup, model entitlements/quotas, and troubleshooting:
docs/ai-sdlc/claude-code-bedrock.md.
leverage --help # Show all commands
leverage --version # Show version
leverage aws sso login # Authenticate with AWS SSO
leverage run <task> # Run a build.py task (e.g., layer_dependency, decrypt, encrypt)leverage tofu init # Initialize the layer
leverage tofu plan # Preview changes
leverage tofu apply # Apply changes
leverage tofu destroy # Destroy infrastructure
leverage tofu format # Format code (always recursive)
leverage tofu format -check # Check formatting without rewriting
leverage tofu validate # Validate configuration
leverage tfis a shorthand alias forleverage tofu. Both run OpenTofu.The wrapper exposes only a curated subset of subcommands:
apply,destroy,force-unlock,format,import,init,output,plan,refresh-credentials,validate,validate-layout,version. Note it isformat, notfmt— andformatis already recursive, being equivalent totofu fmt -recursive. See the leverage tofu reference. That page does not currently coverforce-unlockorrefresh-credentials; the list above comes fromleverage tofu --helpon the pinned CLI, which is the authority.For anything else —
state,show,console,providers,workspace,graph,get,test— run the nativetofubinary from the layer directory, loading the AWS profile from the layer'sconfig/backend.tfvars:tofu state list # List resources in state tofu state show <res> # Show a specific resource in state