This repository, is the second part of my infrastructure-as-code (IAC) pipeline, it leverages Terraform to deploy virtual machines and other resources. It's designed to work in tandem with my other repository, which uses Packer in vSphere to create the necessary templates for these deployments. There are additional modules here which do not utilise the other repo such as the AWS modules for VPC's and EKS.
Note
Within this repo, you'll find multiple Terraform modules capable of provisioning and customising a variety of resources across different providers such as AWS and VMware. Each module is accompanied by its own README, providing detailed instructions and prerequisites. It's crucial to read these READMEs thoroughly before proceeding with any deployment.
This section guides you through deploying a VM using one of our Terraform modules, executed via a GitHub runner - a critical component for running Terraform in a GitHub Action.
Before diving into deployment, ensure you have:
- Configured the necessary infrastructure elements (VLANs for VMware, VPC's, IAM roles etc. for AWS).
- Cloned this repository to your GitHub account, renaming it appropriately.
- Secured access to the organisation-level GitHub secrets if using this within a GitHub org.
- Familiarised yourself with the repository's structure and content.
- To clone the GitHub repository using the CLI use following command:
$ git clone https://github.com/sudo-kraken/multiplatform-terraform-module-actions.git
My Terraform vSphere-based modules are designed to use VM templates created by my Packer repository. Make sure you have the latest templates from the Packer repo, as they're essential for the VM deployment process.
The actions within this repo will generate a custom main.tf files to call the individual modules contained here, be sure to follow each of the modules instructions.
All of the acitons perform the following functions:
-
Generates a main.tf file: This file contains the Terraform configuration code that specifies the desired infrastructure resources, such as virtual machines, networks, and storage.
-
Executes the main.tf file: The code uses the Terraform CLI (Command-Line Interface) to apply the configuration defined in the main.tf file. This triggers the provisioning of the infrastructure resources specified in the configuration.
Note
Make sure to provide the necessary input variables and authentication credentials, such as access keys or service account credentials, for the Terraform execution to succeed.