Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exploring adding Terraform section for tests #403

Open
jburns24 opened this issue Oct 16, 2023 · 1 comment
Open

Exploring adding Terraform section for tests #403

jburns24 opened this issue Oct 16, 2023 · 1 comment

Comments

@jburns24
Copy link
Collaborator

https://developer.hashicorp.com/terraform/tutorials/configuration-language/test

Terraform natively now supports tests. We should look into this and possibly add a section to the bootcamp

@jburns24
Copy link
Collaborator Author

jburns24 commented Dec 7, 2023

Great suggestion for Alice

I think a section that really highlights that, maybe showing managing TF of multiple environments first, and then making it simpler with TG could be pretty helpful.

Full conversation

I love this idea let's roll with it! Here is an outline to start this section

Terragrunt

Introduction to Terragrunt

  • Why Terragrunt?

    • Explanation of Terragrunt's role in the Terraform ecosystem.
    • Address common challenges in managing Terraform configurations across multiple environments.
    • Emphasize on DRY (Don't Repeat Yourself) principles and configuration management.
  • Resources for Deeper Understanding

Setting the Scene for the Exercise

  • Project Overview
    • Describe the goal: Manage infrastructure for a simple static website in both development and production environments.
    • Suggested websites: VuePress 'Hello World', Docsify 'Hello World', or 'DevOps Knowledge Share UI'.

Part 1: Terraform for Managing Infrastructure

  • Objective

    • Create Terraform configurations to set up an S3 bucket and CDN for the static website.
  • Recommended Directory Structure

    • dev/
      • main.tf
      • variables.tf
      • outputs.tf
    • prod/
      • main.tf
      • variables.tf
      • outputs.tf
  • Infrastructure Components

    • S3 Bucket: Hosting the static website.
    • CDN Configuration:
      • Development: Regional distribution.
      • Production: Global distribution with production-level settings.
  • Scalability and Management Issues

    • Highlight potential issues with scaling and maintaining this approach as the complexity of the infrastructure grows.
  • Cleanup Instruction

    • Guide on how to cleanly destroy the Terraform-managed infrastructure.

Exercise 2: Refactoring with Terragrunt

  • Introduction to Terragrunt for Scalability

    • Discuss how Terragrunt can address the scalability and manageability issues identified in Part 1.
  • Terragrunt Installation Instructions

    • Provide steps or link to installation guide.
  • Recommended Directory Structure for Terragrunt

    • terraform-modules/
      • Shared modules for S3 and CDN.
    • environments/
      • dev/
        • terragrunt.hcl
      • prod/
        • terragrunt.hcl
  • Key Terragrunt Features to Utilize

    • remote_state: Discuss its usage and benefits.
    • Link to relevant Terragrunt documentation for further reading.
  • Refactoring Instructions

    • Guide on how to refactor the existing Terraform configurations to be used with Terragrunt.
    • Emphasize the use of remote_state function and other Terragrunt features.
  • Cleanup Instruction

    • Steps to remove all infrastructure components managed by Terragrunt.

Conclusion

  • Summary

    • Recap the benefits of using Terragrunt over plain Terraform for managing multi-environment infrastructures.
    • Encourage exploration of further Terragrunt capabilities.
  • Additional Resources

    • Provide links to advanced Terragrunt tutorials, community discussions, and case studies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant