Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

550 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pre-commit taskfile terraform statefile

Terraform Discord for techtales.io

Discord Server Infrastructure as code with Terraform and Atlantis.

Table of Contents

Code-Style

Terraform

Best practices

terraform-best-practices.com

Naming of Terraform resources

  • lower-case characters

Pattern: [a-z_-]+

Getting Started

Prerequisties

Initialize repository

Terraform and pre-commit framework need to get initialized.

task terraform:init
task pre-commit:init

Configuration

env

Name Description
VAULT_ADDR vault url/address
VAULT_TOKEN vault token
AWS_ENDPOINT_URL_S3 endpoint url for the s3 state backend
AWS_REGION region for the s3 state backend
AWS_ACCESS_KEY_ID username for the s3 state backend
AWS_SECRET_ACCESS_KEY password for the s3 state backend

CRD like data structure

By leveraging YAML-like CRDs as Terraform inputs, we can create a more flexible, maintainable, and collaborative infrastructure-as-code ecosystem that can easily adapt to changing requirements and team dynamics.

Easy Collaboration

  • Human-readable format: YAML is easy to read and write, making it accessible for team members with varying technical expertise.
  • Version control friendly: YAML files are text-based, allowing for easy tracking of changes in version control systems like Git.

Versioning and Change Management

  • Clear versioning: The apiVersion field allows for easy tracking of schema changes over time.
  • Structured updates: Changes to resources can be clearly documented and reviewed in pull requests.

Data and Logic Separation

  • Clean separation: YAML files contain only data, while Terraform handles the logic, promoting a clear separation of concerns.
  • Reduced complexity: Simplifies maintenance by keeping configuration data separate from infrastructure-as-code logic.

Flexibility in Spec Changes

  • Extensible structure: The spec section can be easily extended to accommodate new fields or configurations without breaking existing setups.
  • Backward compatibility: New versions can be introduced while maintaining support for older versions.

Standardization and Consistency

  • Uniform structure: Consistent format across different resource types improves readability and reduces errors.
  • Metadata support: The metadata section provides a standardized way to include additional information about resources.

Improved Maintainability

  • Modular approach: Each resource is defined in its own YAML block, making it easier to manage and update individual components.
  • Reusability: YAML blocks can be easily copied, shared, or templated for use across different projects or environments.

About

IaC for the techtales discord server with Terraform

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages