Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 2.08 KB

README.md

File metadata and controls

59 lines (41 loc) · 2.08 KB

Starter kit for a Terraform module

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.

Instructions for creating a new module

  1. Update the title and description in the README to match the module you are creating
  2. Fill out the remaining sections in the README template as appropriate
  3. Implement your logic in the in the main.tf, variables.tf, and outputs.tf
  4. Use releases/tags to manage release versions of your module

Software dependencies

The module depends on the following software components:

Command-line tools

  • terraform - v12
  • kubectl

Terraform providers

  • IBM Cloud provider >= 1.5.3
  • Helm provider >= 1.1.1 (provided by Terraform)

Module dependencies

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

Example usage

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"
}