11resource "aws_api_gateway_resource" "get_document_reference" {
2+ count = local. is_production ? 0 : 1
23 rest_api_id = aws_api_gateway_rest_api. ndr_doc_store_api . id
34 parent_id = module. create-doc-ref-gateway . gateway_resource_id
45 path_part = " {id}"
56}
67
78resource "aws_api_gateway_method" "get_document_reference" {
9+ count = local. is_production ? 0 : 1
810 rest_api_id = aws_api_gateway_rest_api. ndr_doc_store_api . id
9- resource_id = aws_api_gateway_resource. get_document_reference . id
11+ resource_id = aws_api_gateway_resource. get_document_reference [ 0 ] . id
1012 http_method = " GET"
1113 authorization = " NONE"
1214 api_key_required = true
@@ -16,6 +18,7 @@ resource "aws_api_gateway_method" "get_document_reference" {
1618}
1719
1820module "get-doc-fhir-lambda" {
21+ count = local. is_production ? 0 : 1
1922 source = " ./modules/lambda"
2023 name = " GetDocumentReference"
2124 handler = " handlers.get_fhir_document_reference_handler.lambda_handler"
@@ -26,7 +29,7 @@ module "get-doc-fhir-lambda" {
2629 module . ndr-lloyd-george-store . s3_read_policy_document ,
2730 ]
2831 rest_api_id = aws_api_gateway_rest_api. ndr_doc_store_api . id
29- resource_id = aws_api_gateway_resource. get_document_reference . id
32+ resource_id = aws_api_gateway_resource. get_document_reference [ 0 ] . id
3033 http_methods = [" GET" ]
3134 api_execution_arn = aws_api_gateway_rest_api. ndr_doc_store_api . execution_arn
3235 lambda_environment_variables = {
@@ -41,5 +44,5 @@ module "get-doc-fhir-lambda" {
4144 CLOUDFRONT_URL = module.cloudfront- distribution- lg.cloudfront_url
4245 PDS_FHIR_IS_STUBBED = local.is_sandbox
4346 }
44- depends_on = [aws_api_gateway_method . get_document_reference ]
47+ depends_on = [aws_api_gateway_method . get_document_reference [ 0 ] ]
4548}
0 commit comments