Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | The availability zones to provision. If specified will ignore num\_azs | `list(string)` | `[]` | no |
| <a name="input_disable_nat_gateway"></a> [disable\_nat\_gateway](#input\_disable\_nat\_gateway) | If set to true, will not create NAT Gateway and EC2 Nodes should put in public subnets. This could be useful when wanna save costs from nat gateway. | `bool` | `false` | no |
| <a name="input_enable_s3_gateway_endpoint"></a> [enable\_s3\_gateway\_endpoint](#input\_enable\_s3\_gateway\_endpoint) | If set to true, will create S3 VPC Endpoint. This could be useful when wanna save costs from NAT Gateway. | `bool` | `false` | no |
| <a name="input_num_azs"></a> [num\_azs](#input\_num\_azs) | The number of availability zones to provision | `number` | `2` | no |
| <a name="input_private_subnet_newbits"></a> [private\_subnet\_newbits](#input\_private\_subnet\_newbits) | The number of bits to added to the VPC CIDR prefix. For instance, if your VPC CIDR is a /16 and you set this number to 4, the subnets will be /20s. | `number` | `4` | no |
| <a name="input_private_subnet_start"></a> [private\_subnet\_start](#input\_private\_subnet\_start) | The starting octet for the private subnet CIDR blocks generated by this module. | `number` | `0` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ resource "aws_route_table_association" "private_assoc" {
}

resource "aws_vpc_endpoint" "s3_gateway_endpoint" {
count = var.disable_nat_gateway ? 0 : 1
count = var.disable_nat_gateway || !var.enable_s3_gateway_endpoint ? 0 : 1

vpc_id = aws_vpc.vpc.id
service_name = format("com.amazonaws.%s.s3", var.region)
Expand Down
6 changes: 6 additions & 0 deletions modules/vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ variable "disable_nat_gateway" {
default = false
description = "If set to true, will not create NAT Gateway and EC2 Nodes should put in public subnets. This could be useful when wanna save costs from nat gateway."
}

variable "enable_s3_gateway_endpoint" {
type = bool
default = false
description = "If set to true, will create S3 VPC Endpoint. This could be useful when wanna save costs from NAT Gateway."
}
Loading