Skip to content

Instantly share code, notes, and snippets.

@greenboxal
Created November 29, 2016 18:01
Show Gist options
  • Save greenboxal/113469077550fa1f6c65d4db7f22ba27 to your computer and use it in GitHub Desktop.
Save greenboxal/113469077550fa1f6c65d4db7f22ba27 to your computer and use it in GitHub Desktop.
provider "aws" {
region = "us-east-1"
}
module "module1" {
source = "./module1"
}
module "module2" {
source = "./module2"
number = "${length(module.module1.azs)}"
}
data "aws_availability_zones" "available" {}
output "azs" {
value = ["${data.aws_availability_zones.available.names}"]
}
variable "number" {}
resource "aws_security_group" "sgs" {
count = "${var.number}"
name = "test ${count.index}"
vpc_id = "vpc-xxxxxx"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment