Terragrunt Modules that install VMware Tanzu Products. This uses terraform modules from https://github.com/tanzu-end-to-end/tanzify-infrastructure
Using best practices for using Terraform, the modules here currently support installing the following VMware Tanzu products:
Product | AWS | GCP | Azure | vSphere |
---|---|---|---|---|
Tanzu Application Service (a.k.a PAS) | ✅ | ✅ | ✅ | ❌ |
Tanzu Kubernetes Grid Integrated (a.k.a PKS) | ✅ | ✅ | ✅ | ❌ |
It also supports installing the following Tiles.
Tile |
---|
Harbor Container Registry |
MySQL |
RabbitMQ |
Redis |
Pivotal Cloud Cache |
Spring Cloud Services 3 |
Spring Cloud Data Flow |
Metrics |
Healthwatch |
Credhub Service Broker |
Pivotal Anti-Virus |
Spring Cloud Gateway |
SSO |
Note: Not all versions of tiles have been tested, so your mileage may vary. Take a look the https://github.com/tanzu-end-to-end/tanzify-infrastructure/tree/master/tile-install-configure/configuration to see supported tile configs.
This uses terraform modules from https://github.com/tanzu-end-to-end/tanzify-infrastructure
More details on why is detailed in the Terragrunt docs here and here
- Terraform 0.13+
- Terragrunt 0.24.0+
- LastPass CLI installed if you are using it as your secret store.
- Clone this repo into another directory
git clone https://github.com/abhinavrau/tanzify-arau-live.git tanzify-username-live
-
This repo has one example each for AWS, Azure and GCP. Keep the directory for the cloud provider you want and remove the others. Rename the region and
demo1
directories to suit your needs. -
Modify the following files for the cloud provider/region/AZs you are targeting:
account.hcl
region.hcl
env.hcl
-
Secrets:
- If Using LastPass, install & configure LastPass CLI
- Store your secrets (Cloud provider credentials, Opsman password and Pivnet token) in LastPass. Take a look at one of the
terragrunt.hcl
files in the the0_secrets
directory for an example. - Modify the LastPass item ID in the
.hcl
files under the0_secrets
directory for the relevant secret. Hint: Uselpass ls | grep itemname
to find item ID. export LASTPASS_PASSWORD="~/.lpass"
andexport LASTPASS_USER="lastpassuserid"
- cd
_scripts
- run
./0_apply_secrets.sh
to make secrets are being fetched correctly.
-
Pave Network and Storage:
- From
_scripts
directory run1_apply_infra
- From
-
Install OpsMan
- Modify
1_opsman-compute/opsman_vars.hcl
to reflect the version and build of Opsman to use. - From
_scripts
directory run2_apply_infra
to install OpsMan and BOSH director
- Modify
-
Install Tiles
-
Modify
1_tkgi-install-configure/tkgi_vars.hcl
to reflect the version of TKGI to install. -
Modify
2_tas-install-configure/tas4vms_vars.hcl
to reflect the version of TAS to install. -
Modify
3_harbor-install-configure/harbor_vars.hcl
to reflect the version of Harbor to install. -
From
_scripts
directory run3_apply_tiles.sh
to install TAS/TKGI/Harbor -
To Install other tiles, take a look at the
3_harbor-install-configure/terragrunt.hcl
and tile configurations under the terraform moduletanzify-infrastructure/tile-install-configure/configuration
-
- Running
./0_apply_secrets.sh
throwing errors. Possible Fix: LastPass CLI may have logged you out. Runlpass login
- Something went wrong with a module and I need to run it again.
Possible Fix: Navigate to the directory with the problem and remove the
.terragrunt-cache
directory which will refecth the module and reset your state. You can runfind . -type d -name ".terragrunt-cache" -prune -exec rm -rf {} \;
to recuresively delete the .terragrunt-cache directories.
To delete the installation completely including OpsMan and all Tiles, follow these steps:
- From
_scripts
directory run./ssh_opsman.sh
to login to OpsMan - Run
destroy_opsman
to delete all tiles including BOSH Director. Runexit
- Navigate to
2_opsman
directory. Runterragrunt destroy-all --terragrunt-non-interactive
to destroy the opsman VM. - Navigate to
1_infra
directory. Runterragrunt destroy-all --terragrunt-non-interactive
to delete all the cloud network resources.
If you don't have the previous terragrunt state directories (or deleted them by mistake) and terragrunt can't destroy the resources. you can use leftovers
GCP:
leftovers --iaas=gcp --gcp-service-account-key=path/to/serviceaccount.json --filter=<environment-name>
AWS:
leftovers --iaas=aws --aws-access-key-id=<..> --aws-secret-access-key=<..> --aws-region=<region>> --filter=<environment-name>
Azure:
leftovers --iaas=azure --azure-client-id=<...> --azure-client-secret=<..> --azure-tenant-id=<..> --azure-subscription-id=<..> --filter=<environment-name>
The environment-name is the same as the resource group name in Azure.
Distributed under the MIT License. See LICENSE
for more information.
This project could not have possible without awesome code from the following repos: