From e54856910e5247725c2d802bad0122b18e419a43 Mon Sep 17 00:00:00 2001 From: Valeriy Date: Fri, 22 Sep 2017 22:19:44 +0300 Subject: [PATCH] Rename repo (#6) * Update tf_vpc to use the latest tf_subnets 0.2.2 * Rename repos, fix `README.md`, fix `LICENSE` * terraform fmt * Delete duplicate `type` attribute --- .gitignore | 3 +-- LICENSE | 2 +- README.md | 9 ++++++++- main.tf | 20 +++++--------------- variables.tf | 17 +++++++++++------ 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index a4190a4..a0dd221 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ *.tfstate.backup # Module directory -.terraform/ - +.terraform .idea *.iml diff --git a/LICENSE b/LICENSE index 8dada3e..6b9d898 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2017 Cloud Posse, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index d83821d..227bc21 100644 --- a/README.md +++ b/README.md @@ -1 +1,8 @@ -# tf-vpc \ No newline at end of file +# terraform-aws-vpc + +Terraform module that defines a VPC with public/private subnets across multiple AZs with Internet Gateways + + +## License + +Apache 2 License. See [`LICENSE`](LICENSE) for full details. diff --git a/main.tf b/main.tf index c929181..c15cae2 100644 --- a/main.tf +++ b/main.tf @@ -1,14 +1,13 @@ # Define composite variables for resources module "label" { - source = "git::https://github.com/cloudposse/tf_label.git?ref=tags/0.1.0" + source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.2.1" namespace = "${var.namespace}" name = "${var.name}" stage = "${var.stage}" } module "subnets" { - source = "git::https://github.com/cloudposse/tf_subnets.git?ref=tags/0.1.6" - + source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.2.3" availability_zones = "${var.availability_zones}" namespace = "${var.namespace}" name = "${var.name}" @@ -16,25 +15,16 @@ module "subnets" { region = "${var.region}" vpc_id = "${aws_vpc.default.id}" cidr_block = "${aws_vpc.default.cidr_block}" + igw_id = "${var.igw_id}" } resource "aws_vpc" "default" { cidr_block = "${var.cidr_block}" enable_dns_hostnames = true - - tags { - Name = "${module.label.id}" - Namespace = "${var.namespace}" - Stage = "${var.stage}" - } + tags = "${module.label.tags}" } resource "aws_internet_gateway" "default" { vpc_id = "${aws_vpc.default.id}" - - tags { - Name = "${module.label.id}" - Namespace = "${var.namespace}" - Stage = "${var.stage}" - } + tags = "${module.label.tags}" } diff --git a/variables.tf b/variables.tf index d2d196c..0543aaf 100644 --- a/variables.tf +++ b/variables.tf @@ -1,25 +1,30 @@ variable "namespace" { - default = "" + type = "string" } variable "stage" { - default = "" + type = "string" } variable "name" { - default = "" + type = "string" } variable "availability_zones" { - description = "Run the EC2 Instances in these Availability Zones" + description = "List of Availability Zones" type = "list" } variable "cidr_block" { - description = "CIDR for the whole VPC" + type = "string" + description = "CIDR for the VPC" default = "10.0.0.0/16" } variable "region" { - default = "" + type = "string" +} + +variable "igw_id" { + type = "string" }