Skip to content

Commit 68ad2b1

Browse files
feat: Add variable create_route to control creation of route (#98)
Co-authored-by: Anton Babenko <anton@antonbabenko.com>
1 parent d652d75 commit 68ad2b1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ module "api_gateway" {
9090
create_default_stage_api_mapping = false # to control creation of "$default" stage and API mapping
9191
create_routes_and_integrations = false # to control creation of routes and integrations
9292
create_vpc_link = false # to control creation of VPC link
93+
94+
integrations= {
95+
"GET /" = {
96+
create_route = false # to control creation of route
97+
}
98+
}
9399
94100
# ... omitted
95101
}

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ resource "aws_apigatewayv2_stage" "default" {
9191
}
9292

9393
dynamic "route_settings" {
94-
for_each = { for k, v in var.integrations : k => v if var.create_routes_and_integrations && length(setintersection(["data_trace_enabled", "detailed_metrics_enabled", "logging_level", "throttling_burst_limit", "throttling_rate_limit"], keys(v))) > 0 }
94+
for_each = { for k, v in var.integrations : k => v if var.create_routes_and_integrations && try(tobool(v.create_route), true) && length(setintersection(["data_trace_enabled", "detailed_metrics_enabled", "logging_level", "throttling_burst_limit", "throttling_rate_limit"], keys(v))) > 0 }
9595

9696
content {
9797
route_key = route_settings.key

0 commit comments

Comments
 (0)