Skip to content

Commit 738a29c

Browse files
Fix api gateway routes
1 parent cd50ae7 commit 738a29c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

infra/resources/_modules/mcp_server/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ No modules.
2121
|------|------|
2222
| [aws_apigatewayv2_api.mcp_server](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_api) | resource |
2323
| [aws_apigatewayv2_integration.lambda_proxy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_integration) | resource |
24-
| [aws_apigatewayv2_route.proxy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_route) | resource |
25-
| [aws_apigatewayv2_stage.prod](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_stage) | resource |
24+
| [aws_apigatewayv2_route.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_route) | resource |
25+
| [aws_apigatewayv2_route.mcp](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_route) | resource |
26+
| [aws_apigatewayv2_stage.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_stage) | resource |
2627
| [aws_ecr_repository.server](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_repository) | resource |
2728
| [aws_iam_policy.lambda_bedrock_access](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
2829
| [aws_iam_role.server](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |

infra/resources/_modules/mcp_server/api_gateway.tf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ resource "aws_apigatewayv2_integration" "lambda_proxy" {
1616
payload_format_version = "2.0"
1717
}
1818

19-
resource "aws_apigatewayv2_route" "proxy" {
19+
resource "aws_apigatewayv2_route" "mcp" {
20+
api_id = aws_apigatewayv2_api.mcp_server.id
21+
route_key = "ANY /mcp/{proxy+}"
22+
target = "integrations/${aws_apigatewayv2_integration.lambda_proxy.id}"
23+
}
24+
25+
resource "aws_apigatewayv2_route" "default" {
2026
api_id = aws_apigatewayv2_api.mcp_server.id
2127
route_key = "$default"
2228
target = "integrations/${aws_apigatewayv2_integration.lambda_proxy.id}"
2329
}
2430

25-
resource "aws_apigatewayv2_stage" "prod" {
31+
resource "aws_apigatewayv2_stage" "default" {
2632
api_id = aws_apigatewayv2_api.mcp_server.id
27-
name = "prod"
33+
name = "$default"
2834
auto_deploy = true
2935
tags = var.tags
3036

0 commit comments

Comments
 (0)