Skip to content

Commit 27ab8d9

Browse files
committed
[release/2024-10-14] update apigw default messages
1 parent 986ff7a commit 27ab8d9

File tree

1 file changed

+9
-14
lines changed
  • infrastructure/terraform/per_workspace/modules/api_entrypoint/api_gateway

1 file changed

+9
-14
lines changed

infrastructure/terraform/per_workspace/modules/api_entrypoint/api_gateway/api_gateway.tf

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ resource "aws_api_gateway_gateway_response" "api_access_denied" {
8282
response_type = "ACCESS_DENIED"
8383
response_templates = {
8484
"application/json" = jsonencode({
85-
resourceType : "OperationOutcome",
86-
issue : [{
87-
severity : "error",
88-
code : "processing",
89-
diagnostics : "$context.authorizer.error"
85+
errors : [{
86+
code : "PROCESSING"
87+
message : "$context.authorizer.error"
9088
}]
9189
})
9290
}
@@ -100,11 +98,9 @@ resource "aws_api_gateway_gateway_response" "api_default_4xx" {
10098
response_type = "DEFAULT_4XX"
10199
response_templates = {
102100
"application/json" = jsonencode({
103-
resourceType : "OperationOutcome",
104-
issue : [{
105-
severity : "error",
106-
code : "processing"
107-
diagnostics : "$context.error.message"
101+
errors : [{
102+
code : "PROCESSING"
103+
message : "$context.error.message"
108104
}]
109105
}) }
110106
response_parameters = { "gatewayresponse.header.Access-Control-Allow-Origin" = "'*'"
@@ -116,10 +112,9 @@ resource "aws_api_gateway_gateway_response" "api_default_5xx" {
116112
response_type = "DEFAULT_5XX"
117113
response_templates = {
118114
"application/json" = jsonencode({
119-
resourceType : "OperationOutcome",
120-
issue : [{
121-
severity : "error",
122-
code : "exception"
115+
errors : [{
116+
code : "PROCESSING"
117+
message : "exception"
123118
}]
124119
}) }
125120
response_parameters = { "gatewayresponse.header.Access-Control-Allow-Origin" = "'*'"

0 commit comments

Comments
 (0)