Skip to content

This repository contains configurations to set up a Terraform development environment using VSCode's Dev Container feature. The environment includes terraform-docs.

Notifications You must be signed in to change notification settings

a5chin/terraform-template

Repository files navigation

Terraform Development with VSCode Dev Container

Terraform

Docker Terraform

Overview

This repository contains configurations to set up a Terraform development environment using VSCode's Dev Container feature.

demo

If the Terraform format does not work, try reloading the VS Code window. Specifically, you can solve this problem by following the steps below.

  1. Type ⌘+⇧+P to open the command palette
  2. Type Developer: Reload Window in the command palette to reload the window

Contents

Settings

  • files.insertFinalNewline
  • files.trimTrailingWhitespace
  • editor.formatOnSave
    • dockercompose
    • dockerfile
    • github-actions-workflow
    • json, jsonc
    • terraform
    • yaml

Dev Container

GitHub Actions

  • docker.yml
    • Workflow to check if you can build with Docker
  • terraform.yml
    • Workflow to check
      • format
      • lint
      • test
      • validation

pre-commit

The .pre-commit-config.yaml file can contain scripts to be executed before commit.

# Terraform Formatter
terraform fmt .

# Terraform Linter
tflint --recursive

# Terraform Docs
terraform-docs markdown table --output-file README.md --output-mode inject /path/to/module

Appendix

The structure of this repository

.
├── .devcontainer
│   ├── devcontainer.json
│   └── Dockerfile
├── .github
│   └── workflows
│       └── terraform.yml
├── .vscode
│   ├── extensions.json
│   └── settings.json
├── environments
│   ├── dev
│   │   ├── .terraform-version
│   │   ├── backend.tf
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── provider.tf
│   │   └── versions.tf
│   ├── prod
│   │   ├── .terraform-version
│   │   ├── backend.tf
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── provider.tf
│   │   └── versions.tf
│   └── stg
│       ├── .terraform-version
│       ├── backend.tf
│       ├── main.tf
│       ├── outputs.tf
│       ├── provider.tf
│       └── versions.tf
└── modules
│   ├── gcs2spanner
│   │   ├── README.md
│   │   ├── architecture.drawio.svg
│   │   ├── dataflow.tf
│   │   ├── functoins.tf
│   │   ├── gcs.tf
│   │   ├── main.tf
│   │   ├── main.tftest.hcl
│   │   ├── outputs.tf
│   │   ├── provider.tf
│   │   ├── sa.tf
│   │   ├── src
│   │   │   ├── authz.py
│   │   │   ├── extract.py
│   │   │   ├── logger.py
│   │   │   ├── main.py
│   │   │   ├── requirements.txt
│   │   │   └── tests
│   │   │       └── test_extract.py
│   │   ├── variables.tf
│   │   └── vpc.tf
│   ├── log2bq
│   │   ├── README.md
│   │   ├── bigquery.tf
│   │   ├── logging.tf
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── provider.tf
│   │   └── variables.tf
│   ├── microservices
│   │   ├── README.md
│   │   ├── architecture.drawio.svg
│   │   ├── backend.tf
│   │   ├── db.tf
│   │   ├── frontend.tf
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── provider.tf
│   │   ├── variables.tf
│   │   └── vpc.tf
│   └── monitoring-tools
│       ├── README.md
│       ├── alert.tf
│       ├── channel.tf
│       ├── main.tf
│       ├── main.tftest.hcl
│       ├── outputs.tf
│       ├── provider.tf
│       └── variables.tf
├── .dockerignore
├── .gitignore
├── .pre-commit-config.yaml
├── .tflint.hcl
└── README.md

About

This repository contains configurations to set up a Terraform development environment using VSCode's Dev Container feature. The environment includes terraform-docs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published