Code Monkey home page Code Monkey logo

terraform-fake-modules's Introduction

Terraform Fake Modules

This repository contains a collection of "fake" Terraform modules designed to mimic AWS and GCP resources. The main purpose of these modules is to facilitate the exploration of Terraform and Terragrunt behavior without the need to invest time or money in real infrastructure. Each module authenticates with the respective cloud service and generates semi-realistic output values. It is currently maintained by members of the Gruntwork sales team.

Prerequisites

  • Terraform v1.0.0 or newer
  • AWS Provider version 4.0 or newer
  • Terragrunt v0.31.0 or newer (Optional)
  • Git

For the compatibility between Terraform and Terragrunt versions, please refer to the Terragrunt Supported Terraform Versions documentation.

Quick Start

AWS Virtual Private Cloud (VPC)

To quickly get started with a fake AWS VPC, use the following code:

terraform {
  required_version = ">= 1.1.6"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}

module "vpc" {
  source = "git::https://github.com/gruntwork-io/terraform-fake-modules.git//modules/aws/vpc?ref=main"
}

AWS Elastic Kubernetes Service (EKS)

To add a fake AWS EKS cluster, you can use the following code. This also uses the output from the fake VPC module:

module "eks" {
  source = "git::https://github.com/gruntwork-io/terraform-fake-modules.git//modules/aws/eks?ref=main"
  vpc_id = module.vpc.id
}

Running the example

aws-vault exec iangrunt-sandbox -- terraform init && terraform apply

Terragrunt

To use these modules with Terragrunt, you need to define the terraform block in your terragrunt.hcl file and specify the module source as follows:

terraform {
  source = "git::https://github.com/gruntwork-io/terraform-fake-modules.git//modules/aws/vpc?ref=main"
}

inputs = {}

What to Expect

These modules do not create any real cloud resources. They simulate the process and generate fake outputs. You can use them to learn and understand how to structure Terraform modules, manage module dependencies, and study how Terragrunt simplifies working with Terraform modules.

Here is the output from the examples/vpc-aurora-eks example module:

Apply complete! Resources: 6 added, 0 changed, 0 destroyed.

Outputs:

aurora = {
  "arn" = "arn:aws:rds:eu-west-1:012345678901:cluster:fake-module-development-euw1-aurora-postgres"
  "engine" = {
    "name" = "postgres"
    "version" = "13.6"
  }
  "name" = "fake-module-development-euw1-aurora-postgres"
  "port" = "5432"
  "reader_endpoint" = "fake-module-development-euw1-aurora-postgres.cluster-ro-5b07ca0def49.eu-west-1.rds.amazonaws.com"
  "writer_endpoint" = "fake-module-development-euw1-aurora-postgres.cluster-5b07ca0def49.eu-west-1.rds.amazonaws.com"
}
eks = {
  "api_server_endpoint" = "https://5B07CA0DEF491592E25413C44895381E.8f2.eu-west-1.eks.amazonaws.com"
  "arn" = "arn:aws:eks:eu-west-1:012345678901:cluster/fake-module-development-euw1-eks"
  "name" = "fake-module-development

terraform-fake-modules's People

Contributors

iangrunt avatar marijakstrazdas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-fake-modules's Issues

bug: Remove providers.tf

The modules all have a providers.tf which causes confusion when using Terragrunt. The required_provders block should just be in main.tf.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.