Skip to content

Latest commit

 

History

History
93 lines (69 loc) · 7.67 KB

CONTRIBUTING.md

File metadata and controls

93 lines (69 loc) · 7.67 KB

Contributing to DevOps Terraform Modules

Introduction

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.

Getting Started

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

Reporting Issues

If you encounter bugs, please create an issue on GitHub using the repo's issue template

Making Contributions

To contribute, follow these steps:

  1. Feature Branch: Create a feature branch in called feature/<your_feature_name_here>
  2. CI/CD: A feature branch pipeline will run to test your changes - ONLY MERGE YOUR FEATURE BRANCH IF THE CI PIPELINE IS PASSING
  3. CHANGELOG: You must follow the format of the changelog and update it with a description of your feature before merging to main

Check for Existing Modules

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.

Creating a New Module

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.

Mandatory 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:

    • Parameters/Variables for Resource IDs (SNFR22)
    • Parameter/Variable naming (RMFR6)
    • Minimum Required Outputs (RMFR7)
  • 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:

    • Resource and pattern module naming (RMNFR1, PMNFR1). Swapping avm for ukhsa where applicable.
  • 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.

Additional Resources

Questions or Need Help?

If you need help or have questions, feel free to reach out to the code owners or ask in issues related to specific problems.

CI/CD Workflow

Terraform Modules

Terraform Modules CI