Skip to content

Commit

Permalink
Merge pull request #34 from isovalent/add-public-ip-map
Browse files Browse the repository at this point in the history
Add map_public_ip_on_launch var
  • Loading branch information
darox authored Sep 5, 2023
2 parents 4c78244 + b1648e3 commit c4d2266
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ An opinionated Terraform module that can be used to create and manage an VPC in
| Name | Source | Version |
|------|--------|---------|
| <a name="module_bastion"></a> [bastion](#module\_bastion) | cloudposse/ec2-bastion-server/aws | 0.30.1 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | 3.18.1 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | 5.0.0 |

## Resources

Expand Down Expand Up @@ -61,6 +61,7 @@ An opinionated Terraform module that can be used to create and manage an VPC in
| <a name="input_bastion_host_ssh_public_key"></a> [bastion\_host\_ssh\_public\_key](#input\_bastion\_host\_ssh\_public\_key) | If specified, will be used as the public SSH key for the bastion host. | `string` | `""` | no |
| <a name="input_cidr"></a> [cidr](#input\_cidr) | The CIDR to be used for the VPC. | `string` | n/a | yes |
| <a name="input_enable_ipv6"></a> [enable\_ipv6](#input\_enable\_ipv6) | Whether to enable the ipv6 stack. | `bool` | `false` | no |
| <a name="input_map_public_ip_on_launch"></a> [map\_public\_ip\_on\_launch](#input\_map\_public\_ip\_on\_launch) | Whether to map public IPs on launch. | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the VPC. | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | The region in which to create the VPC. | `string` | n/a | yes |
| <a name="input_secondary_cidr_blocks"></a> [secondary\_cidr\_blocks](#input\_secondary\_cidr\_blocks) | List of secondary CIDR blocks to use. | `list(string)` | `[]` | no |
Expand Down
19 changes: 10 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.0.0"

azs = data.aws_availability_zones.available.names // Use all availability zones.
cidr = var.cidr // Use the CIDR specified as a variable.
enable_dns_hostnames = true // Enable DNS hostnames (required by EKS).
enable_nat_gateway = true // Enable NAT gateway to enable outbound internet traffic from instances in a private subnet.
name = var.name // Use the name specified as a variable.
one_nat_gateway_per_az = false // Use a single NAT gateway as that's the simplest and also all we need.
secondary_cidr_blocks = var.secondary_cidr_blocks // Define secondary CIDR blocks.
single_nat_gateway = true // Use a single NAT gateway as that's the simplest and also all we need.
tags = var.tags // Use the tags specified as a variable.
azs = data.aws_availability_zones.available.names // Use all availability zones.
cidr = var.cidr // Use the CIDR specified as a variable.
enable_dns_hostnames = true // Enable DNS hostnames (required by EKS).
enable_nat_gateway = true // Enable NAT gateway to enable outbound internet traffic from instances in a private subnet.
name = var.name // Use the name specified as a variable.
one_nat_gateway_per_az = false // Use a single NAT gateway as that's the simplest and also all we need.
secondary_cidr_blocks = var.secondary_cidr_blocks // Define secondary CIDR blocks.
single_nat_gateway = true // Use a single NAT gateway as that's the simplest and also all we need.
tags = var.tags // Use the tags specified as a variable.
map_public_ip_on_launch = var.map_public_ip_on_launch // Map public IP on launch for instances in public subnets.

enable_ipv6 = var.enable_ipv6 // this will provide Amazon-provided IPv6 CIDR block which is a /56 block
public_subnet_assign_ipv6_address_on_creation = var.enable_ipv6 // this will help the EC2 to get the IPV6 address when it boots
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,9 @@ variable "enable_ipv6" {
description = "Whether to enable the ipv6 stack."
type = bool
}

variable "map_public_ip_on_launch" {
default = false
description = "Whether to map public IPs on launch."
type = bool
}

0 comments on commit c4d2266

Please sign in to comment.