Created
November 29, 2016 18:01
-
-
Save greenboxal/113469077550fa1f6c65d4db7f22ba27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
region = "us-east-1" | |
} | |
module "module1" { | |
source = "./module1" | |
} | |
module "module2" { | |
source = "./module2" | |
number = "${length(module.module1.azs)}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "aws_availability_zones" "available" {} | |
output "azs" { | |
value = ["${data.aws_availability_zones.available.names}"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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