This is a Starter kit to help with the creation of Terraform modules. The basic structure of a Terraform module is fairly simple and consists of the following basic values:
- README.md - provides a description of the module
- main.tf - defiens the logic for the module
- variables.tf (optional) - defines the input variables for the module
- outputs.tf (optional) - defines the values that are output from the module
Beyond those files, any other content can be added and organized however you see fit. For example, you can add a scripts/
directory
that contains shell scripts executed by a local-exec
null_resource
in the terraform module. The contents will depend on what your
module does and how it does it.
- Update the title and description in the README to match the module you are creating
- Fill out the remaining sections in the README template as appropriate
- Implement your logic in the in the main.tf, variables.tf, and outputs.tf
- Use releases/tags to manage release versions of your module
The module depends on the following software components:
- terraform - v12
- kubectl
- IBM Cloud provider >= 1.5.3
- Helm provider >= 1.1.1 (provided by Terraform)
This module makes use of the output from other modules:
- Cluster - github.com/ibm-garage-cloud/terraform-ibm-container-platform.git
- Namespace - github.com/ibm-garage-clout/terraform-cluster-namespace.git
- etc
module "dev_tools_argocd" {
source = "github.com/ibm-garage-cloud/terraform-tools-argocd.git?ref=v1.0.0"
cluster_config_file = module.dev_cluster.config_file_path
cluster_type = module.dev_cluster.type
app_namespace = module.dev_cluster_namespaces.tools_namespace_name
ingress_subdomain = module.dev_cluster.ingress_hostname
olm_namespace = module.dev_software_olm.olm_namespace
operator_namespace = module.dev_software_olm.target_namespace
name = "argocd"
}