Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{ if .Versions -}}
# Changelog

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})

{{ range .CommitGroups -}}
### {{ .Title }}

{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} ([{{ .Hash.Short }}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }}))
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}

{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
34 changes: 34 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/your-org/Terraform-module-base-template
options:
commits:
filters:
Type:
- feat
- fix
- perf
- refactor
- docs
- test
- chore
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance
refactor: Code Refactoring
docs: Documentation
test: Tests
chore: Maintenance
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
44 changes: 44 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "Terraform Module Development",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"features": {
"ghcr.io/devcontainers/features/terraform:1": {
"version": "1.11.3",
"tflint": "latest",
"terragrunt": "none"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
}
},
"postCreateCommand": "make dev-setup && make hooks",
"customizations": {
"vscode": {
"extensions": [
"hashicorp.terraform",
"hashicorp.hcl",
"github.copilot",
"github.copilot-chat",
"github.vscode-github-actions",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"timonwong.shellcheck",
"redhat.vscode-yaml"
],
"settings": {
"terraform.languageServer.enable": true,
"terraform.validation.enableEnhancedValidation": true,
"editor.formatOnSave": true,
"[terraform]": {
"editor.defaultFormatter": "hashicorp.terraform",
"editor.formatOnSave": true
},
"[terraform-vars]": {
"editor.defaultFormatter": "hashicorp.terraform",
"editor.formatOnSave": true
}
}
}
}
}
37 changes: 37 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.tf]
indent_size = 2

[*.tfvars]
indent_size = 2

[*.hcl]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[*.yaml]
indent_size = 2

[*.json]
indent_size = 2

[*.sh]
indent_size = 4
indent_style = space

[Makefile]
indent_style = tab
28 changes: 28 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# =============================================================================
# Terraform Module — Environment Configuration
# =============================================================================
# Copy this file to .env and customise for your local environment.
# Values here override Makefile defaults. The .env file is git-ignored.

# Terraform version (must match .terraform-version for tfenv)
TF_VERSION=1.11.3

# TFLint version
TFLINT_VERSION=v0.53.0

# Trivy version
TRIVY_VERSION=0.58.0

# Terraform init: upgrade providers/modules on init (true/false)
TF_UPGRADE=false

# Terraform plan/apply: refresh state before operations (true/false)
# Set to false in CI or when state is known-fresh for faster runs
TF_REFRESH=true

# AWS Region (used by examples and integration tests)
# AWS_DEFAULT_REGION=eu-west-1

# Artifactory settings (for publishing — see release workflow)
# ARTIFACTORY_URL=https://myorg.jfrog.io/artifactory
# ARTIFACTORY_REPO=terraform-modules
11 changes: 11 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Default owners for everything
* @your-org/platform-engineering

# Module-specific owners
modules/ @your-org/platform-engineering
examples/ @your-org/platform-engineering

# CI/CD and security
.github/ @your-org/platform-engineering
.pre-commit-config.yaml @your-org/platform-engineering
.tflint.hcl @your-org/platform-engineering
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Bug Report
about: Report a bug in this Terraform module
title: "bug: "
labels: bug
assignees: ""
---

## Description

A clear and concise description of the bug.

## Module

Which module is affected? (e.g., `modules/example`)

## Terraform Version

```
terraform version output
```

## Provider Version

```
terraform providers output
```

## Steps to Reproduce

1. Configure module with...
2. Run `terraform plan`
3. See error...

## Expected Behavior

What you expected to happen.

## Actual Behavior

What actually happened. Include error output if applicable.

## Configuration

```hcl
# Minimal terraform configuration to reproduce
module "example" {
source = "..."
}
```

## Additional Context

Any other context about the problem.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Feature Request
about: Suggest a new feature or improvement for this module
title: "feat: "
labels: enhancement
assignees: ""
---

## Description

A clear and concise description of the feature you'd like.

## Use Case

Describe the problem this feature would solve.

## Proposed Solution

How you think this should work. Include example HCL if applicable:

```hcl
module "example" {
source = "..."

# New feature configuration
new_feature = true
}
```

## Alternatives Considered

Any alternative solutions or features you've considered.

## Additional Context

Any other context, screenshots, or references.
54 changes: 54 additions & 0 deletions .github/actions/terraform-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Terraform Check
description: Reusable composite action for terraform format, validate, and lint

inputs:
terraform_version:
description: Terraform version to install
required: false
default: "1.11.3"
tflint_version:
description: TFLint version to install
required: false
default: "v0.53.0"
working_directory:
description: Directory containing terraform files
required: false
default: "."

runs:
using: composite
steps:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ inputs.terraform_version }}

- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: ${{ inputs.tflint_version }}

- name: Format Check
shell: bash
working-directory: ${{ inputs.working_directory }}
run: terraform fmt -check -recursive -diff

- name: Init
shell: bash
working-directory: ${{ inputs.working_directory }}
run: terraform init -backend=false

- name: Validate
shell: bash
working-directory: ${{ inputs.working_directory }}
run: terraform validate

- name: Init TFLint
shell: bash
working-directory: ${{ inputs.working_directory }}
run: tflint --init

- name: Lint
shell: bash
working-directory: ${{ inputs.working_directory }}
run: tflint
43 changes: 43 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Description

Brief description of the changes.

## Type of Change

- [ ] `feat`: New feature or module capability
- [ ] `fix`: Bug fix
- [ ] `docs`: Documentation update
- [ ] `refactor`: Code change that neither fixes a bug nor adds a feature
- [ ] `test`: Adding or updating tests
- [ ] `chore`: Maintenance (CI, dependencies, tooling)

## Module(s) Affected

- [ ] `modules/example`
- [ ] `examples/complete`
- [ ] CI/CD workflows
- [ ] Other: ___

## Checklist

- [ ] `make fmt-check` passes
- [ ] `make validate` passes
- [ ] `make lint` passes
- [ ] `make test` passes
- [ ] `make security` passes
- [ ] `make docs` — terraform-docs are up to date
- [ ] Variables have descriptions and types
- [ ] Outputs have descriptions
- [ ] Examples updated (if applicable)
- [ ] Tests added/updated for new functionality
- [ ] CHANGELOG entry (auto-generated from commit message)

## Breaking Changes

<!-- List any breaking changes and migration steps -->

None.

## Additional Notes

<!-- Any extra context for reviewers -->
Loading
Loading