Skip to content

๐Ÿท๏ธ - Terraform template repository for generic module development.

Notifications You must be signed in to change notification settings

utilizable/terraform-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

98 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Terraform Module

This repository serves as a generic terraform template, enhanced with a Makefile and Docker Compose for streamlined setup and usage.

๐Ÿชœ Repository Structure

utilizable/github-actions-semver-tagging

utilizable/terraform-module

Table of Contents

๐Ÿงฐ Requirements

(Back to top)

Make sure you have installed both - latest docker and gnu make!

โšก๏ธ Quick start

(Back to top)

  1. Clone repository
  2. adjust .env
  3. execute make init

๐Ÿ“” Module Options

(Back to top)

Module is based on example provider.

Input Variables

# ./terraform/main.tf
...

Environment Requirements

# ./build/.env
...

โš™๏ธ Configuration

(Back to top)

You can overload default .env configuration file using ENV_FILE variable.

Command Line:

ENV_FILE=.env.override make apply
export ENV_FILE=.env.override
make apply

Github Actions:

- name: Terraform apply
  run: |
    echo "${{ secrets.ENV_PRODUCTION }}" > .env.override
    ENV_FILE=.env.override make apply

๐Ÿ“’ Make stages

(Back to top)

Stages definied in makefile.

  • make prune - Wipe all docker-related resources associated with the current project,
  • make show - Show executed containers (dokcer-compose ps -a),
  • make backend - Setup MinIO S3 backend with pre-definied bucket (backend_bucket variable based),
  • make init - Execute terraform init for modules located in ./terraform inside docker container,
  • make plan - Execute terraform plan for modules located in ./terraform inside docker container,
  • make apply - Execute terraform apply for modules located in ./terraform inside docker container,
  • make destroy - Execute terraform destroy for modules located in ./terraform inside docker container.

๐Ÿ—„ Repository structure

(Back to top)

  • ./terraform terraform related resources, workdir for compose-containers,
  • ./build/compose.yml each step contains its own docker container,
  • ./Makefile entrypoint,
  • ./build/.env default configurations.

๐Ÿ”– Versioning model

(Back to top)

Versions have the format <MAJOR>.<MINOR>(.<PATCH>)? where:

  • <MAJOR> Triggered manualy from default branch,
  • <MINOR> Triggered automaticly after each push from default branch,
  • <PATCH> Triggered automaticly after each push from fix/[0-9].[0-9].x branch.

About

๐Ÿท๏ธ - Terraform template repository for generic module development.

Topics

Resources

Stars

Watchers

Forks