Skip to content

Commit

Permalink
terraform config
Browse files Browse the repository at this point in the history
  • Loading branch information
vggonzal committed Nov 1, 2023
1 parent 75c8749 commit bc8af6c
Showing 1 changed file with 56 additions and 14 deletions.
70 changes: 56 additions & 14 deletions terraform/api-specification-templates/hydrocron_aws_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,59 @@ paths:
items:
type: string
x-openapi-router-controller: hydrocron_api.controllers.timeseries
x-amazon-apigateway-policy:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal: '*'
Action: 'execute-api:Invoke'
Resource: '*'
- Effect: Deny
Principal: '*'
Action: 'execute-api:Invoke'
Resource: '*'
Condition:
StringNotEquals:
'aws:SourceVpc': ${vpc_id}

x-amazon-apigateway-integration:
uri: ${hydrocron_lambda_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

0 comments on commit bc8af6c

Please sign in to comment.