@@ -33,11 +33,60 @@ resource "aws_api_gateway_base_path_mapping" "mtls_api_mapping" {
3333 depends_on = [aws_api_gateway_deployment . mtls_api_deploy ]
3434}
3535
36- # Dummy Lambda integration for POC
37- resource "aws_api_gateway_resource" "mtls_test_lambda " {
36+ # Mock integration for testing POC
37+ resource "aws_api_gateway_resource" "mtls_test_mock " {
3838 rest_api_id = aws_api_gateway_rest_api. mtls_doc_store_api . id
3939 parent_id = aws_api_gateway_rest_api. mtls_doc_store_api . root_resource_id
40- path_part = " test_lambda"
40+ path_part = " test_mock"
41+ }
42+
43+ resource "aws_api_gateway_method" "mtls_test_mock_method" {
44+ rest_api_id = aws_api_gateway_rest_api. mtls_doc_store_api . id
45+ resource_id = aws_api_gateway_resource. mtls_test_mock . id
46+ http_method = " GET"
47+ authorization = " NONE"
48+ }
49+
50+ resource "aws_api_gateway_integration" "mtls_test_mock_integration" {
51+ rest_api_id = aws_api_gateway_rest_api. mtls_doc_store_api . id
52+ resource_id = aws_api_gateway_resource. mtls_test_mock . id
53+ http_method = aws_api_gateway_method. mtls_test_mock_method . http_method
54+ type = " MOCK"
55+ integration_http_method = " GET"
56+
57+ request_templates = {
58+ " application/json" = << EOF
59+ {
60+ "statusCode": 200
61+ }
62+ EOF
63+ }
64+ }
65+
66+ resource "aws_api_gateway_method_response" "mtls_test_mock_response" {
67+ rest_api_id = aws_api_gateway_rest_api. mtls_doc_store_api . id
68+ resource_id = aws_api_gateway_resource. mtls_test_mock . id
69+ http_method = aws_api_gateway_method. mtls_test_mock_method . http_method
70+ status_code = " 200"
71+
72+ response_models = {
73+ " application/json" = " Empty"
74+ }
75+ }
76+
77+ resource "aws_api_gateway_integration_response" "mtls_test_mock_integration_response" {
78+ rest_api_id = aws_api_gateway_rest_api. mtls_doc_store_api . id
79+ resource_id = aws_api_gateway_resource. mtls_test_mock . id
80+ http_method = aws_api_gateway_method. mtls_test_mock_method . http_method
81+ status_code = aws_api_gateway_method_response. mtls_test_mock_response . status_code
82+
83+ response_templates = {
84+ " application/json" = << EOF
85+ {
86+ "message": "Hello from mTLS MOCK endpoint!"
87+ }
88+ EOF
89+ }
4190}
4291
4392resource "aws_api_gateway_deployment" "mtls_api_deploy" {
0 commit comments