From 3296a53bfdf597a81666472d5c48b4b9b7b69d90 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Fri, 4 Sep 2020 20:04:37 +0530 Subject: [PATCH] add new variable --- README.md | 7 ++++--- README.yaml | 6 +++--- main.tf | 2 +- variables.tf | 6 ++++++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 02de50a..c3e5266 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Here are some examples of how you can use this module in your inventory structur ### Private Subnet ```hcl module "subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.7" + source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.8" name = "subnets" application = "clouddrove" environment = "test" @@ -90,7 +90,7 @@ Here are some examples of how you can use this module in your inventory structur ### Public-Private Subnet ```hcl module "subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.7" + source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.8" name = "subnets" application = "clouddrove" environment = "test" @@ -108,7 +108,7 @@ Here are some examples of how you can use this module in your inventory structur ### Public Subnet ```hcl module "subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.7" + source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.8" name = "subnets" application = "clouddrove" environment = "test" @@ -147,6 +147,7 @@ Here are some examples of how you can use this module in your inventory structur | label\_order | Label order, e.g. `name`,`application`. | list | `` | no | | managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"anmol@clouddrove.com"` | no | | map\_public\_ip\_on\_launch | Specify true to indicate that instances launched into the subnet should be assigned a public IP address. | bool | `"true"` | no | +| map\_public\_ip\_on\_launch | Specify true to indicate that instances launched into the subnet should be assigned a public IP address. | bool | `"false"` | no | | max\_subnets | Maximum number of subnets that can be created. The variable is used for CIDR blocks calculation. | number | `"6"` | no | | name | Name \(e.g. `app` or `cluster`\). | string | `""` | no | | nat\_gateway\_enabled | Flag to enable/disable NAT Gateways creation in public subnets. | bool | `"false"` | no | diff --git a/README.yaml b/README.yaml index de249e6..cbb0a5e 100644 --- a/README.yaml +++ b/README.yaml @@ -36,7 +36,7 @@ usage : |- ### Private Subnet ```hcl module "subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.7" + source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.8" name = "subnets" application = "clouddrove" environment = "test" @@ -54,7 +54,7 @@ usage : |- ### Public-Private Subnet ```hcl module "subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.7" + source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.8" name = "subnets" application = "clouddrove" environment = "test" @@ -72,7 +72,7 @@ usage : |- ### Public Subnet ```hcl module "subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.7" + source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.8" name = "subnets" application = "clouddrove" environment = "test" diff --git a/main.tf b/main.tf index 0c3966e..d5f53f2 100644 --- a/main.tf +++ b/main.tf @@ -55,7 +55,7 @@ resource "aws_subnet" "public" { 8, local.public_count + count.index ) - + map_public_ip_on_launch = var.map_public_ip_on_launch assign_ipv6_address_on_creation = false tags = merge( diff --git a/variables.tf b/variables.tf index 35c7b0a..f809ab8 100644 --- a/variables.tf +++ b/variables.tf @@ -161,4 +161,10 @@ variable "traffic_type" { type = string default = "ALL" description = "Type of traffic to capture. Valid values: ACCEPT,REJECT, ALL." +} + +variable "map_public_ip_on_launch" { + type = bool + default = false + description = "Specify true to indicate that instances launched into the subnet should be assigned a public IP address." } \ No newline at end of file