Skip to content

Commit eeb6282

Browse files
committed
Another try
1 parent fabd648 commit eeb6282

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

infrastructure/terraform/components/api/api_gateway_rest_api_tls.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
# aws_api_gateway_rest_api whenever the desired security policy changes, ensuring
66
# the new API is always created with the correct TLS version.
77
locals {
8-
rest_api_security_policy = "SecurityPolicy_TLS13_1_2_2021_06"
8+
rest_api_security_policy = "SecurityPolicy_TLS13_1_2_2021_06"
9+
rest_api_endpoint_access_mode = "STRICT"
910
}
1011

1112
resource "terraform_data" "rest_api_security_policy" {
12-
input = local.rest_api_security_policy
13+
input = {
14+
security_policy = local.rest_api_security_policy
15+
endpoint_access_mode = local.rest_api_endpoint_access_mode
16+
}
1317
}

infrastructure/terraform/components/api/locals.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ locals {
88
APIG_EXECUTION_ROLE_ARN = aws_iam_role.api_gateway_execution_role.arn
99
AWS_REGION = var.region
1010
SECURITY_POLICY = local.rest_api_security_policy
11+
ENDPOINT_ACCESS_MODE = local.rest_api_endpoint_access_mode
1112
AUTHORIZER_LAMBDA_ARN = module.authorizer_lambda.function_arn
1213
GET_LETTER_LAMBDA_ARN = module.get_letter.function_arn
1314
GET_LETTERS_LAMBDA_ARN = module.get_letters.function_arn

infrastructure/terraform/components/api/resources/spec.tmpl.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,5 +308,6 @@
308308
}
309309
}
310310
},
311+
"x-amazon-apigateway-endpoint-access-mode": "${ENDPOINT_ACCESS_MODE}",
311312
"x-amazon-apigateway-security-policy": "${SECURITY_POLICY}"
312313
}

0 commit comments

Comments
 (0)