Skip to content

Commit

Permalink
terraform config
Browse files Browse the repository at this point in the history
  • Loading branch information
vggonzal committed Nov 2, 2023
1 parent 79d032c commit f1d7348
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 58 deletions.
58 changes: 1 addition & 57 deletions terraform/api-specification-templates/hydrocron_aws_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,60 +108,4 @@ paths:
type: array
items:
type: string
x-openapi-router-controller: hydrocron_api.controllers.timeseries

x-amazon-apigateway-integration:
uri: ${hydrocron_api_lambda_arn_timeseries}
responses:
default:
statusCode: "200"
responseTemplates:
application/json: |
#set($inputRoot = $input.path('$'))
#if($inputRoot.toString().contains('206 PARTIAL CONTENT'))
#set($context.responseOverride.status = 206)
#end
$input.json('$')
^400.*:
statusCode: "400"
responseTemplates:
application/json: |-
{
"error" : "$input.path('$.errorMessage')"
}
^404.*:
statusCode: "404"
responseTemplates:
application/json: |-
{
"error" : "$input.path('$.errorMessage')"
}
^413.*:
statusCode: "413"
responseTemplates:
application/json: |-
{
"error" : "$input.path('$.errorMessage')"
}
^[^1-5].*:
statusCode: "500"
responseTemplates:
application/json: |-
{
"error" : "$input.path('$.errorMessage')"
}
requestTemplates:
application/json: |-
{
"body": {
"exact":"$input.params('exact')",
"region": "$input.params('region')",
"page_number": "$input.params('page_number')" ,
"page_size": "$input.params('page_size')" ,
"polygon_format": "$input.params('polygon_format')"
}
}
passthroughBehavior: when_no_templates
httpMethod: POST
contentHandling: CONVERT_TO_TEXT
type: aws
x-openapi-router-controller: hydrocron_api.controllers.timeseries
2 changes: 1 addition & 1 deletion terraform/hydrocron-main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ resource "aws_lambda_permission" "allow_hydrocron-timeseries" {
function_name = aws_lambda_function.hydrocron_lambda_timeseries.function_name
principal = "apigateway.amazonaws.com"

# The "/*/*/*" portion grants access from any method on any resource
# The "/*/*/*" portion grants access from any method on any resource
# within the API Gateway REST API.
source_arn = "${aws_api_gateway_rest_api.hydrocron-api-gateway.execution_arn}/*/*/*"
}
Expand Down

0 comments on commit f1d7348

Please sign in to comment.