Skip to content

Instantly share code, notes, and snippets.

@conorgil
Last active February 12, 2016 18:46
Show Gist options
  • Save conorgil/4b3dacf566efaf40017c to your computer and use it in GitHub Desktop.
Save conorgil/4b3dacf566efaf40017c to your computer and use it in GitHub Desktop.
Example terraform output using a module
# Call the module
module "vpc" {
source = "../modules/foo/bar/baz"
environment_name = "${var.environment_name}"
vpc_cidr = "${var.vpc_cidr}"
vpc_instance_tenancy = "dedicated"
vpc_enable_dns_support = true
vpc_enable_dns_hostnames = true
zones = "${var.zones}"
public_subnet_cidrs = "${var.public_subnet_cidrs}"
private_subnet_cidrs = "${var.private_subnet_cidrs}"
}
# Define outputs for this main.tf file.
# Note that if we want to output values from the vpc module
# call, then we need to define those explicitly
output "public_subnet_ids" {
value = "${module.vpc.public_subnet_ids}"
}
output "private_subnet_ids" {
value = "${module.vpc.private_subnet_ids}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment