Skip to content

Instantly share code, notes, and snippets.

@rumeshbandara
Created January 15, 2023 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rumeshbandara/e6de861a28974b5f8fa81eaa3fe318d8 to your computer and use it in GitHub Desktop.
Save rumeshbandara/e6de861a28974b5f8fa81eaa3fe318d8 to your computer and use it in GitHub Desktop.
Terraform outputs as inputs
module "vpc" {
source = "./modules/vpc"
vpc_cidr = "10.0.0.0/16"
public_subnet_cidrs = ["10.0.1.0/24", "10.0.2.0/24"]
private_subnet_cidrs = ["10.0.3.0/24", "10.0.4.0/24"]
}
module "ec2" {
source = "./modules/ec2"
subnet_id = module.vpc.public_subnet_ids[0]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment