Commit 6b765ba0 authored by Ilia Lazebnik's avatar Ilia Lazebnik Committed by GitHub

feat: add enable_public_s3_endpoint variable for S3 VPC Endpoint for public subnets (#502)

parent 5c60272e
...@@ -442,6 +442,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway ...@@ -442,6 +442,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
| enable\_monitoring\_endpoint | Should be true if you want to provision a CloudWatch Monitoring endpoint to the VPC | `bool` | `false` | no | | enable\_monitoring\_endpoint | Should be true if you want to provision a CloudWatch Monitoring endpoint to the VPC | `bool` | `false` | no |
| enable\_nat\_gateway | Should be true if you want to provision NAT Gateways for each of your private networks | `bool` | `false` | no | | enable\_nat\_gateway | Should be true if you want to provision NAT Gateways for each of your private networks | `bool` | `false` | no |
| enable\_public\_redshift | Controls if redshift should have public routing table | `bool` | `false` | no | | enable\_public\_redshift | Controls if redshift should have public routing table | `bool` | `false` | no |
| enable\_public\_s3\_endpoint | Whether to enable S3 VPC Endpoint for public subnets | `bool` | `true` | no |
| enable\_qldb\_session\_endpoint | Should be true if you want to provision an QLDB Session endpoint to the VPC | `bool` | `false` | no | | enable\_qldb\_session\_endpoint | Should be true if you want to provision an QLDB Session endpoint to the VPC | `bool` | `false` | no |
| enable\_rds\_endpoint | Should be true if you want to provision an RDS endpoint to the VPC | `bool` | `false` | no | | enable\_rds\_endpoint | Should be true if you want to provision an RDS endpoint to the VPC | `bool` | `false` | no |
| enable\_rekognition\_endpoint | Should be true if you want to provision a Rekognition endpoint to the VPC | `bool` | `false` | no | | enable\_rekognition\_endpoint | Should be true if you want to provision a Rekognition endpoint to the VPC | `bool` | `false` | no |
......
...@@ -304,6 +304,12 @@ variable "external_nat_ips" { ...@@ -304,6 +304,12 @@ variable "external_nat_ips" {
default = [] default = []
} }
variable "enable_public_s3_endpoint" {
description = "Whether to enable S3 VPC Endpoint for public subnets"
default = true
type = bool
}
variable "enable_dynamodb_endpoint" { variable "enable_dynamodb_endpoint" {
description = "Should be true if you want to provision a DynamoDB endpoint to the VPC" description = "Should be true if you want to provision a DynamoDB endpoint to the VPC"
type = bool type = bool
......
...@@ -30,7 +30,7 @@ resource "aws_vpc_endpoint_route_table_association" "intra_s3" { ...@@ -30,7 +30,7 @@ resource "aws_vpc_endpoint_route_table_association" "intra_s3" {
} }
resource "aws_vpc_endpoint_route_table_association" "public_s3" { resource "aws_vpc_endpoint_route_table_association" "public_s3" {
count = var.create_vpc && var.enable_s3_endpoint && length(var.public_subnets) > 0 ? 1 : 0 count = var.create_vpc && var.enable_s3_endpoint && var.enable_public_s3_endpoint && length(var.public_subnets) > 0 ? 1 : 0
vpc_endpoint_id = aws_vpc_endpoint.s3[0].id vpc_endpoint_id = aws_vpc_endpoint.s3[0].id
route_table_id = aws_route_table.public[0].id route_table_id = aws_route_table.public[0].id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment