diff --git a/docs/user-guide/leverage-cli/install-leverage-cli.md b/docs/user-guide/leverage-cli/install-leverage-cli.md index ed3ac7af..c0bc30ce 100644 --- a/docs/user-guide/leverage-cli/install-leverage-cli.md +++ b/docs/user-guide/leverage-cli/install-leverage-cli.md @@ -55,14 +55,16 @@ Options: -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. + --help Show this message and exit. Commands: + aws Run AWS CLI commands in a custom containerized environment. credentials Manage AWS cli credentials. project Manage a Leverage project. run Perform specified task(s) and all of its dependencies. terraform Run Terraform commands in a custom containerized... tf Run Terraform commands in a custom containerized... + tfautomv Run TFAutomv commands in a custom containerized... ``` ##Installation in an isolated environment diff --git a/docs/user-guide/leverage-cli/reference/basic-features.md b/docs/user-guide/leverage-cli/reference/basic-features.md index 0c785308..6cd9b3bd 100644 --- a/docs/user-guide/leverage-cli/reference/basic-features.md +++ b/docs/user-guide/leverage-cli/reference/basic-features.md @@ -13,14 +13,16 @@ Options: -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. + --help Show this message and exit. Commands: + aws Run AWS CLI commands in a custom containerized environment. credentials Manage AWS cli credentials. project Manage a Leverage project. run Perform specified task(s) and all of its dependencies. terraform Run Terraform commands in a custom containerized... tf Run Terraform commands in a custom containerized... + tfautomv Run TFAutomv commands in a custom containerized... ``` Similarly, subcommands provide further information by means of the `--help` flag. For example `leverage tf --help`. @@ -39,5 +41,5 @@ Tasks in build file `build.py`: start_server [Default] Start the server stop_server -Powered by Leverage 1.0.10 +Powered by Leverage 1.9.0 ``` diff --git a/docs/user-guide/leverage-cli/reference/terraform.md b/docs/user-guide/leverage-cli/reference/terraform.md index 755c2310..b7955432 100644 --- a/docs/user-guide/leverage-cli/reference/terraform.md +++ b/docs/user-guide/leverage-cli/reference/terraform.md @@ -20,13 +20,16 @@ Equivalent to `terraform init`. All arguments given are passed as received to Terraform. -Can only be run at **layer** level. +Can only be run at **layer** level if `--layers` is not set, or at **account** or **layers-container-directory** if it is. [Layout validation](#validate-layout) is performed before actually initializing Terraform unless explicitly indicated against via the `--skip-validation` flag. ### Options * `--skip-validation`: Skips layout validation. +* `--layers`: Applies command to layers listed in this option. (see more info [here](./layers)) +!!! info "Regarding S3 backend keys" + If the S3 backend block is set, and no key was defined, Leverage CLI will try to create a new one autoatically and store it in the `config.tf` file. It will be based on the layer path relative to the account. --- ## `plan` @@ -40,7 +43,10 @@ Equivalent to `terraform plan`. All arguments given are passed as received to Terraform. -Can only be run at **layer** level. +Can only be run at **layer** level if `--layers` is not set, or at **account** or **layers-container-directory** if it is. + +### Options +* `--layers`: Applies command to layers listed in this option. (see more info [here](./layers)) --- ## `apply` @@ -54,7 +60,10 @@ Equivalent to `terraform apply`. All arguments given are passed as received to Terraform. -Can only be run at **layer** level. +Can only be run at **layer** level if `--layers` is not set, or at **account** or **layers-container-directory** if it is. + +### Options +* `--layers`: Applies command to layers listed in this option. (see more info [here](./layers)) --- ## `destroy` @@ -68,7 +77,10 @@ Equivalent to `terraform destroy`. All arguments given are passed as received to Terraform. -Can only be run at **layer** level. +Can only be run at **layer** level if `--layers` is not set, or at **account** or **layers-container-directory** if it is. + +### Options +* `--layers`: Applies command to layers listed in this option. (see more info [here](./layers)) --- ## `output` @@ -82,7 +94,10 @@ Equivalent to `terraform output`. All arguments given are passed as received to Terraform. -Can only be run at **layer** level. +Can only be run at **layer** level if `--layers` is not set, or at **account** or **layers-container-directory** if it is. + +### Options +* `--layers`: Applies command to layers listed in this option. (see more info [here](./layers)) --- ## `version` diff --git a/docs/user-guide/leverage-cli/reference/terraform/layers.md b/docs/user-guide/leverage-cli/reference/terraform/layers.md new file mode 100644 index 00000000..c68fcfff --- /dev/null +++ b/docs/user-guide/leverage-cli/reference/terraform/layers.md @@ -0,0 +1,107 @@ +# Layers parameter + +This parameter can be used with the following Leverage CLI Terraform commands: + +* `init` +* `plan` +* `apply` +* `output` +* `destroy` + +Value: + +| Parameter | Type | Description | +|:-----------|:-------|:--------------------------------------------------| +| `--layers` | string | A comma serparated list of layer's relative paths | + +## Common workflow + +When using the `--layers` parameter, these commands should be run from `account` or `layers-container-directory` directories. + +**Example:** + +For this structure: + +``` + + home + ├── user + │ └── project + │ └── management + │ ├── global + │ | └── security-base + │ | └── sso + │ └── us-east-1 + │ └── terraform-backend + +``` + +...any of the aforementioned commands, combined with `--layers`, can be called from `/home/user/project/management/`, `/home/user/project/management/global/` or `/home/user/project/management/us-east-1/`. + +The value for this parameter is a comma separated list of layer's relative paths. + +Leverage CLI will iterate through the layer's relative paths, going into each one, executing the command and going back to the original directory. + +**Example:** + +For this command, from `/home/user/project/management/`: + +```bash +leverage tf plan --layers us-east-1/terraform-backend,global/security-base +``` + +...the Leverage CLI will: + +* check each one of the layer's relative paths exists +* go into `us-east-1/terraform-backend` directory +* run the `plan` command +* go back to `/home/user/project/management/` +* go into `global/security-base` directory +* run the `plan` command +* go back to `/home/user/project/management/` + +## The `init` case + +When running `init` Leverage CLI runs a [validation](../terraform/#validate-layout). + +When using the `--layers` option, the validation is run for every layer before the command itself is run. + +**Example:** + +For this command, from `/home/user/project/management/`: + +```bash +leverage tf init --layers us-east-1/terraform-backend,global/security-base +``` + +...the Leverage CLI will: + +* check each one of the layer's relative paths exists +* go into `us-east-1/terraform-backend` directory +* run the `validate-layout` command +* go back to `/home/user/project/management/` +* go into `global/security-base` directory +* run the `validate-layout` command +* go back to `/home/user/project/management/` +* go into `us-east-1/terraform-backend` directory +* run the `init` command +* go back to `/home/user/project/management/` +* go into `global/security-base` directory +* run the `init` command +* go back to `/home/user/project/management/` + +This is done this way to prevent truncated executions. Meaning, if any of the validation fails, the user will be able to fix whatever has to be fixed and run the command again as it is. + +!!! info "Skipping the validation" + The `--skip-validation` flag still can be used here with `--layers`. + +## Terraform parameters and flags + +Terraform parameters and flags can still be passed when using the `--layers` parameter. + +**Example:** + + +```bash +leverage tf apply --layers us-east-1/terraform-backend,global/security-base -auto-approve +``` diff --git a/docs/user-guide/leverage-cli/reference/tfautomv.md b/docs/user-guide/leverage-cli/reference/tfautomv.md new file mode 100644 index 00000000..9c5b4174 --- /dev/null +++ b/docs/user-guide/leverage-cli/reference/tfautomv.md @@ -0,0 +1,29 @@ +# Command: `tfautomv` + +!!! info "Regarding Leverage Toolbox versions" + For using this feature Leverage Toolbox versions `1.2.7-0.0.5` and up, or `1.3.5-0.0.1` and up must be used. + +The `tfautomv` command is a wrapper for a containerized installation of [tfautomv](https://tfautomv.dev/). It provides the tfautomv executable with specific configuration values required by Leverage. + +It transparently handles authentication, whether it is Multi-Factor or via Single Sign-On, on behalf of the user in the commands that require it. SSO Authentication takes precedence over MFA when both are active. + +This command can only be run at **layer** level and will not run anywhere else in the project. + +--- +## `run` + +### Usage +``` bash +leverage tfautomv run [arguments] +``` + +Equivalent to `tfautomv`. + +All arguments given are passed as received to tfautomv. + +**Example:** + +```bash +leverage tfautomv run --show-analysis --dry-run +``` + diff --git a/docs/user-guide/ref-architecture-aws/workflow.md b/docs/user-guide/ref-architecture-aws/workflow.md index 7f69c38c..f823c1d2 100644 --- a/docs/user-guide/ref-architecture-aws/workflow.md +++ b/docs/user-guide/ref-architecture-aws/workflow.md @@ -17,6 +17,11 @@ 6. Run `leverage terraform plan` if you only mean to preview those changes 7. Run `leverage terraform apply` if you want to review and likely apply those changes +!!! info + Please note you can make use of the `--layers` parameter to apply Terraform commands to more than one layer. + + For more information see [here](../leverage-cli/reference/terraform/layers.md) + !!! note If desired, at step **#5** you could submit a PR, allowing you and the rest of the team to understand and review what changes would be made to your AWS Cloud Architecture components before executing diff --git a/docs/work-with-us/releases/versions-compatibility-matrix.md b/docs/work-with-us/releases/versions-compatibility-matrix.md index 42a70f2a..b6b8ed7e 100644 --- a/docs/work-with-us/releases/versions-compatibility-matrix.md +++ b/docs/work-with-us/releases/versions-compatibility-matrix.md @@ -11,12 +11,69 @@ component by component based on the below presented compatibility matrix table. ## Compatibility Matrix -| Leverage Ref Arch :construction_site: :cloud: version | Leverage Cli | Terraform | Terraform AWS provider | K8s EKS | -|-------------------------------------------------------|--------------|-----------|------------------------|-----------| -| v1.8.1 | v1.7.2 | >= 1.1.9 | 3.27.x, 4.x.y | 1.20-1.22 | -| v1.7.2 | v1.6.2 | >= 1.1.3 | 3.27.x, 4.x.y | 1.17-1.19 | -| ~~v1.3.73~~ | v1.2.0 | 1.0.x | 3.27.x | 1.17 | -| ~~v1.3.25~~ | v1.0.10 | 0.14.x | 3.27.x | 1.17 | +
Leverage Ref Arch version | +Leverage CLI | +Leverage Toolbox image version |
+ Terraform | +Terraform AWS provider | +K8s EKS | +
---|---|---|---|---|---|
v1.11.0 | +v1.9.x | +`binbash/leverage-toolbox` ==1.3.5-0.0.x |
+ 1.3.5 | +3.27.x, 4.x.y | +1.20-1.22 | +
`binbash/leverage-toolbox` ==1.2.7-0.1.x |
+ 1.2.7 | +3.27.x, 4.x.y | +1.20-1.22 | +||
v1.8.x | +`binbash/leverage-toolbox` ==1.2.7-0.0.x |
+ 1.2.7 | +3.27.x, 4.x.y | +1.20-1.22 | +|
v1.8.1 | +v1.7.2 | +`binbash/terraform-awscli-slim` >=1.1.9 |
+ 1.1.9 | +3.27.x, 4.x.y | +1.20-1.22 | +
v1.7.2 | +v1.6.2 | +`binbash/terraform-awscli-slim` >=1.1.3 |
+ 1.1.3 | +3.27.x, 4.x.y | +1.17-1.19 | +
v1.2.0 | +`binbash/terraform-awscli-slim` >=1.0.x |
+ 1.0.x | +3.27.x | +1.17 | +|
v1.0.10 | +`binbash/terraform-awscli-slim` >=0.14.x |
+ 0.14.x | +3.27.x | +1.17 | +