Skip to content

📄 A template for aws terraform provider, so others can generate a new repositories with the same directory structure and files.

Notifications You must be signed in to change notification settings

kwame-mintah/terraform-aws-template

Repository files navigation

Terraform AWS Template

The main purpose of this repository is to create a template for Terraform. This project will focus on the AWS provider.

Development

Dependencies

Prerequisites

  1. Have a AWS account account and associated credentials.

Information on HashiCorp BSL License Change

Due to the HashiCorp BSL license change, restricting Terraform to the latest open source version (1.5.7). Will create a new project template using OpenTofu. To learn more, see the official OpenTofu website and project status.

Usage

  1. Navigate to the environment you would like to deploy,
  2. Initialize the configuration with:
    aws-vault exec <profile> --no-session terragrunt init
  3. Plan your changes with:
    aws-vault exec <profile> --no-session terragrunt plan
  4. If you're happy with the changes
    aws-vault exec <profile> --no-session terragrunt apply

Note

Please note that terragrunt will create an S3 Bucket and DynamoDB table for storing the remote state. Ensure the account deploying the resources has the appropriate permissions to create or connect to these resources.

Pre-Commit hooks

Git hook scripts are very helpful for identifying simple issues before pushing any changes. Hooks will run on every commit automatically pointing out issues in the code e.g. trailing whitespace.

To help with the maintenance of these hooks, pre-commit is used, along with pre-commit-hooks.

Please following these instructions to install pre-commit locally and ensure that you have run pre-commit install to install the hooks for this project.

Additionally, once installed, the hooks can be updated to the latest available version with pre-commit autoupdate.

Documentation Generation

Code formatting and documentation for variables and outputs is generated using pre-commit-terraform hooks that in turn uses terraform-docs that will insert/update documentation. The following markers have been added to the README.md:

<!-- {BEGINNING|END} OF PRE-COMMIT-TERRAFORM DOCS HOOK --->

Requirements

Name Version
terraform >= 1.0.0, <= 1.5.7
aws ~> 5.17.0

Providers

Name Version
aws 5.17.0

Modules

No modules.

Resources

Name Type
aws_availability_zones.avaliabile_zones data source
aws_caller_identity.current_caller_identity data source

Inputs

Name Description Type Default Required
allowed_account_ids List of allowed AWS account IDs to prevent you
from mistakenly using an incorrect one.
list(string) n/a yes
aws_region The AWS region. string n/a yes

Outputs

Name Description
availability_zones List of the Availability Zone names available to the account.
current_caller_identity AWS Account ID number of the account that owns or contains the
calling entity.

About

📄 A template for aws terraform provider, so others can generate a new repositories with the same directory structure and files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages