Code Monkey home page Code Monkey logo

terraform-module-testing's Introduction

License Latest Release Build Status Build Status Build Status Build Status Build Status Build Status Build Status

Terraform module <PROVIDER>-<MODULE> Terraform module

How to use this template -- DELETE THIS SECTION BEFORE PR

  1. Create your new module repository by using terraform only (see SOP) and make sure to use this template.
  2. Add your Terraform code in any branch other than main/master
  3. Change the <REPO_NAME> value for any badges in the README.md files in the root examples and modules folders.
  4. Add nested modules in the modules folder, or DELETE the nested folder if not used.
    • Note: you will also maintain the nested modules full README.md files, remember nested modules can be used on their own.
  5. Add examples in the examples folder.
    • Note: you can have as many examples as you want, but two are required.
      • minimum - this is the example with the minimum code to use the module.
      • complete - this is the example with all features for a single module used (the most common use).
  6. Run pre-commit run --all-files to update the README and fix any issues.
    • Note: make sure your IDE tool uses spaces and not tabs specially on yaml files.
  7. Run checkov or terrascan tool and make sure to add the log to the PR (something to automate).
    • Note: make sure to scan your module nested modules and examples (great candidate for a makefile action/script and automation).
  8. Open a pull request into the default branch (usually main) and have it reviewed. don't forget to add the security scan logs.
    • Note: make sure to add the nested modules README's to the pre-commit config so they are also updated and validated.
  9. If you have been assigned a reviewer DM the reviewer, or the channel if it has been more than one day.
  10. Post to the channel news of the releases to the teams.

Description

lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem.

Examples available [here]github.com/boldlink/<REPO_NAME>//tree/main/examples)

Usage

NOTE: These examples use the latest version of this module

module "miniumum" {
  source  = "boldlink/<module_name>/<provider>"
  version = "x.x.x"
  <insert the minimum required variables here if any are required>
  ...
}

Documentation

<ex. Amazon VPC/Github/Cloudflare> Documentation

Terraform module documentation

Requirements

Name Version
terraform >= 0.14.11
aws >= 4.20.0

Providers

No providers.

Modules

No modules.

Resources

No resources.

Inputs

No inputs.

Outputs

No outputs.

Third party software

This repository uses third party software:

  • pre-commit - Used to help ensure code and documentation consistency
    • Install with brew install pre-commit
    • Manually use with pre-commit run
  • terraform 0.14.11 For backwards compatibility we are using version 0.14.11 for testing making this the min version tested and without issues with terraform-docs.
  • terraform-docs - Used to generate the Inputs and Outputs sections
    • Install with brew install terraform-docs
    • Manually use via pre-commit
  • tflint - Used to lint the Terraform code
    • Install with brew install tflint
    • Manually use via pre-commit

Supporting resources:

The example stacks are used by BOLDLink developers to validate the modules by building an actual stack on AWS.

Some of the modules have dependencies on other modules (ex. Ec2 instance depends on the VPC module) so we create them first and use data sources on the examples to use the stacks.

Any supporting resources will be available on the tests/supportingResources and the lifecycle is managed by the Makefile targets.

Resources on the tests/supportingResources folder are not intended for demo or actual implementation purposes, and can be used for reference.

Makefile

The makefile contain in this repo is optimized for linux paths and the main purpose is to execute testing for now.

  • Create all tests stacks including any supporting resources:
make tests
  • Clean all tests except existing supporting resources:
make clean
  • Clean supporting resources - this is done separately so you can test your module build/modify/destroy independently.
make cleansupporting
  • !!!DANGER!!! Clean the state files from examples and test/supportingResources - use with CAUTION!!!
make cleanstatefiles

BOLDLink-SIG 2022

terraform-module-testing's People

Contributors

ndegwajohn avatar boldlinksig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.