File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
customer-managed/aws/terraform Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,8 @@ resource "aws_route_table" "main" {
22 vpc_id = data. aws_vpc . redpanda . id
33}
44
5- locals {
6- create_private_subnet_routes = local. create_private_subnets ? true : var. create_private_s3_route
7- }
8-
95resource "aws_route_table" "private" {
10- count = local. create_private_subnet_routes ? length (local . subnet_ids ) : 0
6+ count = local. create_private_subnets ? length (var . private_subnet_cidrs ) : 0
117 vpc_id = data. aws_vpc . redpanda . id
128
139 tags = merge (
@@ -30,14 +26,14 @@ resource "aws_route_table_association" "public" {
3026}
3127
3228resource "aws_route_table_association" "private" {
33- count = local. create_private_subnet_routes ? length (aws_route_table . private ) : 0
34- subnet_id = local . subnet_ids [count . index ]
29+ count = local. create_private_subnets ? length (var . private_subnet_cidrs ) : 0
30+ subnet_id = aws_subnet . private [count . index ]. id
3531 route_table_id = aws_route_table. private [count . index ]. id
3632}
3733
3834# Routes S3 traffic to the local gateway endpoint
3935resource "aws_vpc_endpoint_route_table_association" "private_s3" {
40- count = length (aws_route_table . private )
36+ count = local . create_private_subnets ? length (var . private_subnet_cidrs ) : 0
4137 vpc_endpoint_id = aws_vpc_endpoint. s3 . id
4238 route_table_id = aws_route_table. private [count . index ]. id
4339}
Original file line number Diff line number Diff line change @@ -185,12 +185,12 @@ variable "enable_redpanda_connect" {
185185 HELP
186186}
187187
188+ # tflint-ignore: terraform_unused_declarations
188189variable "create_private_s3_route" {
189190 type = bool
190191 default = false
191192 description = <<- HELP
192- Applies only when private_subnet_ids is passed. If private subnets are created externally this variable defaults
193- to skipping creation of a VPC endpoint and route to S3 for private access to S3 buckets. Setting this variable to
194- true will create the VPC endpoint and route to S3 for private access to S3 buckets for the passed private subnet IDs.
193+ DEPRECATED: When private subnets are created externally, s3 routes will never be created here and are also expected
194+ to be created externally. This variable will be removed in a future release.
195195 HELP
196196}
You can’t perform that action at this time.
0 commit comments