Terraform modules with ready-to-run GitHub Actions workflows for provisioning across AWS and VMware vSphere.
- Overview
- Architecture at a glance
- Features
- Deploying a Virtual Machine using Terraform
- Prerequisites
- Quick start
- Repository structure
- Integration with the Packer repository vSphere modules only
- Executing the IAC Actions
- Secrets and inputs
- Troubleshooting
- Licence
- Security
- Contributing
- Support
This repository is the second part of an infrastructure as code pipeline and uses Terraform to deploy virtual machines and other resources. It works alongside the companion Packer for vSphere repository, which builds VM templates consumed by the vSphere modules here. There are also modules that do not rely on Packer, including AWS modules for VPCs and EKS.
Note
Inside you will find multiple Terraform modules that provision and customise resources across providers such as AWS and VMware. Each module includes its own README with usage and prerequisites. Read the per-module README before running any workflow.
- Terraform modules for AWS and VMware vSphere
- GitHub Actions workflows that compose a
main.tfdynamically and run Terraform on a runner - Provider credentials and variables supplied via repository or organisation secrets
- Optional integration with Packer-built vSphere templates
- Opinionated modules for common patterns such as AWS VPC and EKS, and vSphere VM deployment from templates
- Workflows that:
- generate a tailored
main.tfto wire the chosen module - run
terraform init,planandapplyon a GitHub runner
- generate a tailored
- Inputs and secrets driven configuration to avoid hard-coding credentials
- Modular layout encouraging reuse across environments
Use one of the vSphere modules to deploy a VM from a Packer template and customise it. The provided Actions keep Terraform execution inside CI on a GitHub runner.
- Platform prerequisites prepared in advance
- VMware: VLANs or networks, folders, resource pools and required permissions
- AWS: IAM permissions, regions and any prerequisite networking if not created by the module
- A copy of this repository in your GitHub account with Actions enabled
- Access to required repository or organisation secrets
- Familiarity with this repository’s structure and the module you plan to run
- To clone with the CLI:
git clone https://github.com/sudo-kraken/multiplatform-terraform-module-actions.git
- Fork or clone this repository.
- Review the README in the target module under
modules/. - Configure the necessary secrets in your repository or organisation.
- From the Actions tab, choose the workflow for your target module and run it with the required inputs.
.
├── .github/ # GitHub Actions workflows
├── modules/ # Terraform modules by provider or purpose
├── .devcontainer/ # Optional devcontainer setup
├── .vscode/ # Editor settings
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── SECURITY.md
└── README.md
The vSphere modules expect VM templates produced by the companion Packer repository. Build and publish up-to-date templates to vSphere before running VM deployment modules here.
The workflows generate a custom main.tf for the selected module and execute Terraform. In summary they:
- Generate a
main.tfthat wires provider configuration and the chosen module with your inputs. - Execute
terraform initandterraform applyto provision the infrastructure.
Note
Provide the required input variables and credentials such as cloud access keys or vSphere credentials, otherwise the run will fail. See each module’s README for exact variables.
Typical secrets and inputs:
- AWS
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGION
- vSphere
VSPHERE_SERVERVSPHERE_USERVSPHERE_PASSWORD- Module inputs for datacentre, cluster, datastore and network names
Names and scopes can vary by module. Always refer to the module README for authoritative details.
- Plan or apply fails early
Check that required secrets are present and correctly scoped. Verify IAM or vSphere permissions. - Template not found
For vSphere, ensure the Packer-built template exists and is accessible to the account used by Terraform. - Input validation errors
Re-run the workflow and confirm inputs match the module’s variable names and types.
This project is licensed under the MIT Licence. See the LICENCE file for details.
If you discover a security issue, please review and follow the guidance in SECURITY.md, or open a private security-focused issue with minimal details and request a secure contact channel.
Feel free to open issues or submit pull requests if you have suggestions or improvements.
See CONTRIBUTING.md
Open an issue with as much detail as possible, including the target platform, the module you used and any workflow logs that help reproduce the problem.