Skip to content

Instantly share code, notes, and snippets.

@theCaptN21
Created February 14, 2023 01:38
Show Gist options
  • Save theCaptN21/525fdbdce6256153538c3450a085a6b3 to your computer and use it in GitHub Desktop.
Save theCaptN21/525fdbdce6256153538c3450a085a6b3 to your computer and use it in GitHub Desktop.
Root
# --- root/main.tf ---
#Sample Instance Module
module "ec2_instance" {
source = "./Modules/Compute"
}
#Sample Security Group Module
module "vpc_sg" {
source = "./Modules/Security"
name = "allow http"
vpc_id = "module.vpc.security_group_id"
ingress_cidr_blocks = ["10.10.0.0/16"]
}
#Same VPC Module
module "vpc" {
source = "./Modules/Networking"
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
region = var.main_region
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment