This repository contains all OpenTofu/Terraform configuration files used to create Binbash Leverage Reference AWS Cloud Solutions Architecture.
Check out the Binbash Leverage Reference Architecture Official Documentation.
In order to get the full automated potential of the
Binbash Leverage DevOps Automation Code Library
you should follow the steps below:
-
Install and use the
leverage cli -
Update your configuration files
-
Review and assure you meet all the OpenTofu/Terraform AWS pre-requisites
- AWS Credentials (Including your MFA setup)
- Run
leverage aws sso loginto setup the credentials.
- Run
- Initialize your accounts OpenTofu/Terraform State Backend
- AWS Credentials (Including your MFA setup)
-
Follow the standard
leverage cliworkflow- Get into the folder that you need to work with (e.g.
/security/global/base-identities) - Run
leverage tf init - Make whatever changes you need to make
- Run
leverage tf plan(if you only mean to preview those changes) - Run
leverage tf apply(if you want to review and likely apply those changes) - Repeat for any desired Reference Architecture layer
- Get into the folder that you need to work with (e.g.
The backend.tfvars will inject the profile name with the necessary permissions that OpenTofu/Terraform will
use to make changes on AWS.
- Such profile is usually one that relies on another profile to assume a role to get access to each corresponding account ( AWS IAM: users, groups, roles & policies )
- Read the following AWS page doc to understand how to set up a profile to assume a role
This repository includes pre-configured settings for AI-powered development tools to enhance productivity and maintain consistency across the codebase.
-
Cursor IDE - AI-first code editor with project-specific rules
.cursor/rules/- Markdown rules for OpenTofu/Terraform best practices.cursor/mcp.json- MCP server configurations for AWS and OpenTofu/Terraform documentation
-
Kiro IDE - AI development environment with steering documents
.kiro/steering/- Comprehensive documentation about the project structure, tech stack, and best practices.kiro/settings/mcp.json- MCP configurations for enhanced AWS/OpenTofu/Terraform support
-
Claude Code - Anthropic's AI coding assistant
These configurations are automatically loaded when you open the project in the respective IDE/tool. 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 OpenTofu/Terraform registry
╭─ ~/ref-architecture/le-tf-infra-aws on master · ✔ at 12:13:36
╰─ leverage
Usage: leverage [OPTIONS] COMMAND [ARGS]...
Leverage Reference Architecture projects command-line tool.
Options:
-f, --filename TEXT Name of the build file containing the tasks
definitions. [default: build.py]
-l, --list-tasks List available tasks to run.
-v, --verbose Increase output verbosity.
--version Show the version and exit.
-h, --help Show this message and exit.
Commands:
credentials Manage AWS CLI credentials.
project Manage a Leverage project.
run Perform specified task(s) and all of its dependencies.
terraform Run Terraform commands through the Leverage CLI
tofu Run OpenTofu commands through the Leverage CLI
tf Short form of the "tofu" command╭─ ~/ref-architecture/le-tf-infra-aws on master · ✔ at 12:13:36
╰─ leverage tofu
Usage: leverage tofu [OPTIONS] COMMAND [ARGS]...
Run OpenTofu commands through the Leverage CLI in order to obtain
additional functionality such as automatic AWS credentials injection or
config files autoloading.
All OpenTofu subcommands and their flags/arguments will be passed on to
the OpenTofu binary. For example the following:
- leverage tf init -reconfigure
- leverage tofu apply -auto-approve
Options:
-h, --help Show this message and exit.
Commands:
apply Build or change the infrastructure in this layer.
aws Run a command in AWS cli.
destroy Destroy infrastructure in this layer.
format Check if all files meet the canonical format and rewrite them...
import Import a resource.
init Initialize this layer.
output Show all output variables of this layer.
plan Generate an execution plan for this layer.
shell Open a shell into the Leverage toolbox container in this layer (deprecated).
validate Validate code of the current directory.
version Print version.