Welcome to DevOps Terraform Modules! This document outlines guidelines for contributing to this repository. Following these guidelines helps to keep our repo well maintained and standardized.
Before you begin:
- Familiarize yourself with Terraform Modules directory and the specific modules in this repository.
- Read through the documentation, including
README.md
files in various directories. - Workflow for contributing is
feature/*
->main
If you encounter bugs, please create an issue on GitHub using the repo's issue template
To contribute, follow these steps:
- Feature Branch: Create a feature branch in called
feature/<your_feature_name_here>
- CI/CD: A feature branch pipeline will run to test your changes - ONLY MERGE YOUR FEATURE BRANCH IF THE CI PIPELINE IS PASSING
- CHANGELOG: You must follow the format of the changelog and update it with a description of your feature before merging to
main
Before Creating a New Module:
- Search the AVM/AWS repository on the HashiCorp Terraform Registry to check if the desired resource or pattern module already exists.
- If an appropriate module exists, use it directly or consider contributing to it for any necessary enhancements.
If the Module Does Not Exist:
- Follow the guidelines below to create a new module, adhering to our organisation's adaptation of the AVM standards.
Each new module must comply with the following mandatory standards:
-
Composition:
- Ensure the module is aligned to the Well Architected Framework (SFR2)
- Availability Zones (SFR5)
- Data Redundancy (SFR6)
- Resource Naming (SNFR25)
- Single Resource Only (RMFR1)
- Resource Groups (RMFR3)
- Dependency Management (RMFR8). Extends to UKHSA developed modules.
- * Consistent Feature & Extension Resources Value Add (RMFR4)
- * Consistent Feature & Extension Resources Value Add Interfaces/Schemas (RMFR5)
-
Testing:
-
Inputs and Outputs:
-
Code Styling:
- Use lower_snake_casing for configuration block names (TFNFR4)
- Orders Within resource and data Blocks (TFNFR8). AVM Fix can be used for this.
- Use coalesce or try when setting default values for nullable expressions (TFNFR13)
- All verified modules MUST have terraform.tf file and required_version MUST be set (TFNFR25)
- Providers MUST be declared in the required_providers block in terraform.tf and MUST have a constraint on minimum and maximum major version (TFNFR26)
- * Order within a module block (TFNFR9)
- * Null comparison as creation toggle (TFNFR11)
-
Naming Conventions:
-
Documentation:
- * Examples of E2E usage (SNFR16)
-
Release:
- Semantic Versioning (SNFR17)
- After automated a successful pipeline run, repository code owners will review all PRs before approving.
- Creating Robust Terraform Modules
- Automated Terraform Resource Generation
- Azure Verified Modules
- Azure Security Recommendations
If you need help or have questions, feel free to reach out to the code owners or ask in issues related to specific problems.