Skip to content

Commit 670e2ed

Browse files
committed
eli-204 adding _status method for healthcheck
1 parent 6109493 commit 670e2ed

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
resource "aws_api_gateway_method" "get_patient_check" {
2+
rest_api_id = module.eligibility_signposting_api_gateway.rest_api_id
3+
resource_id = aws_api_gateway_resource.patient.id
4+
http_method = "GET"
5+
authorization = "NONE"
6+
api_key_required = false
7+
8+
depends_on = [
9+
aws_api_gateway_resource.patient,
10+
aws_api_gateway_resource.patient_check,
11+
]
12+
}
13+
14+
resource "aws_api_gateway_integration" "get_patient_check" {
15+
rest_api_id = module.eligibility_signposting_api_gateway.rest_api_id
16+
resource_id = aws_api_gateway_resource.patient.id
17+
http_method = aws_api_gateway_method.get_patient_check.http_method
18+
integration_http_method = "POST" # Needed for lambda proxy integration
19+
type = "AWS_PROXY"
20+
uri = module.get_patient_check.invoke_arn # placeholder for the actual lambda function ARN
21+
22+
depends_on = [
23+
aws_api_gateway_method.get_patient_check
24+
]
25+
}
26+
27+
resource "aws_lambda_permission" "get_patient_check" {
28+
statement_id = "AllowExecutionFromAPIGateway"
29+
action = "lambda:InvokeFunction"
30+
function_name = module.get_patient_check.function_name # placeholder for the actual lambda function name
31+
principal = "apigateway.amazonaws.com"
32+
33+
source_arn = "${module.eligibility_signposting_api_gateway.execution_arn}/*/*"
34+
}

0 commit comments

Comments
 (0)